diff options
author | Robert Jonsson <spamatica@gmail.com> | 2010-10-13 19:34:22 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2010-10-13 19:34:22 +0000 |
commit | 8a2c2824a59d7644e13bc52c9a0ecbd641f21f95 (patch) | |
tree | 064ad3f2bf8daab0ad27b128abd86a9bbdb1e496 /muse2/muse/midiseq.h | |
parent | a27706d9629e8b592cca4659f865b70adef24e6d (diff) |
new branch muse2, first checkin
Diffstat (limited to 'muse2/muse/midiseq.h')
-rw-r--r-- | muse2/muse/midiseq.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/muse2/muse/midiseq.h b/muse2/muse/midiseq.h new file mode 100644 index 00000000..a11820fe --- /dev/null +++ b/muse2/muse/midiseq.h @@ -0,0 +1,102 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: midiseq.h,v 1.6.2.11 2009/12/20 05:00:35 terminator356 Exp $ +// +// (C) Copyright 2003 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __MIDISEQ_H__ +#define __MIDISEQ_H__ + +#include "thread.h" +#include "mpevent.h" +#include "driver/alsatimer.h" +#include "driver/rtctimer.h" + +class MPEventList; +class SynthI; +class MTC; +class MidiPort; +class MidiDevice; + +//--------------------------------------------------------- +// MidiSeq +//--------------------------------------------------------- + +class MidiSeq : public Thread { + int realRtcTicks; + int timerFd; + int idle; + int prio; // realtime priority + int midiClock; + static int ticker; + +/* Testing */ + bool playStateExt; // used for keeping play state in sync functions + int recTick; // ext sync tick position +// int lastTickPos; // position of last sync tick + // run values: +// unsigned _midiTick; + double mclock1, mclock2; + double songtick1, songtick2; + int recTick1, recTick2; + int lastTempo; + double timediff[24]; + int storedtimediffs; + + void alignAllTicks(int frameOverride = 0); +/* Testing */ + + Timer *timer; + + signed int selectTimer(); + bool setRtcTicks(); + static void midiTick(void* p, void*); + void processTimerTick(); + void processSeek(); + void processStop(); + void processMidiClock(); + virtual void processMsg(const ThreadMsg*); + void updatePollFd(); + + void mtcSyncMsg(const MTC&, int, bool); + //void mtcInputFull(const unsigned char* p, int n); + //void nonRealtimeSystemSysex(const unsigned char* p, int n); + + public: + //MidiSeq(int prio, const char* name); + MidiSeq(const char* name); + + ~MidiSeq(); + + //bool start(); + virtual void start(int); + + virtual void threadStop(); + virtual void threadStart(void*); + + void realtimeSystemInput(int, int); + void mtcInputQuarter(int, unsigned char); + void setSongPosition(int, int); + // void eventReceived(MidiRecordEvent& event); + //void mmcInput(const unsigned char* p, int n); + void mmcInput(int, const unsigned char*, int); + void mtcInputFull(int, const unsigned char*, int); + void nonRealtimeSystemSysex(int, const unsigned char*, int); + + void msgMsg(int id); + void msgProcess(); + void msgSeek(); + void msgStop(); + void msgSetRtc(); + void msgUpdatePollFd(); + void msgAddSynthI(SynthI* synth); + void msgRemoveSynthI(SynthI* synth); + void msgSetMidiDevice(MidiPort*, MidiDevice*); + }; + +extern MidiSeq* midiSeq; +extern volatile bool midiBusy; +#endif + |