hydrogen 1.1.1
MidiActionManager Class Reference

The MidiActionManager cares for the execution of MidiActions. More...

#include <MidiAction.h>

Inheritance diagram for MidiActionManager:
Object

Data Structures

struct  targeted_element
 Contains all information to find a particular object in a list of objects, like an effect among all LADSPA effects present or an individual sample. More...
 

Public Member Functions

bool handleAction (Action *)
 The handleAction method is the heart of the MidiActionManager class. More...
 
QStringList getActionList ()
 
QStringList getEventList ()
 
 MidiActionManager ()
 
 ~MidiActionManager ()
 
- 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 MidiActionManager singleton will be created and stored in it. More...
 
static MidiActionManagerget_instance ()
 Returns a pointer to the current MidiActionManager 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 Loggerlogger ()
 return the logger instance More...
 

Private Types

typedef bool(MidiActionManager::* action_f) (Action *, H2Core::Hydrogen *, targeted_element)
 

Private Member Functions

bool play (Action *, H2Core::Hydrogen *, targeted_element)
 
bool play_stop_pause_toggle (Action *, H2Core::Hydrogen *, targeted_element)
 
bool stop (Action *, H2Core::Hydrogen *, targeted_element)
 
bool pause (Action *, H2Core::Hydrogen *, targeted_element)
 
bool record_ready (Action *, H2Core::Hydrogen *, targeted_element)
 
bool record_strobe_toggle (Action *, H2Core::Hydrogen *, targeted_element)
 
bool record_strobe (Action *, H2Core::Hydrogen *, targeted_element)
 
bool record_exit (Action *, H2Core::Hydrogen *, targeted_element)
 
bool mute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool unmute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool mute_toggle (Action *, H2Core::Hydrogen *, targeted_element)
 
bool strip_mute_toggle (Action *, H2Core::Hydrogen *, targeted_element)
 
bool strip_solo_toggle (Action *, H2Core::Hydrogen *, targeted_element)
 
bool next_bar (Action *, H2Core::Hydrogen *, targeted_element)
 
bool previous_bar (Action *, H2Core::Hydrogen *, targeted_element)
 
bool bpm_increase (Action *, H2Core::Hydrogen *, targeted_element)
 
bool bpm_decrease (Action *, H2Core::Hydrogen *, targeted_element)
 
bool bpm_cc_relative (Action *, H2Core::Hydrogen *, targeted_element)
 
bool bpm_fine_cc_relative (Action *, H2Core::Hydrogen *, targeted_element)
 
bool master_volume_relative (Action *, H2Core::Hydrogen *, targeted_element)
 
bool master_volume_absolute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool strip_volume_relative (Action *, H2Core::Hydrogen *, targeted_element)
 
bool strip_volume_absolute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool effect_level_relative (Action *, H2Core::Hydrogen *, targeted_element)
 
bool effect_level_absolute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool select_next_pattern (Action *, H2Core::Hydrogen *, targeted_element)
 
bool select_only_next_pattern (Action *, H2Core::Hydrogen *, targeted_element)
 
bool select_next_pattern_cc_absolute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool select_next_pattern_relative (Action *, H2Core::Hydrogen *, targeted_element)
 
bool select_and_play_pattern (Action *, H2Core::Hydrogen *, targeted_element)
 
bool pan_relative (Action *, H2Core::Hydrogen *, targeted_element)
 
bool pan_absolute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool filter_cutoff_level_absolute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool beatcounter (Action *, H2Core::Hydrogen *, targeted_element)
 
bool tap_tempo (Action *, H2Core::Hydrogen *, targeted_element)
 
bool playlist_song (Action *, H2Core::Hydrogen *, targeted_element)
 
bool playlist_next_song (Action *, H2Core::Hydrogen *, targeted_element)
 
bool playlist_previous_song (Action *, H2Core::Hydrogen *, targeted_element)
 
bool toggle_metronome (Action *, H2Core::Hydrogen *, targeted_element)
 
bool select_instrument (Action *, H2Core::Hydrogen *, targeted_element)
 
bool undo_action (Action *, H2Core::Hydrogen *, targeted_element)
 
bool redo_action (Action *, H2Core::Hydrogen *, targeted_element)
 
bool gain_level_absolute (Action *, H2Core::Hydrogen *, targeted_element)
 
bool pitch_level_absolute (Action *, H2Core::Hydrogen *, targeted_element)
 

Private Attributes

QStringList actionList
 Holds the names of all Action identfiers which Hydrogen is able to interpret. More...
 
std::map< std::string, std::pair< action_f, targeted_element > > actionMap
 Holds all Action identifiers which Hydrogen is able to interpret. More...
 
QStringList eventList
 
int m_nLastBpmChangeCCParameter
 

Static Private Attributes

static MidiActionManager__instance = nullptr
 Object holding the current MidiActionManager singleton. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Object
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes. More...
 
