Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
MidiPlayerEventList Class Reference

Class managing the EventList in the MidiPlayer. More...

#include <midiplayereventlist.h>

Collaboration diagram for MidiPlayerEventList:
Collaboration graph

Public Member Functions

 MidiPlayerEventList ()
 Constructor, resetting member variables. More...
 
void clear ()
 Clear the event list (clear all Midi data). More...
 
void insert (double time, const MidiPlayerEvent &event)
 Insert a new event in the time-ordered list of events. More...
 
void rewind ()
 Rewind: Move the iterator back to the beginning of the Midi song. More...
 
void advance ()
 Advance iterator in the list of events. More...
 
bool atEnd () const
 Predicate, telling us whether we are already at the end of the list. More...
 
const MidiPlayerEvent getEvent () const
 Return a copy of the actual event (zero event if iterator is at the end of the list). More...
 
quint32 getCumulativeTime () const
 Return time of actual event (zero if iterator is at the end of the list). More...
 
int getSize () const
 Get actual list size. More...
 
double getProgressInPercent () const
 Get the playing progress in percent. More...
 
void setProgress (double percent)
 Set the EventList iterator according to a given progress in percent. More...
 
void writeListInReadableForm (QString filename)
 Write content of the list to file in a readable form (for debugging). More...
 

Private Types

typedef QMultiMap< double, MidiPlayerEventMidiEventList
 

Private Attributes

MidiEventList mEventList
 Instance of the event list. More...
 
quint32 mMaxTime
 Maximum time at the end of the list. More...
 
MidiEventList::Iterator pEventIterator
 Iterator playing the notes. More...
 
QMutex mAccessMutex
 Mutex for access. More...
 

Detailed Description

Class managing the EventList in the MidiPlayer.

This class holds a time-ordered list of Midi events for playing. The access is channeled through public functions in order to guarantee thread-safety. The class also provides an iterator (cursor) that can be advanded and controlled. This iterator is used for the actual playing process.

Definition at line 65 of file midiplayereventlist.h.

Member Typedef Documentation

typedef QMultiMap<double,MidiPlayerEvent> MidiPlayerEventList::MidiEventList
private

Definition at line 85 of file midiplayereventlist.h.

Constructor & Destructor Documentation

MidiPlayerEventList::MidiPlayerEventList ( )

Constructor, resetting member variables.

Definition at line 63 of file midiplayereventlist.cpp.

Member Function Documentation

void MidiPlayerEventList::advance ( )

Advance iterator in the list of events.

This function simply advances the iterator in the list by one step. It is called repeatedly while the player is playing.

Definition at line 129 of file midiplayereventlist.cpp.

bool MidiPlayerEventList::atEnd ( ) const

Predicate, telling us whether we are already at the end of the list.

Returns
True if at the end, False otherwise.

Definition at line 145 of file midiplayereventlist.cpp.

void MidiPlayerEventList::clear ( )

Clear the event list (clear all Midi data).

Definition at line 79 of file midiplayereventlist.cpp.

quint32 MidiPlayerEventList::getCumulativeTime ( ) const

Return time of actual event (zero if iterator is at the end of the list).

Returns
Time (in ticks) of the actual event targeted by the iterator

Definition at line 180 of file midiplayereventlist.cpp.

const MidiPlayerEvent MidiPlayerEventList::getEvent ( ) const

Return a copy of the actual event (zero event if iterator is at the end of the list).

Returns
Actual event in the list targeted by the iterator.

Definition at line 162 of file midiplayereventlist.cpp.

double MidiPlayerEventList::getProgressInPercent ( ) const

Get the playing progress in percent.

Returns
Temporal progress in percent.

Definition at line 213 of file midiplayereventlist.cpp.

int MidiPlayerEventList::getSize ( ) const

Get actual list size.

Returns
Number of events in the list.

Definition at line 197 of file midiplayereventlist.cpp.

void MidiPlayerEventList::insert ( double  time,
const MidiPlayerEvent event 
)

Insert a new event in the time-ordered list of events.

Parameters
time: Integer time in ticks used for time-ordering.
event: New event to be inserted.

Definition at line 96 of file midiplayereventlist.cpp.

void MidiPlayerEventList::rewind ( )

Rewind: Move the iterator back to the beginning of the Midi song.

Definition at line 112 of file midiplayereventlist.cpp.

void MidiPlayerEventList::setProgress ( double  percent)

Set the EventList iterator according to a given progress in percent.

Parameters
percent: Temporal progress in percent.

Definition at line 232 of file midiplayereventlist.cpp.

void MidiPlayerEventList::writeListInReadableForm ( QString  filename)

Write content of the list to file in a readable form (for debugging).

Parameters
filename: Name of the file

Definition at line 252 of file midiplayereventlist.cpp.

Member Data Documentation

QMutex MidiPlayerEventList::mAccessMutex
mutableprivate

Mutex for access.

Definition at line 90 of file midiplayereventlist.h.

MidiEventList MidiPlayerEventList::mEventList
private

Instance of the event list.

Definition at line 87 of file midiplayereventlist.h.

quint32 MidiPlayerEventList::mMaxTime
private

Maximum time at the end of the list.

Definition at line 88 of file midiplayereventlist.h.

MidiEventList::Iterator MidiPlayerEventList::pEventIterator
private

Iterator playing the notes.

Definition at line 89 of file midiplayereventlist.h.


The documentation for this class was generated from the following files: