2016-01-11 06:36:41 -03:00
|
|
|
#ifndef __AUPlayer_h__
|
|
|
|
#define __AUPlayer_h__
|
|
|
|
|
|
|
|
#include "MIDIPlayer.h"
|
|
|
|
|
2016-01-21 02:11:05 -03:00
|
|
|
//#include <string>
|
|
|
|
|
2016-01-11 06:36:41 -03:00
|
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
|
|
#import <AVFoundation/AVFoundation.h>
|
|
|
|
#import <CoreAudio/CoreAudioTypes.h>
|
|
|
|
|
2016-03-13 22:48:17 -03:00
|
|
|
class AUPluginUI;
|
|
|
|
|
2016-01-11 06:36:41 -03:00
|
|
|
class AUPlayer : public MIDIPlayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// zero variables
|
|
|
|
AUPlayer();
|
|
|
|
|
|
|
|
// close, unload
|
|
|
|
virtual ~AUPlayer();
|
|
|
|
|
|
|
|
// configuration
|
2016-03-13 22:48:17 -03:00
|
|
|
void setSoundFont( const char * in );
|
|
|
|
/*void setFileSoundFont( const char * in );*/
|
2016-01-21 02:11:05 -03:00
|
|
|
//void showDialog();
|
2016-01-11 06:36:41 -03:00
|
|
|
|
2016-01-21 02:11:05 -03:00
|
|
|
typedef void (*callback)(OSType uSubType, OSType uManufacturer, const char * name);
|
|
|
|
static void enumComponents(callback cbEnum);
|
2016-01-11 06:36:41 -03:00
|
|
|
|
2016-01-21 02:11:05 -03:00
|
|
|
void setComponent(OSType uSubType, OSType uManufacturer);
|
2016-01-11 06:36:41 -03:00
|
|
|
|
|
|
|
protected:
|
2021-11-02 23:52:12 -03:00
|
|
|
virtual unsigned int send_event_needs_time();
|
2016-04-13 01:16:25 -03:00
|
|
|
virtual void send_event(uint32_t b);
|
2021-11-02 23:52:12 -03:00
|
|
|
virtual void send_sysex(const uint8_t * data, size_t size, size_t port);
|
2016-04-13 01:16:25 -03:00
|
|
|
virtual void render(float * out, unsigned long count);
|
2016-01-11 06:36:41 -03:00
|
|
|
|
|
|
|
virtual void shutdown();
|
|
|
|
virtual bool startup();
|
|
|
|
|
2021-11-02 23:52:12 -03:00
|
|
|
virtual void send_event_time(uint32_t b, unsigned int time);
|
|
|
|
virtual void send_sysex_time(const uint8_t * data, size_t size, size_t port, unsigned int time);
|
|
|
|
|
2016-01-11 06:36:41 -03:00
|
|
|
private:
|
2016-03-13 22:48:17 -03:00
|
|
|
void loadSoundFont(const char * name);
|
2016-01-21 02:11:05 -03:00
|
|
|
|
|
|
|
std::string sSoundFontName;
|
2016-03-13 22:48:17 -03:00
|
|
|
/*std::string sFileSoundFontName;*/
|
2016-01-21 02:11:05 -03:00
|
|
|
|
2016-01-11 06:36:41 -03:00
|
|
|
AudioTimeStamp mTimeStamp;
|
|
|
|
|
|
|
|
AudioUnit samplerUnit[3];
|
|
|
|
|
2016-03-13 22:48:17 -03:00
|
|
|
bool samplerUIinitialized[3];
|
|
|
|
AUPluginUI * samplerUI[3];
|
|
|
|
|
2016-01-11 06:36:41 -03:00
|
|
|
AudioBufferList *bufferList;
|
|
|
|
|
|
|
|
float *audioBuffer;
|
|
|
|
|
2016-01-21 02:11:05 -03:00
|
|
|
OSType componentSubType, componentManufacturer;
|
2016-01-11 06:36:41 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|