- Static Protected Attributes inherited from Object
static Logger__logger = nullptr
 logger instance pointer More...
 

Detailed Description

The MidiActionManager cares for the execution of MidiActions.

The MidiActionManager handles the execution of midi actions. The class includes the names and implementations of all possible actions.

Author
Sebastian Moors

Member Typedef Documentation

◆ action_f

typedef bool(MidiActionManager::* action_f) (Action *, H2Core::Hydrogen *, targeted_element)
private

Constructor & Destructor Documentation

◆ MidiActionManager()

◆ ~MidiActionManager()

Member Function Documentation

◆ beatcounter()

bool beatcounter ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ bpm_cc_relative()

bool bpm_cc_relative ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ bpm_decrease()

bool bpm_decrease ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ bpm_fine_cc_relative()

bool bpm_fine_cc_relative ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ bpm_increase()

bool bpm_increase ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ create_instance()

void create_instance ( )
static

If __instance equals 0, a new MidiActionManager singleton will be created and stored in it.

It is called in H2Core::Hydrogen::create_instance().

◆ effect_level_absolute()

bool effect_level_absolute ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element  nEffect 
)
private

◆ effect_level_relative()

bool effect_level_relative ( Action ,
H2Core::Hydrogen ,
targeted_element   
)
private

◆ filter_cutoff_level_absolute()

bool filter_cutoff_level_absolute ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ gain_level_absolute()

bool gain_level_absolute ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element  nSample 
)
private

◆ get_instance()

static MidiActionManager * get_instance ( )
inlinestatic

Returns a pointer to the current MidiActionManager singleton stored in __instance.

◆ getActionList()

QStringList getActionList ( )
inline

◆ getEventList()

QStringList getEventList ( )
inline

◆ handleAction()

bool handleAction ( Action pAction)

The handleAction method is the heart of the MidiActionManager class.

It executes the operations that are needed to carry the desired action.

◆ master_volume_absolute()

bool master_volume_absolute ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ master_volume_relative()

bool master_volume_relative ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ mute()

bool mute ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ mute_toggle()

bool mute_toggle ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ next_bar()

bool next_bar ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ pan_absolute()

bool pan_absolute ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ pan_relative()

bool pan_relative ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ pause()

bool pause ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ pitch_level_absolute()

bool pitch_level_absolute ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element  nSample 
)
private

◆ play()

bool play ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ play_stop_pause_toggle()

bool play_stop_pause_toggle ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ playlist_next_song()

bool playlist_next_song ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ playlist_previous_song()

bool playlist_previous_song ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ playlist_song()

bool playlist_song ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ previous_bar()

bool previous_bar ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ record_exit()

bool record_exit ( Action ,
H2Core::Hydrogen ,
targeted_element   
)
private

◆ record_ready()

bool record_ready ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ record_strobe()

bool record_strobe ( Action ,
H2Core::Hydrogen ,
targeted_element   
)
private

◆ record_strobe_toggle()

bool record_strobe_toggle ( Action ,
H2Core::Hydrogen ,
targeted_element   
)
private

◆ redo_action()

bool redo_action ( Action ,
H2Core::Hydrogen ,
targeted_element   
)
private

◆ select_and_play_pattern()

bool select_and_play_pattern ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element  t 
)
private

◆ select_instrument()

bool select_instrument ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ select_next_pattern()

bool select_next_pattern ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ select_next_pattern_cc_absolute()

bool select_next_pattern_cc_absolute ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ select_next_pattern_relative()

bool select_next_pattern_relative ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ select_only_next_pattern()

bool select_only_next_pattern ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ stop()

bool stop ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ strip_mute_toggle()

bool strip_mute_toggle ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ strip_solo_toggle()

bool strip_solo_toggle ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ strip_volume_absolute()

bool strip_volume_absolute ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ strip_volume_relative()

bool strip_volume_relative ( Action pAction,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ tap_tempo()

bool tap_tempo ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

◆ toggle_metronome()

bool toggle_metronome ( Action ,
H2Core::Hydrogen ,
targeted_element   
)
private

◆ undo_action()

bool undo_action ( Action ,
H2Core::Hydrogen ,
targeted_element   
)
private

◆ unmute()

bool unmute ( Action ,
H2Core::Hydrogen pEngine,
targeted_element   
)
private

Field Documentation

◆ __instance

MidiActionManager * __instance = nullptr
staticprivate

Object holding the current MidiActionManager singleton.

It is initialized with NULL, set with create_instance(), and accessed with get_instance().

◆ actionList

QStringList actionList
private

Holds the names of all Action identfiers which Hydrogen is able to interpret.

◆ actionMap

std::map<std::string, std::pair<action_f, targeted_element> > actionMap
private

Holds all Action identifiers which Hydrogen is able to interpret.


It holds pointer to member function.

◆ eventList

QStringList eventList
private

◆ m_nLastBpmChangeCCParameter

int m_nLastBpmChangeCCParameter
private