Loopp/src/observer/midi.hxx

44 lines
816 B
C++
Raw Normal View History

2013-07-31 18:19:15 +02:00
#ifndef LUPPP_MIDI_OBSERVER_H
#define LUPPP_MIDI_OBSERVER_H
#include <iostream>
#include <string>
2013-10-02 03:11:23 +02:00
#include <jack/midiport.h>
2013-07-31 18:19:15 +02:00
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:
MidiObserver();
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;
///
int status();
2013-10-01 18:42:16 +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){};
private:
// there are jack_port_t* registered ports
2013-10-02 03:11:23 +02:00
jack_port_t* jackInputPort;
jack_port_t* jackOutputPort;
2013-07-31 18:19:15 +02:00
};
#endif // LUPPP_MIDI_OBSERVER_H