2013-07-31 18:19:15 +02:00
|
|
|
|
|
|
|
#ifndef LUPPP_MIDI_OBSERVER_H
|
|
|
|
#define LUPPP_MIDI_OBSERVER_H
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class Jack;
|
|
|
|
extern Jack* jack;
|
|
|
|
|
|
|
|
/** MidiObserver
|
2013-10-01 18:15:28 +02:00
|
|
|
* A base class for obseriving a MIDI port
|
2013-07-31 18:19:15 +02:00
|
|
|
**/
|
|
|
|
class MidiObserver
|
|
|
|
{
|
|
|
|
public:
|
2013-09-30 15:57:17 +02:00
|
|
|
MidiObserver();
|
2013-09-21 00:28:59 +02:00
|
|
|
virtual ~MidiObserver(){};
|
2013-07-31 18:19:15 +02:00
|
|
|
|
2013-09-06 15:18:27 +02:00
|
|
|
/// name string to show in UI
|
|
|
|
virtual std::string getName() = 0;
|
|
|
|
|
2013-10-01 22:41:39 +02:00
|
|
|
///
|
|
|
|
int status();
|
2013-10-01 18:42:16 +02:00
|
|
|
|
2013-10-01 18:08:19 +02:00
|
|
|
/// gets called each process() in JACK
|
2013-10-01 18:42:16 +02:00
|
|
|
void process(int nframes);
|
|
|
|
|
|
|
|
/// called by the subclass to create MIDI ports
|
|
|
|
void registerMidiPorts(std::string name);
|
|
|
|
|
|
|
|
virtual void midi(unsigned char* data){};
|
2013-09-06 15:05:57 +02:00
|
|
|
|
2013-10-01 18:51:51 +02:00
|
|
|
private:
|
2013-10-01 18:08:19 +02:00
|
|
|
// there are jack_port_t* registered ports
|
|
|
|
void* jackInputPort;
|
|
|
|
void* jackOutputPort;
|
2013-09-06 15:05:57 +02:00
|
|
|
|
2013-07-31 18:19:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LUPPP_MIDI_OBSERVER_H
|