30#ifndef _NICMIDI_TICK_H
31#define _NICMIDI_TICK_H
134 std::atomic<bool> running;
A pure virtual class implementing an object which has a callback procedure to be called at every tick...
Definition: tick.h:65
std::recursive_mutex proc_lock
A mutex you can use for implementing thread safe methods.
Definition: tick.h:130
MIDITick * GetFunc() const
Returns the address of the StaticTickProc() method, which will be called by the MIDIManager at every ...
Definition: tick.h:86
virtual void Reset()=0
A pure virtual method which should reinitialize the class parameters.
tPriority GetPriority() const
Returns the priority.
Definition: tick.h:88
tMsecs sys_time_offset
The system time of the last call of Start().
Definition: tick.h:128
static void StaticTickProc(tMsecs sys_time, void *pt)
This is the static callback procedure which the MIDIManager will call at every MIDITimer tick.
Definition: tick.h:116
void SetDevOffset(tMsecs dev_offs)
Sets an user defined time offset, which will be added to every time calculation.
virtual void Start()
Sets the running status as true and starts to call the callback.
virtual void TickProc(tMsecs sys_time)=0
This is the pure virtual function you must implement in your subclass.
tMsecs GetDevOffset() const
Returns the user time offset parameter (see SetDevOffset()).
Definition: tick.h:90
bool IsPlaying() const
Returns true if the callback procedure is active.
Definition: tick.h:92
tMsecs dev_time_offset
A time offset set by the user and which you can use for your calculations.
Definition: tick.h:125
const MIDITick * tick_proc
The pointer to the static callback (set by the constructor to StaticTickProc()).
Definition: tick.h:122
virtual ~MIDITickComponent()
The destructor.
virtual void Stop()
Sets the running status as false and stops the callback.
MIDITickComponent(tPriority pr, MIDITick func)
The constructor.
tPriority
Definition: tick.h:44
unsigned long long tMsecs
The type of a variable which can hold the elapsed time in milliseconds.
Definition: timer.h:44
void() MIDITick(tMsecs, void *)
This is the typedef of the callback functions which are called at every timer tick.
Definition: timer.h:47
@ PR_FIRST
The component is inserted as first element in the queue.
Definition: tick.h:45
@ PR_POST_SEQ
The component is inserted after the sequencer.
Definition: tick.h:48
@ PR_LAST
The component is inserted as last element in the queue.
Definition: tick.h:49
@ PR_PRE_SEQ
The component is inserted before the sequencer.
Definition: tick.h:46
@ PR_SEQ
The component is the sequencer (you can insert only one in the queue)
Definition: tick.h:47
Contains the definition of the MIDITimer class and some other typedef related to MIDI timing.