NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
|
Stores current MIDI general parameters for a MIDISequencer object, embedding a MIDISequencerTrackState for each track. More...
#include <sequencer.h>
Public Member Functions | |
MIDISequencerState (MIDIMultiTrack *multitrack_, MIDISequencerGUINotifier *n=0) | |
The constructor is called by the MIDISequencer class constructor, which sets appropriate values for parameters. More... | |
MIDISequencerState (const MIDISequencerState &s) | |
The copy constructor. More... | |
virtual | ~MIDISequencerState () |
The destructor. More... | |
const MIDISequencerState & | operator= (const MIDISequencerState &s) |
The assignment operator. See the note to the copy constructor. More... | |
void | Reset () |
Resets the state to default values. More... | |
bool | Process (MIDITimedMessage *msg) |
This is the process function inherited from MIDIProcessor. More... | |
void | Notify (int group, int item=0) const |
Notifies the GUI when something happens (a parameter was changed, current time is moved, etc.) More... | |
void | NotifyTrack (int item) const |
These are used for notifying the GUI when something happens (a parameter was changed, current time is moved, etc.) More... | |
void | GoForwardNoEvent (MIDIClockTime t) |
Sets the cur time to the given time. More... | |
![]() | |
MIDIProcessor () | |
The constructor. More... | |
virtual | ~MIDIProcessor () |
The destructor. More... | |
Public Attributes | |
MIDISequencerGUINotifier * | notifier |
The notifier. More... | |
MIDIMultiTrack * | multitrack |
The MIDIMultiTrack holding MIDI messages. More... | |
MIDIMultiTrackIterator | iterator |
The iterator for moving along the multitrack. More... | |
MIDIClockTime | cur_clock |
The current MIDI clock in MIDI ticks. More... | |
float | cur_time_ms |
The current clock in milliseconds. More... | |
unsigned int | cur_beat |
The current beat in the measure (1st beat is 0) More... | |
unsigned int | cur_measure |
The current measure (1st measure is 0) More... | |
MIDIClockTime | beat_length |
The duration of a beat. More... | |
unsigned int | number_of_beats |
Number of beats in the measure. More... | |
MIDIClockTime | next_beat_time |
The MIDI time of the next beat (for internal use) More... | |
float | tempobpm |
The current tempo in beats per minute. More... | |
unsigned int | tempo_scale |
The tempo scale in percentage (100 = true time) More... | |
unsigned char | timesig_numerator |
The numerator of current time signature. More... | |
unsigned char | timesig_denominator |
The denominator of current time signature. More... | |
signed char | keysig_sharpflat |
The current key signature accidents (. More... | |
unsigned char | keysig_mode |
Major mode (0) or minor (1) More... | |
std::string | marker_text |
The current marker. More... | |
std::vector< MIDISequencerTrackState * > | track_states |
A track state for every track. More... | |
int | last_event_track |
Internal use. More... | |
MIDIClockTime | last_beat_time |
Internal use. More... | |
float | ms_per_clock |
Internal use. More... | |
float | last_time_ms |
Internal use. More... | |
MIDIClockTime | last_tempo_change |
Internal use. More... | |
MIDIClockTime | count_in_time |
Internal use. More... | |
unsigned char | playing_status |
Flag affecting the TickProc (count in, auto stop, etc.) More... | |
Static Public Attributes | |
static int | metronome_mode |
Flag affecting how metronome beat is calculated. More... | |
Stores current MIDI general parameters for a MIDISequencer object, embedding a MIDISequencerTrackState for each track.
It contains a MIDIMultiTrackIterator, allowing to set a 'now' time: when current time changes (because the sequencer is playing or time is changed by the user) the object keep tracks of current timesig, keysig, tempo(BPM), marker, measure and beat data. Moreover it contains an independent MIDISequencerTrackState for every MIDI Track of the MIDISequencer, and you can examine them for knowing actual track parameters. It inherits from the pure virtual MIDIProcessor: the MIDISequencer sends to it MIDI messages and it processes them remembering actual parameters and notifying changes to the GUI. All methods and attributes are public because they are used by MIDISequencer class; the advanced class AdvancedSequencer allows you to know actual parameters without directly examining them, so the use of this class is mainly internal. However, you could subclass it if you want to keep track of other parameters.
MIDISequencerState::MIDISequencerState | ( | MIDIMultiTrack * | multitrack_, |
MIDISequencerGUINotifier * | n = 0 |
||
) |
The constructor is called by the MIDISequencer class constructor, which sets appropriate values for parameters.
MIDISequencerState::MIDISequencerState | ( | const MIDISequencerState & | s | ) |
The copy constructor.
|
virtual |
The destructor.
The sequencer and notifier pointers are not owned by the class and they won't freed.
const MIDISequencerState & MIDISequencerState::operator= | ( | const MIDISequencerState & | s | ) |
The assignment operator. See the note to the copy constructor.
|
virtual |
Resets the state to default values.
These are: cur_clock = 0, tempo = 120 bpm, time = 4/4, keysig = C Maj, no marker. Moreover resets all track states (see MIDISequencerTrackState::Reset()).
Implements MIDIProcessor.
|
virtual |
This is the process function inherited from MIDIProcessor.
When you get a MIDI message from the sequencer, it is processed by the state, which updates its parameters and notifies the GUI if required.
Implements MIDIProcessor.
void MIDISequencerState::Notify | ( | int | group, |
int | item = 0 |
||
) | const |
Notifies the GUI when something happens (a parameter was changed, current time is moved, etc.)
void MIDISequencerState::NotifyTrack | ( | int | item | ) | const |
These are used for notifying the GUI when something happens (a parameter was changed, current time is moved, etc.)
void MIDISequencerState::GoForwardNoEvent | ( | MIDIClockTime | t | ) |
Sets the cur time to the given time.
This assumes t > cur_time and no events in the interval. It is used, for example, by the sequencer when it must go to a time with no event, or after the end time in UNBOUNDED mode.
MIDISequencerGUINotifier* MIDISequencerState::notifier |
The notifier.
MIDIMultiTrack* MIDISequencerState::multitrack |
The MIDIMultiTrack holding MIDI messages.
MIDIMultiTrackIterator MIDISequencerState::iterator |
The iterator for moving along the multitrack.
MIDIClockTime MIDISequencerState::cur_clock |
The current MIDI clock in MIDI ticks.
float MIDISequencerState::cur_time_ms |
The current clock in milliseconds.
unsigned int MIDISequencerState::cur_beat |
The current beat in the measure (1st beat is 0)
unsigned int MIDISequencerState::cur_measure |
The current measure (1st measure is 0)
MIDIClockTime MIDISequencerState::beat_length |
The duration of a beat.
unsigned int MIDISequencerState::number_of_beats |
Number of beats in the measure.
MIDIClockTime MIDISequencerState::next_beat_time |
The MIDI time of the next beat (for internal use)
float MIDISequencerState::tempobpm |
The current tempo in beats per minute.
unsigned int MIDISequencerState::tempo_scale |
The tempo scale in percentage (100 = true time)
unsigned char MIDISequencerState::timesig_numerator |
The numerator of current time signature.
unsigned char MIDISequencerState::timesig_denominator |
The denominator of current time signature.
signed char MIDISequencerState::keysig_sharpflat |
The current key signature accidents (.
unsigned char MIDISequencerState::keysig_mode |
Major mode (0) or minor (1)
std::string MIDISequencerState::marker_text |
The current marker.
std::vector<MIDISequencerTrackState*> MIDISequencerState::track_states |
A track state for every track.
int MIDISequencerState::last_event_track |
Internal use.
MIDIClockTime MIDISequencerState::last_beat_time |
Internal use.
float MIDISequencerState::ms_per_clock |
Internal use.
float MIDISequencerState::last_time_ms |
Internal use.
MIDIClockTime MIDISequencerState::last_tempo_change |
Internal use.
MIDIClockTime MIDISequencerState::count_in_time |
Internal use.
unsigned char MIDISequencerState::playing_status |
Flag affecting the TickProc (count in, auto stop, etc.)
|
static |
Flag affecting how metronome beat is calculated.