|
hydrogen 1.2.3
|
The MidiMap maps MidiActions to MidiEvents. More...
#include <MidiMap.h>
Public Member Functions | |
| ~MidiMap () | |
| std::vector< int > | findCCValuesByActionParam1 (QString sActionType, QString sParam1) |
| std::vector< int > | findCCValuesByActionType (QString sActionType) |
| std::multimap< int, std::shared_ptr< Action > > | getCCActionMap () const |
| std::vector< std::shared_ptr< Action > > | getCCActions (int nParameter) |
| Returns the cc action which was linked to the given event. | |
| std::multimap< QString, std::shared_ptr< Action > > | getMMCActionMap () const |
| std::vector< std::shared_ptr< Action > > | getMMCActions (QString sEventString) |
| Returns all MMC actions which are linked to the given event. | |
| std::multimap< int, std::shared_ptr< Action > > | getNoteActionMap () const |
| std::vector< std::shared_ptr< Action > > | getNoteActions (int nNote) |
| Returns all note actions which are linked to the given event. | |
| std::vector< std::shared_ptr< Action > > | getPCActions () const |
| Returns the pc action which was linked to the given event. | |
| std::vector< std::pair< H2Core::MidiMessage::Event, int > > | getRegisteredMidiEvents (std::shared_ptr< Action > pAction) const |
| void | registerCCEvent (int, std::shared_ptr< Action >) |
| Sets up the relation between a cc event and an action. | |
| void | registerMMCEvent (QString, std::shared_ptr< Action >) |
| Sets up the relation between a mmc event and an action. | |
| void | registerNoteEvent (int, std::shared_ptr< Action >) |
| Sets up the relation between a note event and an action. | |
| void | registerPCEvent (std::shared_ptr< Action >) |
| Sets up the relation between a program change and an action. | |
| void | reset () |
| Reinitializes the object. | |
| QString | toQString (const QString &sPrefix="", bool bShort=true) const override |
| Formatted string version for debugging purposes. | |
Public Member Functions inherited from Object< MidiMap > | |
| Object () | |
| Object (const Object< MidiMap > &other) | |
Public Member Functions inherited from Base | |
| Base () | |
| Base (const Base &other) | |
| virtual const char * | class_name () const |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. | |
Static Public Member Functions | |
| static void | create_instance () |
| If __instance equals 0, a new MidiMap singleton will be created and stored in it. | |
| static MidiMap * | get_instance () |
| Returns a pointer to the current MidiMap singleton stored in __instance. | |
| static void | reset_instance () |
| Convenience function calling reset() on the current MidiMap __instance. | |
Static Public Member Functions inherited from Base | |
| static const char * | _class_name () |
| return the class name | |
| static QString | base_clock (const QString &sMsg) |
| Measures the current time and stores it in __last_clock. | |
| static QString | base_clock_in (const QString &sMsg) |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! | |
| static bool | count_active () |
| static int | getAliveObjectCount () |
| static object_map_t | getObjectMap () |
| static Logger * | logger () |
| return the logger instance | |
| static int | objects_count () |
| static void | printObjectMapDiff (object_map_t map) |
| Creates the difference between a snapshot of the object map and its current state and prints it to std::cout. | |
| static void | set_count (bool flag) |
| enable/disable class instances counting | |
| static void | write_objects_map_to (std::ostream &out, object_map_t *map=nullptr) |
| output the full objects map to a given ostream | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr | |
Static Public Attributes | |
| static MidiMap * | __instance = nullptr |
| Object holding the current MidiMap singleton. | |
Static Public Attributes inherited from Base | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. | |
Private Member Functions | |
| MidiMap () | |
Private Attributes | |
| QMutex | __mutex |
| std::multimap< int, std::shared_ptr< Action > > | m_ccActionMap |
| std::multimap< QString, std::shared_ptr< Action > > | m_mmcActionMap |
| std::multimap< int, std::shared_ptr< Action > > | m_noteActionMap |
| std::vector< std::shared_ptr< Action > > | m_pcActionVector |
Additional Inherited Members | |
Protected Member Functions inherited from Object< MidiMap > | |
| ~Object () | |
Protected Member Functions inherited from Base | |
| ~Base () | |
Static Protected Member Functions inherited from Base | |
| static void | registerClass (const char *name, const atomic_obj_cpt_t *counters) |
Static Protected Attributes inherited from Base | |
| static bool | __count = false |
| should we count class instances | |
| static timeval | __last_clock = { 0, 0 } |
| static Logger * | __logger = nullptr |
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 | ( | ) |
Definition at line 57 of file MidiMap.cpp.
|
private |
Definition at line 46 of file MidiMap.cpp.
|
static |
If __instance equals 0, a new MidiMap singleton will be created and stored in it.
It is called in Hydrogen::create_instance().
Definition at line 64 of file MidiMap.cpp.
| std::vector< int > findCCValuesByActionParam1 | ( | QString | sActionType, |
| QString | sParam1 ) |
Definition at line 262 of file MidiMap.cpp.
| std::vector< int > findCCValuesByActionType | ( | QString | sActionType | ) |
Definition at line 276 of file MidiMap.cpp.
|
inlinestatic |
Returns a pointer to the current MidiMap singleton stored in __instance.
|
inline |
| std::vector< std::shared_ptr< Action > > getCCActions | ( | int | nParameter | ) |
Returns the cc action which was linked to the given event.
Definition at line 246 of file MidiMap.cpp.
|
inline |
| std::vector< std::shared_ptr< Action > > getMMCActions | ( | QString | sEventString | ) |
Returns all MMC actions which are linked to the given event.
Definition at line 212 of file MidiMap.cpp.
|
inline |
| std::vector< std::shared_ptr< Action > > getNoteActions | ( | int | nNote | ) |
Returns all note actions which are linked to the given event.
Definition at line 229 of file MidiMap.cpp.
|
inline |
| std::vector< std::pair< H2Core::MidiMessage::Event, int > > getRegisteredMidiEvents | ( | std::shared_ptr< Action > | pAction | ) | const |
Definition at line 289 of file MidiMap.cpp.
| void registerCCEvent | ( | int | nParameter, |
| std::shared_ptr< Action > | pAction ) |
Sets up the relation between a cc event and an action.
Definition at line 161 of file MidiMap.cpp.
| void registerMMCEvent | ( | QString | sEventString, |
| std::shared_ptr< Action > | pAction ) |
Sets up the relation between a mmc event and an action.
Definition at line 96 of file MidiMap.cpp.
| void registerNoteEvent | ( | int | nNote, |
| std::shared_ptr< Action > | pAction ) |
Sets up the relation between a note event and an action.
Definition at line 130 of file MidiMap.cpp.
| void registerPCEvent | ( | std::shared_ptr< Action > | pAction | ) |
Sets up the relation between a program change and an action.
Definition at line 190 of file MidiMap.cpp.
| void reset | ( | ) |
Reinitializes the object.
Clears the complete midi map and releases the memory of the contained actions.
Definition at line 82 of file MidiMap.cpp.
|
static |
Convenience function calling reset() on the current MidiMap __instance.
Definition at line 71 of file MidiMap.cpp.
|
overridevirtual |
Formatted string version for debugging purposes.
| sPrefix | String prefix which will be added in front of every new line |
| bShort | Instead of the whole content of all classes stored as members just a single unique identifier will be displayed without line breaks. |
Reimplemented from Base.
Definition at line 334 of file MidiMap.cpp.
|
static |
Object holding the current MidiMap singleton.
It is initialized with NULL, set with create_instance(), and accessed with get_instance().
|
private |
|
private |
|
private |