#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioServices.h>
#import <AudioToolbox/AudioToolbox.h>
#include <fluidsynth.h>

@interface TunePlayer : NSObject {
  NSString *filePath;
  float speed;
  int transpose;
  int voice;
  float volume;

  fluid_settings_t* settings;
  fluid_synth_t* synth;
  fluid_audio_driver_t* adriver;
  fluid_player_t* player;
  int sfont_id[8];
}

@property (nonatomic, retain) NSString *filePath;
@property (nonatomic) int transpose;
@property (nonatomic) int voice;
@property (nonatomic) float volume;

+ (TunePlayer *)tunePlayer;

- (id)init;

- (void)play;
- (void)stop;
- (BOOL)playing;

- (int)numVoices;
- (NSString *)voiceName:(int)voice;
- (void)setVoice:(int)voice;

- (float)speed;
- (void)setSpeed:(float)speed;

- (void)playerFinished:(id)sender;

@end
