|
hydrogen 1.2.6
|
OSC Server implementation. More...
#include <OscServer.h>
Public Member Functions | |
| ~OscServer () | |
| Destructor freeing all addresses in m_pClientRegistry and setting __instance to nullptr. | |
| lo::ServerThread * | getServerThread () const |
| Should be only used within the integration tests! | |
| void | handleAction (std::shared_ptr< Action > pAction) |
| Function called by H2Core::CoreActionController::initExternalControlInterfaces() to inform all clients about the current state of Hydrogen using OSC messages send by Hydrogen itself. | |
| bool | init () |
| Registers all handler functions. | |
| bool | start () |
| Starts the OSC server and makes it available to handle commands. | |
| bool | stop () |
| Stops the OSC server and makes it unavailable. | |
Public Member Functions inherited from Object< OscServer > | |
| Object () | |
| Object (const Object< OscServer > &other) | |
Public Member Functions inherited from Base | |
| Base () | |
| Base (const Base &other) | |
| virtual const char * | class_name () const |
| void | logBacktrace () const |
| Print the current stack at point into the debug log. | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. | |
| virtual QString | toQString (const QString &sPrefix="", bool bShort=true) const |
| Formatted string version for debugging purposes. | |
Static Public Member Functions | |
| static void | BEATCOUNTER_Handler (lo_arg **argv, int i) |
| Creates an Action of type BEATCOUNTER and passes its references to MidiActionManager::handleAction(). | |
| static void | BPM_DECR_Handler (lo_arg **argv, int i) |
| Creates an Action of type BPM_DECR and passes its references to MidiActionManager::handleAction(). | |
| static void | BPM_Handler (lo_arg **argv, int i) |
| Creates sets the current tempo of Hydrogen to the provided value (first argument in argv). | |
| static void | BPM_INCR_Handler (lo_arg **argv, int i) |
| Creates an Action of type BPM_INCR and passes its references to MidiActionManager::handleAction(). | |
| static void | CLEAR_INSTRUMENT_Handler (lo_arg **argv, int argc) |
| The handler expects the user to provide the number of the instrument for which all notes should be removed from the currently selected pattern. | |
| static void | CLEAR_PATTERN_Handler (lo_arg **argv, int argc) |
| The handler removes all notes from the the currently selected pattern. | |
| static void | CLEAR_SELECTED_INSTRUMENT_Handler (lo_arg **argv, int argc) |
| static void | create_instance (H2Core::Preferences *pPreferences) |
| If __instance equals nullptr, a new OscServer singleton will be created by calling the OscServer() constructor and stored in __instance. | |
| static void | EXTRACT_DRUMKIT_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::extractDrumkit(). | |
| static void | FILTER_CUTOFF_LEVEL_ABSOLUTE_Handler (QString param1, QString param2) |
| Creates an Action of type FILTER_CUTOFF_LEVEL_ABSOLUTE and passes its references to MidiActionManager::handleAction(). | |
| static int | generic_handler (const char *path, const char *types, lo_arg **argv, int argc, lo_message data, void *user_data) |
| Catches any incoming messages and display them. | |
| static OscServer * | get_instance () |
| Returns a pointer to the current OscServer singleton stored in __instance. | |
| static int | incomingMessageLogging (const char *path, const char *types, lo_arg **argv, int argc, lo_message data, void *user_data) |
| static void | INSTRUMENT_PITCH_Handler (lo_arg **argv, int t) |
| static void | JACK_TIMEBASE_MASTER_ACTIVATION_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::activateJackTimebaseControl(). | |
| static void | JACK_TRANSPORT_ACTIVATION_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::activatedJackTransport(). | |
| static void | LOAD_DRUMKIT_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::setDrumkit(). | |
| static void | LOOP_MODE_ACTIVATION_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::activateLoopMode(). | |
| static void | MASTER_VOLUME_ABSOLUTE_Handler (lo_arg **argv, int i) |
| Calls H2Core::CoreActionController::setMasterVolume() with the first argument in argv. | |
| static void | MASTER_VOLUME_RELATIVE_Handler (lo_arg **argv, int i) |
| Creates an Action of type MASTER_VOLUME_RELATIVE and passes its references to MidiActionManager::handleAction(). | |
| static void | MUTE_Handler (lo_arg **argv, int i) |
| Creates an Action of type MUTE and passes its references to MidiActionManager::handleAction(). | |
| static void | MUTE_TOGGLE_Handler (lo_arg **argv, int i) |
| Creates an Action of type MUTE_TOGGLE and passes its references to MidiActionManager::handleAction(). | |
| static void | NEW_PATTERN_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::newSong(). | |
| static void | NEW_SONG_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::newSong(). | |
| static void | NEXT_BAR_Handler (lo_arg **argv, int i) |
| Creates an Action of type >>_NEXT_BAR and passes its references to MidiActionManager::handleAction(). | |
| static void | NOTE_OFF_Handler (lo_arg **argv, int argc) |
| Provides a similar behavior as a NOTE_OFF MIDI message. | |
| static void | NOTE_ON_Handler (lo_arg **argv, int argc) |
| Provides a similar behavior as a NOTE_ON MIDI message. | |
| static void | OPEN_PATTERN_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::openPattern(). | |
| static void | OPEN_SONG_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::openSong(). | |
| static void | PAUSE_Handler (lo_arg **argv, int i) |
| Creates an Action of type PAUSE and passes its references to MidiActionManager::handleAction(). | |
| static void | PLAY_Handler (lo_arg **argv, int i) |
| Creates an Action of type PLAY and passes its references to MidiActionManager::handleAction(). | |
| static void | PLAY_PAUSE_TOGGLE_Handler (lo_arg **argv, int i) |
| Creates an Action of type PLAY/PAUSE_TOGGLE and passes its references to MidiActionManager::handleAction(). | |
| static void | PLAY_STOP_TOGGLE_Handler (lo_arg **argv, int i) |
| Creates an Action of type PLAY/STOP_TOGGLE and passes its references to MidiActionManager::handleAction(). | |
| static void | PLAYLIST_NEXT_SONG_Handler (lo_arg **argv, int i) |
| Creates an Action of type PLAYLIST_NEXT_SONG and passes its references to MidiActionManager::handleAction(). | |
| static void | PLAYLIST_PREV_SONG_Handler (lo_arg **argv, int i) |
| Creates an Action of type PLAYLIST_PREV_SONG and passes its references to MidiActionManager::handleAction(). | |
| static void | PLAYLIST_SONG_Handler (lo_arg **argv, int i) |
| Creates an Action of type PLAYLIST_SONG and passes its references to MidiActionManager::handleAction(). | |
| static void | PREVIOUS_BAR_Handler (lo_arg **argv, int i) |
| Creates an Action of type <<_PREVIOUS_BAR and passes its references to MidiActionManager::handleAction(). | |
| static QString | qPrettyPrint (lo_type type, void *data) |
| Converts a data data of type type into a printable QString. | |
| static void | QUIT_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::quit(). | |
| static void | RECORD_EXIT_Handler (lo_arg **argv, int i) |
| Creates an Action of type EXIT and passes its references to MidiActionManager::handleAction(). | |
| static void | RECORD_READY_Handler (lo_arg **argv, int i) |
| Creates an Action of type RECORD_READY and passes its references to MidiActionManager::handleAction(). | |
| static void | RECORD_STROBE_Handler (lo_arg **argv, int i) |
| Creates an Action of type RECORD_STROBE and passes its references to MidiActionManager::handleAction(). | |
| static void | RECORD_STROBE_TOGGLE_Handler (lo_arg **argv, int i) |
| Creates an Action of type RECORD/STROBE_TOGGLE and passes its references to MidiActionManager::handleAction(). | |
| static void | REDO_ACTION_Handler (lo_arg **argv, int argc) |
| Creates an Action of type REDO_ACTION and passes its references to MidiActionManager::handleAction(). | |
| static void | RELOCATE_Handler (lo_arg **argv, int argc) |
| static void | REMOVE_PATTERN_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::removePattern(). | |
| static void | SAVE_PREFERENCES_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::savePreferences(). | |
| static void | SAVE_SONG_AS_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::saveSongAs(). | |
| static void | SAVE_SONG_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::saveSong(). | |
| static void | SELECT_AND_PLAY_PATTERN_Handler (lo_arg **argv, int i) |
| Creates an Action of type SELECT_AND_PLAY_PATTERN and passes its references to MidiActionManager::handleAction(). | |
| static void | SELECT_INSTRUMENT_Handler (lo_arg **argv, int i) |
| Creates an Action of type SELECT_INSTRUMENT and passes its references to MidiActionManager::handleAction(). | |
| static void | SELECT_NEXT_PATTERN_Handler (lo_arg **argv, int i) |
| Creates an Action of type SELECT_NEXT_PATTERN and passes its references to MidiActionManager::handleAction(). | |
| static void | SELECT_ONLY_NEXT_PATTERN_Handler (lo_arg **argv, int i) |
| Creates an Action of type SELECT_ONLY_NEXT_PATTERN and passes its references to MidiActionManager::handleAction(). | |
| static void | SONG_EDITOR_TOGGLE_GRID_CELL_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::songEditorToggleGridCell(). | |
| static void | SONG_MODE_ACTIVATION_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::activateSongMode(). | |
| static void | STOP_Handler (lo_arg **argv, int i) |
| Creates an Action of type STOP and passes its references to MidiActionManager::handleAction(). | |
| static void | STRIP_VOLUME_ABSOLUTE_Handler (int param1, float param2) |
| Calls H2Core::CoreActionController::setStripVolume() with both param1 and param2. | |
| static void | STRIP_VOLUME_RELATIVE_Handler (QString param1, QString param2) |
| Creates an Action of type STRIP_VOLUME_RELATIVE and passes its references to MidiActionManager::handleAction(). | |
| static void | TAP_TEMPO_Handler (lo_arg **argv, int i) |
| Creates an Action of type TAP_TEMPO and passes its references to MidiActionManager::handleAction(). | |
| static void | TIMELINE_ACTIVATION_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::activateTimeline(). | |
| static void | TIMELINE_ADD_MARKER_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::addTempoMarker(). | |
| static void | TIMELINE_DELETE_MARKER_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::deleteTempoMarker(). | |
| static void | TOGGLE_METRONOME_Handler (lo_arg **argv, int i) |
| Creates an Action of type TOGGLE_METRONOME and passes its references to MidiActionManager::handleAction(). | |
| static void | UNDO_ACTION_Handler (lo_arg **argv, int i) |
| Creates an Action of type UNDO_ACTION and passes its references to MidiActionManager::handleAction(). | |
| static void | UNMUTE_Handler (lo_arg **argv, int i) |
| Creates an Action of type UNMUTE and passes its references to MidiActionManager::handleAction(). | |
| static void | UPGRADE_DRUMKIT_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::upgradeDrumkit(). | |
| static void | VALIDATE_DRUMKIT_Handler (lo_arg **argv, int argc) |
| Triggers CoreActionController::validateDrumkit(). | |
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 OscServer * | __instance = nullptr |
| Object holding the current OscServer 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 | |
| OscServer (H2Core::Preferences *pPreferences) | |
| Private constructor creating a new OSC server thread using the port H2Core::Preferences::m_nOscServerPort and assigning the object to m_pServerThread. | |
| void | broadcastMessage (const char *msgText, lo_message message) |
| Helper function which sends a message with msgText to all connected clients. | |
Private Attributes | |
| bool | m_bInitialized |
| Used to determine whether the callback methods were already added to m_pServerThread. | |
| std::list< lo_address > | m_pClientRegistry |
| List of all OSC clients known to Hydrogen. | |
| H2Core::Preferences * | m_pPreferences |
| Pointer to the H2Core::Preferences singleton. | |
| lo::ServerThread * | m_pServerThread |
| Object containing the actual thread with an OSC server running in. | |
Additional Inherited Members | |
Protected Member Functions inherited from Object< OscServer > | |
| ~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 |
| static bool | bLogColors = true |
OSC Server implementation.
Open Sound Control (OSC) is a protocol for communication among programs, computers, and hardware, like synthesizers or multimedia devices, via networking protocols such as UDP or TCP. It can be thought of as a replacement for the MIDI protocol with rich benefits, like supporting symbolic and high-resolution numerical argument data, providing an URL-style naming scheme in combination with a pattern matching language, and allowing to bundle messages for a better handling of timing and simultaneous processing.
The OscServer class provides an implementation of an OSC server running in a separate thread and handling all incoming and outgoing OSC messages send to or from Hydrogen. Its naming scheme starts with the prefix /Hydrogen/ followed by the name of one of the handler functions implemented as members of this class without the _Handler() prefix. Sending an OSC message to the path /Hydrogen/PAUSE will thus trigger the PAUSE_Handler() to pause the playback. You can play with these features using the command line program oscsend on UNIX-based systems.
Internally, the OscServer is implemented as a singleton and will be created using create_instance() and queried using get_instance(). Using start() all handler functions will be registered to their corresponding paths and the OSC server thread will start to listen for incoming messages. But this will only happen if H2Core::Preferences::m_bOscServerEnabled is set to true. In addition, Hydrogen will send OSC messages about its current state to all clients each time its state changes if H2Core::Preferences::m_bOscFeedbackEnabled is set to true. H2Core::Preferences::m_nOscServerPort contains the port number the OSC server will be started at.
Please note that the way generic_handler() is implemented, the additional registration of commands without argument to require a float input, and the usage of float arguments instead of int are all because of the limitations of TouchOSC.
Definition at line 89 of file OscServer.h.
| ~OscServer | ( | ) |
Destructor freeing all addresses in m_pClientRegistry and setting __instance to nullptr.
Definition at line 411 of file OscServer.cpp.
|
private |
Private constructor creating a new OSC server thread using the port H2Core::Preferences::m_nOscServerPort and assigning the object to m_pServerThread.
| pPreferences | Pointer to the H2Core::Preferences singleton. Although it could be accessed internally using H2Core::Preferences::get_instance(), this is an appetizer for internal changes happening after the 1.0 release. |
Definition at line 372 of file OscServer.cpp.
|
static |
Creates an Action of type BEATCOUNTER and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 714 of file OscServer.cpp.
|
static |
Creates an Action of type BPM_DECR and passes its references to MidiActionManager::handleAction().
The first argument in argv will be used to set Action::parameter1.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 605 of file OscServer.cpp.
|
static |
Creates sets the current tempo of Hydrogen to the provided value (first argument in argv).
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 572 of file OscServer.cpp.
|
static |
Creates an Action of type BPM_INCR and passes its references to MidiActionManager::handleAction().
The first argument in argv will be used to set Action::parameter1.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 593 of file OscServer.cpp.
|
private |
Helper function which sends a message with msgText to all connected clients.
Definition at line 1178 of file OscServer.cpp.
|
static |
The handler expects the user to provide the number of the instrument for which all notes should be removed from the currently selected pattern.
| argv | The "f" field does contain the instrument number (caution: it starts at 0). |
| argc | Number of arguments passed by the OSC message. |
Definition at line 1037 of file OscServer.cpp.
|
static |
The handler removes all notes from the the currently selected pattern.
| argv | The "f" field does contain the instrument number (caution: it starts at 0). |
| argc | Number of arguments passed by the OSC message. |
Definition at line 1044 of file OscServer.cpp.
|
static |
Definition at line 1024 of file OscServer.cpp.
|
static |
If __instance equals nullptr, a new OscServer singleton will be created by calling the OscServer() constructor and stored in __instance.
It is called in H2Core::Hydrogen::create_instance().
| pPreferences | Pointer to the H2Core::Preferences singleton. Although it could be accessed internally using H2Core::Preferences::get_instance(), this is an appetizer for internal changes happening after the 1.0 release. |
Definition at line 422 of file OscServer.cpp.
|
static |
Triggers CoreActionController::extractDrumkit().
The handler expects the user to provide as first argument the absolute path to a compressed drumkit ( *.h2drumkit). The second argument is optional and contains the absolute path to a directory where the kit will be extracted to. If the second path is missing, the drumkit will be installed in the user's drumkit data folder.
Definition at line 1153 of file OscServer.cpp.
|
static |
Creates an Action of type FILTER_CUTOFF_LEVEL_ABSOLUTE and passes its references to MidiActionManager::handleAction().
| param1 | Sets Action::parameter1 of the newly created Action. |
| param2 | Sets Action::parameter2 of the newly created Action. |
Definition at line 693 of file OscServer.cpp.
|
static |
Catches any incoming messages and display them.
It is also responsible for catching OSC messages at the following paths and invoking the corresponding functions (if only a single argument is present.)
[x] Digit specifying a particular instrument.
| path | The OSC path to register the method to. If NULL is passed the method will match all paths. |
| types | The typespec the method accepts. In Hydrogen handler functions are registered to listen for floats. |
| argv | Pointer to a vector of arguments passed by the OSC message. |
| argc | Number of arguments passed by the OSC message. |
| data | Unused. |
| user_data | Unused. |
Definition at line 170 of file OscServer.cpp.
|
inlinestatic |
Returns a pointer to the current OscServer singleton stored in __instance.
Definition at line 123 of file OscServer.h.
|
inline |
Should be only used within the integration tests!
Definition at line 933 of file OscServer.h.
| void handleAction | ( | std::shared_ptr< Action > | pAction | ) |
Function called by H2Core::CoreActionController::initExternalControlInterfaces() to inform all clients about the current state of Hydrogen using OSC messages send by Hydrogen itself.
The following feedback functions will be used to describe the aforementioned state:
[*] Function will be called for all Instruments in H2Core::Song::__instrument_list.
The constructed messages will contain the Action::parameter2 of pAction as float types (or Action::parameter1 for the actions TOGGLE_METRONOME and MUTE_TOGGLE) and will be associated with one of the following paths:
[x] The last part of the URI is determined by Action::parameter1 and specifies an individual strip.
Only called if H2Core::Preferences::m_bOscServerEnabled is true.
| pAction | Action to be sent to all registered clients. |
Definition at line 1196 of file OscServer.cpp.
|
static |
Definition at line 151 of file OscServer.cpp.
| bool init | ( | ) |
Registers all handler functions.
The path the handlers will be registered at always starts with /Hydrogen/ followed by the name of the handler function without the suffix _Handler. PLAY_Handler() will thus be registered to /Hydrogen/PLAY.
Most handler will be registered for both types "" and "f" (floats). But the following handlers will be registered for floats only:
In case of the session managing handlers the following ones only work with no argument present
The generic_handler() will be registered to match all paths and types.
In addition, a lambda function will be registered to match all types and paths too. If the client has not sent any message to Hydrogen yet, it will take care of its registration to m_pClientRegistry using the address of the received OSC message. More importantly, it also will call H2Core::CoreActionController::initExternalControlInterfaces(), which, apart from MIDI related stuff, use handleAction() to push the current state of Hydrogen to the registered OSC clients. This will happen each time the state of Hydrogen does change.
true on success. Definition at line 1316 of file OscServer.cpp.
|
static |
Definition at line 706 of file OscServer.cpp.
|
static |
Triggers CoreActionController::activateJackTimebaseControl().
| argv | The "f" field does contain the value supplied by the user. If it is 0, Hydrogen will drop JACK Timebase control. Else, it tries to register as Timebase controller instead. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 929 of file OscServer.cpp.
|
static |
Triggers CoreActionController::activatedJackTransport().
| argv | The "f" field does contain the value supplied by the user. If it is 0, the Jack transport will be deactivated. Else, it will be activated instead. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 912 of file OscServer.cpp.
|
static |
Triggers CoreActionController::setDrumkit().
The handler expects the user to provide the drumkit name. (row the pattern resides in within the SongEditor). The second argument, whether or not superfluous instrument should be removed even if there is a pattern in which they contain notes, is optional. The default choice will be true.
Definition at line 1107 of file OscServer.cpp.
|
static |
Triggers CoreActionController::activateLoopMode().
| argv | The "f" field does contain the value supplied by the user. If it is 0, loop mode will be deactivated. Else, it will be activated instead. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 961 of file OscServer.cpp.
|
static |
Calls H2Core::CoreActionController::setMasterVolume() with the first argument in argv.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 617 of file OscServer.cpp.
|
static |
Creates an Action of type MASTER_VOLUME_RELATIVE and passes its references to MidiActionManager::handleAction().
The first argument in argv will be used to set Action::parameter2.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 627 of file OscServer.cpp.
|
static |
Creates an Action of type MUTE and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 522 of file OscServer.cpp.
|
static |
Creates an Action of type MUTE_TOGGLE and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 542 of file OscServer.cpp.
|
static |
Triggers CoreActionController::newSong().
The handler expects the user to provide an absolute path for a .h2pattern file. If another file already exists with the same name, it will be overwritten.
| argv | The "s" field does contain the name for the new pattern. |
| argc | Number of arguments passed by the OSC message. |
Definition at line 988 of file OscServer.cpp.
|
static |
Triggers CoreActionController::newSong().
The handler expects the user to provide an absolute path to a .h2song file. If another file already exists with the same name, it will be overwritten.
| argv | The "s" field does contain the absolute path. |
| argc | Number of arguments passed by the OSC message. |
Definition at line 811 of file OscServer.cpp.
|
static |
Creates an Action of type >>_NEXT_BAR and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 552 of file OscServer.cpp.
|
static |
Provides a similar behavior as a NOTE_OFF MIDI message.
| argv | The "f" field holds the note. It is designed after the MIDI NOTE_ON handling and expects an integer between 36 and 127 (inspired by the General MIDI standard). |
| argc | Number of arguments passed by the OSC message. |
Definition at line 1079 of file OscServer.cpp.
|
static |
Provides a similar behavior as a NOTE_ON MIDI message.
| argv | The first "f" holds the note. It is designed after the MIDI NOTE_ON handling and expects an integer between 36 and 127 (inspired by the General MIDI standard). The second "f" field contains the velocity of the new note within the range of [0, 1.0] |
| argc | Number of arguments passed by the OSC message. |
Definition at line 1051 of file OscServer.cpp.
|
static |
Triggers CoreActionController::openPattern().
The handler expects the user to provide an absolute path to a .h2pattern file.
| argv | The "s" field does contain the absolute path. |
| argc | Number of arguments passed by the OSC message. |
Definition at line 1000 of file OscServer.cpp.
|
static |
Triggers CoreActionController::openSong().
The handler expects the user to provide an absolute path for a .h2song file.
| argv | The "s" field does contain the absolute path. |
| argc | Number of arguments passed by the OSC message. |
Definition at line 818 of file OscServer.cpp.
|
static |
Creates an Action of type PAUSE and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 472 of file OscServer.cpp.
|
static |
Creates an Action of type PLAY and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 432 of file OscServer.cpp.
|
static |
Creates an Action of type PLAY/PAUSE_TOGGLE and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 452 of file OscServer.cpp.
|
static |
Creates an Action of type PLAY/STOP_TOGGLE and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 442 of file OscServer.cpp.
|
static |
Creates an Action of type PLAYLIST_NEXT_SONG and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 746 of file OscServer.cpp.
|
static |
Creates an Action of type PLAYLIST_PREV_SONG and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 756 of file OscServer.cpp.
|
static |
Creates an Action of type PLAYLIST_SONG and passes its references to MidiActionManager::handleAction().
The first argument in argv will be used to set Action::parameter1.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 734 of file OscServer.cpp.
|
static |
Creates an Action of type <<_PREVIOUS_BAR and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 562 of file OscServer.cpp.
|
static |
Converts a data data of type type into a printable QString.
Apart from the basic OSC types LO_INT32, LO_FLOAT, and LO_STRING the following extended OSC types are supported:
LO_BLOB and LO_MIDI are, however, NOT supported.
| type | Liblo class data will be cast to. |
| data | Data to be converted to string. |
Definition at line 50 of file OscServer.cpp.
|
static |
Triggers CoreActionController::quit().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 861 of file OscServer.cpp.
|
static |
Creates an Action of type EXIT and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 512 of file OscServer.cpp.
|
static |
Creates an Action of type RECORD_READY and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 482 of file OscServer.cpp.
|
static |
Creates an Action of type RECORD_STROBE and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 502 of file OscServer.cpp.
|
static |
Creates an Action of type RECORD/STROBE_TOGGLE and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 492 of file OscServer.cpp.
|
static |
Creates an Action of type REDO_ACTION and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| argc | Number of arguments passed by the OSC message. |
Definition at line 798 of file OscServer.cpp.
|
static |
| argv | The "f" field does contain the desired position / number of the pattern group (starting with 0). |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 977 of file OscServer.cpp.
|
static |
Triggers CoreActionController::removePattern().
The handler expects the user to provide the pattern number (row the pattern resides in within the SongEditor).
| argv | The "f" field does contain the pattern number (caution: it starts at 0). |
| argc | Number of arguments passed by the OSC message. |
Definition at line 1012 of file OscServer.cpp.
|
static |
Triggers CoreActionController::savePreferences().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 849 of file OscServer.cpp.
|
static |
Triggers CoreActionController::saveSongAs().
The handler expects the user to provide an absolute path to a .h2song file. If another file already exists with the same name, it will be overwritten.
| argv | The "s" field does contain the absolute path. |
| argc | Number of arguments passed by the OSC message. |
Definition at line 837 of file OscServer.cpp.
|
static |
Triggers CoreActionController::saveSong().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 825 of file OscServer.cpp.
|
static |
Creates an Action of type SELECT_AND_PLAY_PATTERN and passes its references to MidiActionManager::handleAction().
The first argument in argv will be used to set Action::parameter1.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 682 of file OscServer.cpp.
|
static |
Creates an Action of type SELECT_INSTRUMENT and passes its references to MidiActionManager::handleAction().
The first argument in argv will be used to set Action::parameter2.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 776 of file OscServer.cpp.
|
static |
Creates an Action of type SELECT_NEXT_PATTERN and passes its references to MidiActionManager::handleAction().
The first argument in argv will be used to set Action::parameter1.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 660 of file OscServer.cpp.
|
static |
Creates an Action of type SELECT_ONLY_NEXT_PATTERN and passes its references to MidiActionManager::handleAction().
The first argument in argv will be used to set Action::parameter1.
| argv | Pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 671 of file OscServer.cpp.
|
static |
Triggers CoreActionController::songEditorToggleGridCell().
The handler expects the user to provide the pattern number (row the pattern resides in within the SongEditor).
| argv | The first two "f" fields do contain the column and row number of the particular grid cell. |
| argc | Number of arguments passed by the OSC message. |
Definition at line 1094 of file OscServer.cpp.
|
static |
Triggers CoreActionController::activateSongMode().
| argv | The "f" field does contain the value supplied by the user. If it is 0, Pattern mode of the playback will be activated. Else, Song mode will be activated instead. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 945 of file OscServer.cpp.
| bool start | ( | ) |
Starts the OSC server and makes it available to handle commands.
If the server was not properly initialized, this function will do so.
true on success Definition at line 1481 of file OscServer.cpp.
| bool stop | ( | ) |
Stops the OSC server and makes it unavailable.
true on success Definition at line 1508 of file OscServer.cpp.
|
static |
Creates an Action of type STOP and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 462 of file OscServer.cpp.
|
static |
Calls H2Core::CoreActionController::setStripVolume() with both param1 and param2.
| param1 | Passed as first argument to H2Core::CoreActionController::setStripVolume(). |
| param2 | Passed as second argument to H2Core::CoreActionController::setStripVolume(). |
Definition at line 638 of file OscServer.cpp.
|
static |
Creates an Action of type STRIP_VOLUME_RELATIVE and passes its references to MidiActionManager::handleAction().
| param1 | Sets Action::parameter1 of the newly created Action. |
| param2 | Sets Action::parameter2 of the newly created Action. |
Definition at line 648 of file OscServer.cpp.
|
static |
Creates an Action of type TAP_TEMPO and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 724 of file OscServer.cpp.
|
static |
Triggers CoreActionController::activateTimeline().
| argv | The "f" field does contain the value supplied by the user. If it is 0, the Timeline will be deactivated. Else, it will be activated instead. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 870 of file OscServer.cpp.
|
static |
Triggers CoreActionController::addTempoMarker().
| argv | The first field "f" does contain the bar at which to place the new Timeline::TempoMarker while the second one "f" specifies its tempo in bpm. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 887 of file OscServer.cpp.
|
static |
Triggers CoreActionController::deleteTempoMarker().
| argv | The first field "f" does contain the bar at which to delete a Timeline::TempoMarker. |
| argc | Unused number of arguments passed by the OSC message. |
Definition at line 900 of file OscServer.cpp.
|
static |
Creates an Action of type TOGGLE_METRONOME and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 766 of file OscServer.cpp.
|
static |
Creates an Action of type UNDO_ACTION and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 788 of file OscServer.cpp.
|
static |
Creates an Action of type UNMUTE and passes its references to MidiActionManager::handleAction().
| argv | Unused pointer to a vector of arguments passed by the OSC message. |
| i | Unused number of arguments passed by the OSC message. |
Definition at line 532 of file OscServer.cpp.
|
static |
Triggers CoreActionController::upgradeDrumkit().
The handler expects the user to provide as first argument the absolute path to a folder containing a drumkit, the absolute path to a drumkit file (drumkit.xml) itself, or an absolute path to a compressed drumkit ( *.h2drumkit). The second argument is optional and contains the absolute path to a directory where the upgraded kit will be stored. If the second path is missing, the drumkit will be upgraded in place and a backup file will be created in order to not overwrite the existing state. If a compressed drumkit is provided as first argument, the upgraded drumkit will be compressed as well.
Definition at line 1126 of file OscServer.cpp.
|
static |
Triggers CoreActionController::validateDrumkit().
The handler expects the user to provide the absolute path to a folder containing a drumkit, the absolute path to a drumkit file (drumkit.xml) itself, or an absolute path to a compressed drumkit ( *.h2drumkit). The second argument is optional and contains the absolute path to a directory where the upgraded kit will be stored.
Definition at line 1140 of file OscServer.cpp.
|
static |
Object holding the current OscServer singleton.
It is initialized with nullptr, set with create_instance(), and accessed with get_instance().
Definition at line 98 of file OscServer.h.
|
private |
Used to determine whether the callback methods were already added to m_pServerThread.
Definition at line 911 of file OscServer.h.
|
private |
List of all OSC clients known to Hydrogen.
Whenever an OSC client sends a message to the started OSC server of Hydrogen, a lambda handler registered in start() will check whether the address of this client is already present in m_pClientRegistry. If this is not the case it will be added to it and the current state Hydrogen will be propagated to all registered clients.
Definition at line 930 of file OscServer.h.
|
private |
Pointer to the H2Core::Preferences singleton.
Although it could be accessed internally using H2Core::Preferences::get_instance(), this is an appetizer for internal changes happening after the 1.0 release.
Definition at line 906 of file OscServer.h.
|
private |
Object containing the actual thread with an OSC server running in.
It is created in OscServer() and both assigned handlers and started in start().
Definition at line 919 of file OscServer.h.