28#ifndef _NICMIDI_RECORDER_H
29#define _NICMIDI_RECORDER_H
137 unsigned char GetMeasNote()
const {
return meas_note; }
139 unsigned char GetBeatNote()
const {
return beat_note; }
143 void SetMeasNote(
unsigned char note) { meas_note = note; }
145 void SetBeatNote(
unsigned char note) { beat_note = note; }
149 void SetOutPort(
unsigned int p) { port = p; }
152 void SetOutChannel(
int ch) { chan = ch & 0x0f; }
155 { other_notifier = n; }
158 const unsigned char DEFAULT_MEAS_NOTE = 68;
159 const unsigned char DEFAULT_BEAT_NOTE = 60;
161 unsigned char meas_note;
162 unsigned char beat_note;
167 unsigned char num_beats;
210 {
return tracks->GetTrack(trk_num); }
214 {
return seq->GetTrack(trk_num)->GetInPort(); }
218 {
return seq->GetTrack(trk_num)->GetRecChannel(); }
320 std::vector<bool> en_tracks;
321 std::set<unsigned int> en_ports;
328 RecNotifier notifier;
330 std::atomic<bool> rec_on;
331 std::stack<MIDIMultiTrack*> undo_stack;
Stores data representing a MIDI event message.
Definition: msg.h:49
Holds an array of pointers to MIDITrack objects to be played simultaneously.
Definition: multitrack.h:50
A MIDITickComponent which can record MIDI messages incoming from a MIDI in port, putting them into an...
Definition: recorder.h:186
bool SetTrackInPort(unsigned int trk_num, unsigned int port)
Sets the MIDI in port for a track.
MIDIClockTime GetStartRecTime() const
Returns the recording start time in MIDI ticks.
Definition: recorder.h:201
virtual void Stop()
Stops the recording from the enabled ports and channels.
MIDIClockTime GetEndRecTime() const
Returns the recording end time in MIDI ticks.
Definition: recorder.h:203
bool DisableTrack(unsigned int trk_num)
Disables a sequencer track for recording.
bool SetStartRecTime(unsigned int meas, unsigned int beat=0)
Sets the recording start time, giving the measure and beat. See SetStartRecTime(MIDIClockTime).
Definition: recorder.h:239
void SetSeqNotifier()
Internal function.
bool SetStartRecTime(MIDIClockTime t)
Sets the recording start time.
MIDIMultiTrack * GetMultiTrack() const
Returns a pointer to the internal MIDIMultiTrack.
Definition: recorder.h:196
bool InsertTrack(int trk_num=-1)
Inserts into the internal MIDIMultiTrack a new track.
void ResizeTracks(unsigned int max_num)
Internal function.
virtual void Reset()
It sets all tracks to recording disabled, empties the internal multitrack and sets the start and end ...
unsigned int GetTrackInPort(unsigned int trk_num) const
Returns the number of the MIDI in port assigned to the given track.
Definition: recorder.h:213
bool SetEndRecTime(unsigned int meas, unsigned int beat=0)
Sets the recording end time, giving the measure and beat. See SetEndRecTime(MIDIClockTime).
Definition: recorder.h:247
bool EnableTrack(unsigned int trk_num)
Enables a sequencer track for recording.
void PrepareTrack(unsigned int trk_num)
Internal function.
static void StaticTickProc(tMsecs sys_time, void *pt)
Implements the static method inherited by MIDITickComponent and called at every timer tick.
int GetRecMode() const
Returns the recording mode.
Definition: recorder.h:199
bool MoveTrack(int from, int to)
Moves a track from one position to another in the internal MIDIMultiTrack.
@ REC_MERGE
Merge old and new content.
Definition: recorder.h:294
@ REC_OVER
Overwrite the old content.
Definition: recorder.h:295
bool SetTrackRecChannel(unsigned int trk_num, int chan)
Sets the recording channel for the given track.
MIDIRecorder(MIDISequencer *const s)
The constructor. It binds the recorder to the given MIDISequencer.
virtual void Start()
Starts the recording from the enabled ports and channels.
bool DeleteTrack(int trk_num=-1)
Deletes a track and all its events from the internal MIDIMultiTrack.
bool UndoRec()
Deletes the changes made in the last recording.
MIDITrack * GetTrack(unsigned int trk_num)
Returns the pointer to a track of the internal multitrack.
Definition: recorder.h:206
virtual ~MIDIRecorder()
The destructor.
bool SetEndRecTime(MIDIClockTime t)
Sets the recording end time.
virtual void TickProc(tMsecs sys_time)
Implements the pure virtual method inherited from MIDITickComponent (you must not call it directly).
void ResetSeqNotifier()
Internal function. It is used in Stop() to reset the hook in the sequencer notifier.
bool SetRecMode(int mode)
Sets the recording mode.
int GetTrackRecChannel(unsigned int trk_num)
Returns the recording channel for the given track, or -1 for any channel.
Definition: recorder.h:217
const MIDITrack * GetTrack(unsigned int trk_num) const
Returns the pointer to a track of the internal multitrack.
Definition: recorder.h:209
Holds data for a message that the sequencer can send to the GUI to warn it when something happens.
Definition: notifier.h:53
A pure virtual class implementing a device that can send MIDISequencerGUIEvent messages to a GUI.
Definition: notifier.h:162
virtual void Notify(const MIDISequencerGUIEvent &ev)=0
Notifies the MIDISequencerGUIEvent ev.
A MIDITickComponent which implements a basic sequencer, able to play the MIDI events contained in a M...
Definition: sequencer.h:193
A pure virtual class implementing an object which has a callback procedure to be called at every tick...
Definition: tick.h:65
Manages a std::vector of MIDITimedMessage objects storing MIDI events, with methods for editing them.
Definition: track.h:86
unsigned long MIDIClockTime
The type of a variable which can hold a time in MIDI ticks.
Definition: midi.h:40
unsigned long long tMsecs
The type of a variable which can hold the elapsed time in milliseconds.
Definition: timer.h:44
Contains the definition of the pure virtual MIDIProcessor class and its specializations MIDIMultiProc...
Contains the definitions of the classes MIDISequencerTrackState, MIDISequencerState and MIDISequencer...