forked from xLightsSequencer/xLights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSyncMIDI.h
53 lines (44 loc) · 1.8 KB
/
SyncMIDI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
/***************************************************************
* This source files comes from the xLights project
* https://www.xlights.org
* https://github.com/xLightsSequencer/xLights
* See the github commit history for a record of contributing
* developers.
* Copyright claimed based on commit dates recorded in Github
* License: https://github.com/xLightsSequencer/xLights/blob/master/License.txt
**************************************************************/
#include "SyncManager.h"
#include "ScheduleOptions.h"
#include <log4cpp/Category.hh>
#include <mutex>
#define USE_CLOCK_THREAD
class ListenerManager;
class wxMidiOutDevice;
class MIDITimecodeThread;
#ifdef USE_CLOCK_THREAD
class MIDIClockThread;
#endif
class SyncMIDI : public SyncBase
{
wxMidiOutDevice* _midi = nullptr;
size_t _timeCodeOffset = 0;
std::string _timeCodeDevice = "";
TIMECODEFORMAT _timeCodeFormat = TIMECODEFORMAT::F24;
MIDITimecodeThread* _threadTimecode = nullptr;
#ifdef USE_CLOCK_THREAD
MIDIClockThread* _threadClock = nullptr;
mutable std::mutex _mutex;
#endif
uint8_t GetTimeCodeBits() const;
public:
SyncMIDI(SYNCMODE sm, REMOTEMODE rm, const ScheduleOptions& options, ListenerManager* listenerManager);
SyncMIDI(SyncMIDI&& from);
virtual ~SyncMIDI();
virtual void SendSync(uint32_t frameMS, uint32_t stepLengthMS, uint32_t stepMS, uint32_t playlistMS, const std::string& fseq, const std::string& media, const std::string& step, const std::string& timeItem, uint32_t stepno) const override;
virtual std::string GetType() const override { return "MIDI"; }
virtual void SendStop() const override;
double GetInterval();
virtual bool IsReactive() const override { return false; }
void SendClock() const;
};