|
hydrogen 1.1.1
|
The MidiMap maps MidiActions to MidiEvents. More...
#include <MidiMap.h>
Public Types | |
| typedef std::map< QString, Action * > | map_t |
Public Member Functions | |
| ~MidiMap () | |
| void | reset () |
| Reinitializes the object. More... | |
| void | registerMMCEvent (QString, Action *) |
| Sets up the relation between a mmc event and an action. More... | |
| void | registerNoteEvent (int, Action *) |
| Sets up the relation between a note event and an action. More... | |
| void | registerCCEvent (int, Action *) |
| Sets up the relation between a cc event and an action. More... | |
| void | registerPCEvent (Action *) |
| Sets up the relation between a program change and an action. More... | |
| map_t | getMMCMap () |
| Action * | getMMCAction (QString) |
| Returns the mmc action which was linked to the given event. More... | |
| Action * | getNoteAction (int note) |
| Returns the note action which was linked to the given event. More... | |
| Action * | getCCAction (int parameter) |
| Returns the cc action which was linked to the given event. More... | |
| Action * | getPCAction () |
| Returns the pc action which was linked to the given event. More... | |
| int | findCCValueByActionParam1 (QString actionType, QString param1) const |
| int | findCCValueByActionType (QString actionType) const |
| void | setupNoteArray () |
Public Member Functions inherited from Object | |
| ~Object () | |
| destructor More... | |
| Object (const Object &obj) | |
| copy constructor More... | |
| Object (const char *class_name) | |
| constructor More... | |
| const char * | class_name () const |
| return the class name More... | |
| virtual QString | toQString (const QString &sPrefix, bool bShort=true) const |
| Formatted string version for debugging purposes. More... | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. More... | |
Static Public Member Functions | |
| static void | create_instance () |
| If __instance equals 0, a new MidiMap singleton will be created and stored in it. More... | |
| static void | reset_instance () |
| Convenience function calling reset() on the current MidiMap __instance. More... | |
| static MidiMap * | get_instance () |
| Returns a pointer to the current MidiMap singleton stored in __instance. More... | |
Static Public Member Functions inherited from Object | |
| static void | set_count (bool flag) |
| enable/disable class instances counting More... | |
| static bool | count_active () |
| return true if class instances counting is enabled More... | |
| static unsigned | objects_count () |
| return the number of objects More... | |
| static void | write_objects_map_to (std::ostream &out) |
| output the full objects map to a given ostream More... | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr More... | |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! More... | |
| static Logger * | logger () |
| return the logger instance More... | |
Static Public Attributes | |
| static MidiMap * | __instance = nullptr |
| Object holding the current MidiMap singleton. More... | |
Static Public Attributes inherited from Object | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. More... | |
Private Member Functions | |
| MidiMap () | |
Private Attributes | |
| Action * | __note_array [128] |
| Action * | __cc_array [128] |
| Action * | __pc_action |
| map_t | mmcMap |
| QMutex | __mutex |
Additional Inherited Members | |
Static Protected Attributes inherited from Object | |
| static Logger * | __logger = nullptr |
| logger instance pointer More... | |
The MidiMap maps MidiActions to MidiEvents.
The MidiMap stores the mapping between midi events and midi actions. Each event relates to at most 1 midi action. Several events can relate to the same action. Midi events are note, mmc or cc messages.
| ~MidiMap | ( | ) |
|
private |
|
static |
If __instance equals 0, a new MidiMap singleton will be created and stored in it.
It is called in Hydrogen::create_instance().
| int findCCValueByActionParam1 | ( | QString | actionType, |
| QString | param1 | ||
| ) | const |
| int findCCValueByActionType | ( | QString | actionType | ) | const |
|
inlinestatic |
Returns a pointer to the current MidiMap singleton stored in __instance.
| Action * getCCAction | ( | int | parameter | ) |
Returns the cc action which was linked to the given event.
| Action * getMMCAction | ( | QString | eventString | ) |
Returns the mmc action which was linked to the given event.
| std::map< QString, Action * > getMMCMap | ( | ) |
| Action * getNoteAction | ( | int | note | ) |
Returns the note action which was linked to the given event.
| Action * getPCAction | ( | ) |
Returns the pc action which was linked to the given event.
| void registerCCEvent | ( | int | parameter, |
| Action * | pAction | ||
| ) |
Sets up the relation between a cc event and an action.
| void registerMMCEvent | ( | QString | eventString, |
| Action * | pAction | ||
| ) |
Sets up the relation between a mmc event and an action.
| void registerNoteEvent | ( | int | note, |
| Action * | pAction | ||
| ) |
Sets up the relation between a note event and an action.
| void registerPCEvent | ( | Action * | pAction | ) |
Sets up the relation between a program change and an action.
| void reset | ( | ) |
Reinitializes the object.
Clears the complete midi map and releases the memory of the contained actions.
|
static |
Convenience function calling reset() on the current MidiMap __instance.
| void setupNoteArray | ( | ) |
|
private |
|
static |
Object holding the current MidiMap singleton.
It is initialized with NULL, set with create_instance(), and accessed with get_instance().
|
private |
|
private |
|
private |
|
private |