|
hydrogen 1.2.6
|
Hydrogen Audio Engine. More...
#include <Hydrogen.h>
Public Types | |
| enum | ErrorMessages { UNKNOWN_DRIVER , ERROR_STARTING_DRIVER , JACK_SERVER_SHUTDOWN , JACK_CANNOT_ACTIVATE_CLIENT , JACK_CANNOT_CONNECT_OUTPUT_PORT , JACK_CANNOT_CLOSE_CLIENT , JACK_ERROR_IN_PORT_REGISTER , OSC_CANNOT_CONNECT_TO_PORT , PLAYBACK_TRACK_INVALID } |
| enum class | GUIState { notReady = -1 , unavailable = 0 , ready = 1 } |
| Specifies the state of the Qt GUI. More... | |
| enum class | Tempo { Song = 0 , Timeline = 1 , Jack = 2 } |
| Specifies where the AudioEngine does get its current tempo updates from. More... | |
Public Member Functions | |
| ~Hydrogen () | |
| Destructor taking care of most of the clean up. | |
| void | __panic () |
| void | addInstrumentToDeathRow (std::shared_ptr< Instrument > pInstr) |
| Add pInstr to __instrument_death_row and triggers __kill_instruments(). | |
| bool | addRealtimeNote (int instrument, float velocity, bool noteoff=false, int msg1=0) |
| bool | flushAndAddNextPattern (int nPatternNumber) |
| Wrapper around AudioEngine::flushAndAddNextPattern(). | |
| Song::ActionMode | getActionMode () const |
| AudioEngine * | getAudioEngine () const |
| AudioOutput * | getAudioOutput () const |
| Used to display audio driver info. | |
| int | getBcStatus () |
| int | getbeatsToCount () |
| int | getColumnForTick (long nTick, bool bLoopMode, long *pPatternStartTick) const |
| Find a PatternList/column corresponding to the supplied tick position nTick. | |
| CoreActionController * | getCoreActionController () const |
| GUIState | getGUIState () const |
| int | getHihatOpenness () const |
| bool | getIsExportSessionActive () const |
| bool | getIsModified () const |
| Wrapper around Song::getIsModified() that checks whether a song is set. | |
| float | getJackTimebaseControllerBpm () const |
| JackAudioDriver::Timebase | getJackTimebaseState () const |
| QString | getLastLoadedDrumkitName () const |
| QString | getLastLoadedDrumkitPath () const |
| MidiMessage::Event | getLastMidiEvent () const |
| Last received midi message. | |
| int | getLastMidiEventParameter () const |
| MidiInput * | getMidiInput () const |
| Used to display midi driver info. | |
| MidiOutput * | getMidiOutput () const |
| Song::Mode | getMode () const |
| float | getNoteLength () |
| Song::PatternMode | getPatternMode () const |
| Song::PlaybackTrack | getPlaybackTrackState () const |
| Wrapper around Song::getPlaybackTrackState(). | |
| std::shared_ptr< Instrument > | getSelectedInstrument () const |
| int | getSelectedInstrumentNumber () const |
| int | getSelectedPatternNumber () const |
| bool | getSessionDrumkitNeedsRelinking () const |
| bool | getSessionIsExported () const |
| std::shared_ptr< Song > | getSong () const |
| Get the current song. | |
| SoundLibraryDatabase * | getSoundLibraryDatabase () const |
| Tempo | getTempoSource () const |
| long | getTickForColumn (int nColumn) const |
| Get the total number of ticks passed up to a nColumn / pattern group. | |
| std::shared_ptr< Timeline > | getTimeline () const |
| bool | handleBeatCounter () |
| bool | hasJackAudioDriver () const |
| bool | hasJackTransport () const |
| void | initJackTimebaseControl () |
| Calling JackAudioDriver::initTimebaseControl() directly from the GUI. | |
| bool | instrumentHasNotes (std::shared_ptr< Instrument > pInst) |
| Test if an Instrument has some Note in the Pattern (used to test before deleting an Instrument) | |
| bool | isPatternEditorLocked () const |
| Convenience function checking whether using the Pattern Editor is locked in the song settings and the song is in song mode. | |
| bool | isTimelineEnabled () const |
| Convenience function checking whether using the Timeline tempo is set in the Preferences, Song::SONG_MODE is set, and there is an external JACK Timebase controller (application) present. | |
| bool | isUnderSessionManagement () const |
| void | loadPlaybackTrack (QString sFilename) |
| Wrapper function for loading the playback track. | |
| void | midi_noteOn (Note *note) |
| void | mutePlaybackTrack (const bool bMuted) |
| Wrapper around Song::setPlaybackTrackEnabled(). | |
| void | onTapTempoAccelEvent () |
| void | previewInstrument (std::shared_ptr< Instrument > pInstr) |
| void | previewSample (Sample *pSample) |
| void | raiseError (unsigned nErrorCode) |
| void | recalculateRubberband (float fBpm) |
| Recalculates all Samples using RubberBand for a specific tempo fBpm. | |
| void | recreateOscServer () |
| Destroys and recreates the OscServer singleton in order to adopt a new OSC port. | |
| void | releaseJackTimebaseControl () |
| Calling JackAudioDriver::releaseTimebaseControl() directly from the GUI. | |
| void | removeInstrument (int nInstrumentNumber) |
| Delete an Instrument. | |
| void | removeSong () |
| void | renameJackPorts (std::shared_ptr< Song > pSong) |
| Calls audioEngine_renameJackPorts() if Preferences::m_bJackTrackOuts is set to true. | |
| void | restartDrivers () |
| void | restartLadspaFX () |
| void | sequencer_play () |
| Start the internal sequencer. | |
| void | sequencer_stop () |
| Stop the internal sequencer. | |
| void | setActionMode (Song::ActionMode mode) |
| Wrapper around Song::setActionMode() which also triggers EVENT_ACTION_MODE_CHANGE and should be used by all parts of the code except for song reading/setting. | |
| void | setBcOffsetAdjust () |
| void | setbeatsToCount (int beatstocount) |
| Updates m_nbeatsToCount. | |
| void | setGUIState (const GUIState state) |
| void | setHihatOpenness (int nValue) |
| void | setIsModified (bool bIsModified) |
| Wrapper around Song::setIsModified() that checks whether a song is set. | |
| void | setIsPatternEditorLocked (bool bValue) |
| void | setIsTimelineActivated (bool bEnabled) |
| Wrapper around both Song::setIsTimelineActivated (recent) and Preferences::setUseTimelinebpm() (former place to store the variable but kept to maintain backward compatibility) which also triggers EVENT_TIMELINE_ACTIVATION. | |
| void | setLastMidiEvent (MidiMessage::Event event) |
| void | setLastMidiEventParameter (int nParam) |
| void | setMode (Song::Mode mode) |
| Wrapper around Song::setMode() which also triggers EVENT_SONG_MODE_ACTIVATION and should be used by all parts of the code except for song reading/setting. | |
| void | setNoteLength (float notelength) |
| void | setPatternMode (Song::PatternMode mode) |
| Wrapper around Song::setPatternMode() which also triggers EVENT_STACKED_MODE_ACTIVATION and should be used by all parts of the code except for song reading/setting. | |
| void | setSelectedInstrumentNumber (int nInstrument, bool bTriggerEvent=true) |
| void | setSelectedPatternNumber (int nPat, bool bNeedsLock=true, bool bForce=false) |
| Sets m_nSelectedPatternNumber. | |
| void | setSessionDrumkitNeedsRelinking (bool bNeedsRelinking) |
| void | setSessionIsExported (bool bIsExported) |
| void | setSong (std::shared_ptr< Song > newSong, bool bRelinking=true) |
| Sets the current song __song to newSong. | |
| void | setTapTempo (float fInterval) |
| void | setTimeline (std::shared_ptr< Timeline >) |
| bool | startExportSession (int nSampleRate, int nSampleDepth, double fCompressionLevel=0.0) |
| void | startExportSong (const QString &filename) |
| Export a song to a wav file. | |
| void | startNsmClient () |
| void | stopExportSession () |
| void | stopExportSong () |
| void | toggleNextPattern (int nPatternNumber) |
| Wrapper around AudioEngine::toggleNextPattern(). | |
| void | toggleOscServer (bool bEnable) |
| Starts/stops the OSC server. | |
| QString | toQString (const QString &sPrefix="", bool bShort=true) const override |
| Formatted string version for debugging purposes. | |
| void | updateSelectedPattern (bool bNeedsLock=true) |
| Updates the selected pattern to the one recorded note will be inserted to. | |
| void | updateSongSize () |
| void | updateVirtualPatterns () |
| Processes the patterns added to any virtual ones in the PatternList of the current Song and ensure both the playing pattern representation in the AudioEngine and the GUI are synced. | |
Public Member Functions inherited from Object< Hydrogen > | |
| Object () | |
| Object (const Object< Hydrogen > &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. | |
Static Public Member Functions | |
| static void | create_instance () |
| Creates all the instances used within Hydrogen in the right order. | |
| static Hydrogen * | get_instance () |
| Returns the current Hydrogen instance __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 | |
Data Fields | |
| int | m_nInstrumentLookupTable [MAX_INSTRUMENTS] |
| midi lookuptable | |
Private Member Functions | |
| Hydrogen () | |
| Constructor, entry point, and initialization of the Hydrogen application. | |
| void | __kill_instruments () |
| void | initBeatcounter () |
| Auxiliary function setting a bunch of global variables. | |
Private Attributes | |
| std::list< std::shared_ptr< Instrument > > | __instrument_death_row |
| Deleting instruments too soon leads to potential crashes. | |
| std::shared_ptr< Song > | __song |
| Pointer to the current song. | |
| bool | m_bExportSessionIsActive |
| bool | m_bOldLoopEnabled |
| bool | m_bSessionDrumkitNeedsRelinking |
| When using Hydrogen with session management it tries to keep all central files within a session folder instead of using the once found at the data folder at either user or system level. | |
| bool | m_bSessionIsExported |
| Indicates whether NSM session is saved or exported when entering the CoreActionController::saveSong() function. | |
| timeval | m_CurrentTime |
| timeval | |
| GUIState | m_GUIState |
| Specifies whether the Qt5 GUI is active. | |
| MidiMessage::Event | m_lastMidiEvent |
| Cache last incoming MIDI event to be used in MidiSenseWidget. | |
| int | m_nBeatCount |
| beatcounter beat to count | |
| double | m_nBeatDiffs [16] |
| beat diff | |
| int | m_nbeatsToCount |
| beatcounter beats to count | |
| int | m_nCoutOffset |
| int | m_nEventCount |
| beatcounter event | |
| int | m_nHihatOpenness |
| Controls the instrument selection within a hihat group. | |
| int | m_nLastMidiEventParameter |
| int | m_nLastRecordedMIDINoteTick |
| Onset of the recorded last in addRealtimeNote(). | |
| int | m_nSelectedInstrumentNumber |
| Instrument currently focused/selected in the GUI. | |
| int | m_nSelectedPatternNumber |
| Index of the pattern selected in the GUI or by a MIDI event. | |
| int | m_nStartOffset |
| ms default 0 | |
| float | m_ntaktoMeterCompute |
| beatcounter note length | |
| int | m_nTempoChangeCounter |
| count tempochanges for timeArray | |
| Song::Mode | m_oldEngineMode |
| ms default 0 | |
| AudioEngine * | m_pAudioEngine |
| Central instance of the audio engine. | |
| CoreActionController * | m_pCoreActionController |
| Local instance of the CoreActionController object. | |
| SoundLibraryDatabase * | m_pSoundLibraryDatabase |
| std::shared_ptr< Timeline > | m_pTimeline |
| Local instance of the Timeline object. | |
Static Private Attributes | |
| static Hydrogen * | __instance = nullptr |
| Static reference to the Hydrogen singleton. | |
Additional Inherited Members | |
Static Public Attributes inherited from Base | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. | |
Protected Member Functions inherited from Object< Hydrogen > | |
| ~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 |
Hydrogen Audio Engine.
Definition at line 53 of file Hydrogen.h.
| enum ErrorMessages |
| Enumerator | |
|---|---|
| UNKNOWN_DRIVER | The provided input in createDriver() does not match any of the choices for H2Core::Preferences::AudioDriver. |
| ERROR_STARTING_DRIVER | Unable to connect the audio driver stored in H2Core::AudioEngine::m_pAudioDriver in audioEngine_startAudioDrivers(). The NullDriver will be used as a fallback instead. |
| JACK_SERVER_SHUTDOWN | |
| JACK_CANNOT_ACTIVATE_CLIENT | |
| JACK_CANNOT_CONNECT_OUTPUT_PORT | Unable to connect either the JackAudioDriver::output_port_1 and the JackAudioDriver::output_port_name_1 as well as the JackAudioDriver::output_port_2 and the JackAudioDriver::output_port_name_2 port using jack_connect() (jack/jack.h) or the fallback version using the first two input ports in JackAudioDriver::connect(). |
| JACK_CANNOT_CLOSE_CLIENT | The client of Hydrogen can not be disconnected from the JACK server using jack_client_close() (jack/jack.h). Used within JackAudioDriver::disconnect(). |
| JACK_ERROR_IN_PORT_REGISTER | Unable to register output ports for the JACK client using jack_port_register() (jack/jack.h) in JackAudioDriver::init() or JackAudioDriver::setTrackOutput(). |
| OSC_CANNOT_CONNECT_TO_PORT | Unable to start the OSC server with the given port number. |
| PLAYBACK_TRACK_INVALID | |
Definition at line 242 of file Hydrogen.h.
|
strong |
Specifies the state of the Qt GUI.
| Enumerator | |
|---|---|
| notReady | There is a GUI but it is not ready yet (during startup). |
| unavailable | No GUI available. |
| ready | There is a working GUI. |
Definition at line 399 of file Hydrogen.h.
|
strong |
Specifies where the AudioEngine does get its current tempo updates from.
| Enumerator | |
|---|---|
| Song | BeatCounter, TapTempo, OSC and MIDI commands as well as the BPM widget in the PlayerControl are used to change the tempo. |
| Timeline | Only tempo markers on the Timeline are considered. |
| Jack | Hydrogen will disregard all internal tempo settings and uses the ones provided by the JACK server instead. This mode is only used in case the JACK audio driver is used, JACK Timebase support is activated in the Preferences, and an external Timebase controller is registered to the JACK server. |
Definition at line 60 of file Hydrogen.h.
| ~Hydrogen | ( | ) |
Destructor taking care of most of the clean up.
Definition at line 155 of file Hydrogen.cpp.
|
private |
Constructor, entry point, and initialization of the Hydrogen application.
It is called by the main() function after setting up a bunch of Qt5 stuff and creating an instance of the Logger and Preferences.
Only one Hydrogen object is allowed to exist. If the __instance object is present, the constructor will throw an error.
Definition at line 105 of file Hydrogen.cpp.
|
private |
Definition at line 1160 of file Hydrogen.cpp.
| void __panic | ( | ) |
Definition at line 1186 of file Hydrogen.cpp.
| void addInstrumentToDeathRow | ( | std::shared_ptr< Instrument > | pInstr | ) |
Add pInstr to __instrument_death_row and triggers __kill_instruments().
Since there might still be some notes of pInstr left in one of the note queues, the instrument can not be deleted right away. Instead, this function will add it to a list of instruments marked for deletion and it will be dealt with at a later time.
Definition at line 1155 of file Hydrogen.cpp.
| bool addRealtimeNote | ( | int | instrument, |
| float | velocity, | ||
| bool | noteoff = false, | ||
| int | msg1 = 0 ) |
Definition at line 371 of file Hydrogen.cpp.
|
static |
Creates all the instances used within Hydrogen in the right order.
Definition at line 184 of file Hydrogen.cpp.
| bool flushAndAddNextPattern | ( | int | nPatternNumber | ) |
Wrapper around AudioEngine::flushAndAddNextPattern().
Definition at line 625 of file Hydrogen.cpp.
|
inlinestatic |
Returns the current Hydrogen instance __instance.
Definition at line 84 of file Hydrogen.h.
| Song::ActionMode getActionMode | ( | ) | const |
Definition at line 1319 of file Hydrogen.cpp.
|
inline |
Definition at line 663 of file Hydrogen.h.
| AudioOutput * getAudioOutput | ( | ) | const |
Used to display audio driver info.
Definition at line 741 of file Hydrogen.cpp.
| int getBcStatus | ( | ) |
Definition at line 1002 of file Hydrogen.cpp.
| int getbeatsToCount | ( | ) |
Definition at line 987 of file Hydrogen.cpp.
| int getColumnForTick | ( | long | nTick, |
| bool | bLoopMode, | ||
| long * | pPatternStartTick ) const |
Find a PatternList/column corresponding to the supplied tick position nTick.
Adds up the lengths of all pattern columns until nTick lies in between the bounds of a Pattern.
| nTick | Position in ticks. |
| bLoopMode | Whether looping is enabled in the Song, see Song::is_loop_enabled(). If true, nTick is allowed to be larger than the total length of the Song. |
| pPatternStartTick | Pointer to an integer the beginning of the found pattern list will be stored in (in ticks). |
Definition at line 1533 of file Hydrogen.cpp.
|
inline |
Definition at line 653 of file Hydrogen.h.
|
inline |
Definition at line 667 of file Hydrogen.h.
|
inline |
Definition at line 707 of file Hydrogen.h.
|
inline |
Definition at line 658 of file Hydrogen.h.
| bool getIsModified | ( | ) | const |
Wrapper around Song::getIsModified() that checks whether a song is set.
Definition at line 1478 of file Hydrogen.cpp.
| float getJackTimebaseControllerBpm | ( | ) | const |
Definition at line 1222 of file Hydrogen.cpp.
| JackAudioDriver::Timebase getJackTimebaseState | ( | ) | const |
Definition at line 1241 of file Hydrogen.cpp.
| QString getLastLoadedDrumkitName | ( | ) | const |
Definition at line 1494 of file Hydrogen.cpp.
| QString getLastLoadedDrumkitPath | ( | ) | const |
Definition at line 1485 of file Hydrogen.cpp.
|
inline |
Last received midi message.
Definition at line 695 of file Hydrogen.h.
|
inline |
Definition at line 701 of file Hydrogen.h.
| MidiInput * getMidiInput | ( | ) | const |
Used to display midi driver info.
Definition at line 747 of file Hydrogen.cpp.
| MidiOutput * getMidiOutput | ( | ) | const |
Definition at line 752 of file Hydrogen.cpp.
| Song::Mode getMode | ( | ) | const |
Definition at line 1303 of file Hydrogen.cpp.
| float getNoteLength | ( | ) |
Definition at line 997 of file Hydrogen.cpp.
| Song::PatternMode getPatternMode | ( | ) | const |
Definition at line 1334 of file Hydrogen.cpp.
| Song::PlaybackTrack getPlaybackTrackState | ( | ) | const |
Wrapper around Song::getPlaybackTrackState().
Definition at line 245 of file Hydrogen.cpp.
| std::shared_ptr< Instrument > getSelectedInstrument | ( | ) | const |
Definition at line 1662 of file Hydrogen.cpp.
|
inline |
Definition at line 678 of file Hydrogen.h.
|
inline |
Definition at line 674 of file Hydrogen.h.
|
inline |
Definition at line 686 of file Hydrogen.h.
|
inline |
Definition at line 692 of file Hydrogen.h.
|
inline |
|
inline |
Definition at line 95 of file Hydrogen.h.
| Hydrogen::Tempo getTempoSource | ( | ) | const |
Definition at line 1368 of file Hydrogen.cpp.
| long getTickForColumn | ( | int | nColumn | ) | const |
Get the total number of ticks passed up to a nColumn / pattern group.
The AudioEngine should be LOCKED when calling this!
| nColumn | pattern group. |
Definition at line 1610 of file Hydrogen.cpp.
|
inline |
Definition at line 644 of file Hydrogen.h.
| bool handleBeatCounter | ( | ) |
Definition at line 1017 of file Hydrogen.cpp.
| bool hasJackAudioDriver | ( | ) | const |
Definition at line 1194 of file Hydrogen.cpp.
| bool hasJackTransport | ( | ) | const |
Definition at line 1207 of file Hydrogen.cpp.
|
private |
Auxiliary function setting a bunch of global variables.
Definition at line 209 of file Hydrogen.cpp.
| void initJackTimebaseControl | ( | ) |
Calling JackAudioDriver::initTimebaseControl() directly from the GUI.
Definition at line 1144 of file Hydrogen.cpp.
| bool instrumentHasNotes | ( | std::shared_ptr< Instrument > | pInst | ) |
Test if an Instrument has some Note in the Pattern (used to test before deleting an Instrument)
Definition at line 758 of file Hydrogen.cpp.
| bool isPatternEditorLocked | ( | ) | const |
Convenience function checking whether using the Pattern Editor is locked in the song settings and the song is in song mode.
Definition at line 1279 of file Hydrogen.cpp.
| bool isTimelineEnabled | ( | ) | const |
Convenience function checking whether using the Timeline tempo is set in the Preferences, Song::SONG_MODE is set, and there is an external JACK Timebase controller (application) present.
Definition at line 1269 of file Hydrogen.cpp.
| bool isUnderSessionManagement | ( | ) | const |
Definition at line 1253 of file Hydrogen.cpp.
| void loadPlaybackTrack | ( | QString | sFilename | ) |
Wrapper function for loading the playback track.
Definition at line 267 of file Hydrogen.cpp.
| void midi_noteOn | ( | Note * | note | ) |
Definition at line 366 of file Hydrogen.cpp.
| void mutePlaybackTrack | ( | const bool | bMuted | ) |
Wrapper around Song::setPlaybackTrackEnabled().
Definition at line 255 of file Hydrogen.cpp.
| void onTapTempoAccelEvent | ( | ) |
Definition at line 805 of file Hydrogen.cpp.
| void previewInstrument | ( | std::shared_ptr< Instrument > | pInstr | ) |
| void previewSample | ( | Sample * | pSample | ) |
| void raiseError | ( | unsigned | nErrorCode | ) |
Definition at line 800 of file Hydrogen.cpp.
| void recalculateRubberband | ( | float | fBpm | ) |
Recalculates all Samples using RubberBand for a specific tempo fBpm.
This function requires the calling function to lock the AudioEngine first.
Definition at line 1418 of file Hydrogen.cpp.
| void recreateOscServer | ( | ) |
Destroys and recreates the OscServer singleton in order to adopt a new OSC port.
Definition at line 1390 of file Hydrogen.cpp.
| void releaseJackTimebaseControl | ( | ) |
Calling JackAudioDriver::releaseTimebaseControl() directly from the GUI.
Definition at line 1133 of file Hydrogen.cpp.
| void removeInstrument | ( | int | nInstrumentNumber | ) |
Delete an Instrument.
Definition at line 780 of file Hydrogen.cpp.
| void removeSong | ( | ) |
Definition at line 360 of file Hydrogen.cpp.
| void renameJackPorts | ( | std::shared_ptr< Song > | pSong | ) |
Calls audioEngine_renameJackPorts() if Preferences::m_bJackTrackOuts is set to true.
| pSong | Handed to audioEngine_renameJackPorts(). |
Definition at line 957 of file Hydrogen.cpp.
| void restartDrivers | ( | ) |
Definition at line 641 of file Hydrogen.cpp.
| void restartLadspaFX | ( | ) |
Definition at line 890 of file Hydrogen.cpp.
| void sequencer_play | ( | ) |
Start the internal sequencer.
Definition at line 221 of file Hydrogen.cpp.
| void sequencer_stop | ( | ) |
Stop the internal sequencer.
Definition at line 231 of file Hydrogen.cpp.
| void setActionMode | ( | Song::ActionMode | mode | ) |
Wrapper around Song::setActionMode() which also triggers EVENT_ACTION_MODE_CHANGE and should be used by all parts of the code except for song reading/setting.
Definition at line 1326 of file Hydrogen.cpp.
| void setBcOffsetAdjust | ( | ) |
Definition at line 1007 of file Hydrogen.cpp.
| void setbeatsToCount | ( | int | beatstocount | ) |
Updates m_nbeatsToCount.
| beatstocount | New value |
Definition at line 982 of file Hydrogen.cpp.
|
inline |
| state | Specifies whether the Qt5 GUI is active. Sets m_GUIState. |
Definition at line 671 of file Hydrogen.h.
|
inline |
Definition at line 710 of file Hydrogen.h.
| void setIsModified | ( | bool | bIsModified | ) |
Wrapper around Song::setIsModified() that checks whether a song is set.
Definition at line 1471 of file Hydrogen.cpp.
| void setIsPatternEditorLocked | ( | bool | bValue | ) |
Definition at line 1290 of file Hydrogen.cpp.
| void setIsTimelineActivated | ( | bool | bEnabled | ) |
Wrapper around both Song::setIsTimelineActivated (recent) and Preferences::setUseTimelinebpm() (former place to store the variable but kept to maintain backward compatibility) which also triggers EVENT_TIMELINE_ACTIVATION.
Definition at line 1503 of file Hydrogen.cpp.
|
inline |
Definition at line 698 of file Hydrogen.h.
|
inline |
Definition at line 704 of file Hydrogen.h.
| void setMode | ( | Song::Mode | mode | ) |
Wrapper around Song::setMode() which also triggers EVENT_SONG_MODE_ACTIVATION and should be used by all parts of the code except for song reading/setting.
Definition at line 1311 of file Hydrogen.cpp.
| void setNoteLength | ( | float | notelength | ) |
Definition at line 992 of file Hydrogen.cpp.
| void setPatternMode | ( | Song::PatternMode | mode | ) |
Wrapper around Song::setPatternMode() which also triggers EVENT_STACKED_MODE_ACTIVATION and should be used by all parts of the code except for song reading/setting.
Definition at line 1341 of file Hydrogen.cpp.
| void setSelectedInstrumentNumber | ( | int | nInstrument, |
| bool | bTriggerEvent = true ) |
| nInstrument | Instrument about to be selected |
| bTriggerEvent | Whether EVENT_SELECTED_INSTRUMENT_CHANGED should be queued. When e.g. changing the selected instrument as part of loading a different drumkit, it's important to only trigger a single event after the loading is done and to not fire some premature ones making the GUI act on a core that might be in an unclean state. |
Definition at line 944 of file Hydrogen.cpp.
| void setSelectedPatternNumber | ( | int | nPat, |
| bool | bNeedsLock = true, | ||
| bool | bForce = false ) |
Sets m_nSelectedPatternNumber.
| nPat | Sets m_nSelectedPatternNumber |
| bNeedsLock | Whether the function was called with the audio engine locked already or it should do so itself. |
| bForce | When present, the EVENT_SELECTED_PATTERN_CHANGED will be triggered regardless of nPat. This is important when rearranging patterns in the song editor while the pattern editor is locked. |
Definition at line 915 of file Hydrogen.cpp.
|
inline |
Definition at line 683 of file Hydrogen.h.
|
inline |
Definition at line 689 of file Hydrogen.h.
| void setSong | ( | std::shared_ptr< Song > | newSong, |
| bool | bRelinking = true ) |
Sets the current song __song to newSong.
| newSong | Pointer to the new Song object. |
| bRelinking | Whether the drumkit last loaded should be relinked when under session management. This flag is used to distinguish between the regular load of a song file within a session and its replacement by another song (which requires an update of the linked drumkit). |
Definition at line 293 of file Hydrogen.cpp.
| void setTapTempo | ( | float | fInterval | ) |
Definition at line 830 of file Hydrogen.cpp.
|
inline |
Definition at line 648 of file Hydrogen.h.
| bool startExportSession | ( | int | nSampleRate, |
| int | nSampleDepth, | ||
| double | fCompressionLevel = 0.0 ) |
| nSampleRate | sample rate using which to export |
| nSampleDepth | sample depth using which to export |
| fCompressionLevel | Trades off audio quality against compression rate defined between 0.0 (maximum quality) and 1.0 (maximum compression). |
Definition at line 646 of file Hydrogen.cpp.
| void startExportSong | ( | const QString & | filename | ) |
Export a song to a wav file.
Definition at line 697 of file Hydrogen.cpp.
| void startNsmClient | ( | ) |
Definition at line 1405 of file Hydrogen.cpp.
| void stopExportSession | ( | ) |
Definition at line 716 of file Hydrogen.cpp.
| void stopExportSong | ( | ) |
Definition at line 709 of file Hydrogen.cpp.
| void toggleNextPattern | ( | int | nPatternNumber | ) |
Wrapper around AudioEngine::toggleNextPattern().
Definition at line 613 of file Hydrogen.cpp.
| void toggleOscServer | ( | bool | bEnable | ) |
Starts/stops the OSC server.
| bEnable | true = start, false = stop. |
Definition at line 1380 of file Hydrogen.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 1707 of file Hydrogen.cpp.
| void updateSelectedPattern | ( | bool | bNeedsLock = true | ) |
Updates the selected pattern to the one recorded note will be inserted to.
Definition at line 903 of file Hydrogen.cpp.
| void updateSongSize | ( | ) |
Definition at line 1658 of file Hydrogen.cpp.
| void updateVirtualPatterns | ( | ) |
Processes the patterns added to any virtual ones in the PatternList of the current Song and ensure both the playing pattern representation in the AudioEngine and the GUI are synced.
Definition at line 1686 of file Hydrogen.cpp.
|
staticprivate |
Static reference to the Hydrogen singleton.
It is created using the Hydrogen::Hydrogen() constructor, initialized with NULL and assigned a new Hydrogen instance if still 0 in create_instance().
Definition at line 501 of file Hydrogen.h.
|
private |
Deleting instruments too soon leads to potential crashes.
Definition at line 562 of file Hydrogen.h.
|
private |
Pointer to the current song.
It is initialized with NULL in the Hydrogen() constructor, set via setSong(), and accessed via getSong().
Definition at line 508 of file Hydrogen.h.
|
private |
Definition at line 539 of file Hydrogen.h.
|
private |
Definition at line 538 of file Hydrogen.h.
|
private |
When using Hydrogen with session management it tries to keep all central files within a session folder instead of using the once found at the data folder at either user or system level.
This allows to zip and transfer a session without requiring to move the whole data folder as well.
As sample files can be quite large in both size and number the drumkit is only linked into the session folder.
This variable indicates whether a different drumkit was loaded into the current song (by either directly loading a drumkit or replacing the entire song) and thus a relinking is required upon saving the song.
Definition at line 593 of file Hydrogen.h.
|
private |
Indicates whether NSM session is saved or exported when entering the CoreActionController::saveSong() function.
Definition at line 598 of file Hydrogen.h.
|
private |
timeval
Definition at line 530 of file Hydrogen.h.
|
private |
Specifies whether the Qt5 GUI is active.
When a new Song is set via the core part of Hydrogen, e.g. in the context of session management, the std::shared_ptr<Song> must* be set via the GUI if active. Else the GUI will freeze.
Set by setGUIState() and accessed via getGUIState().
Definition at line 550 of file Hydrogen.h.
|
private |
Cache last incoming MIDI event to be used in MidiSenseWidget.
Definition at line 635 of file Hydrogen.h.
|
private |
beatcounter beat to count
Definition at line 528 of file Hydrogen.h.
|
private |
beat diff
Definition at line 529 of file Hydrogen.h.
|
private |
beatcounter beats to count
Definition at line 525 of file Hydrogen.h.
|
private |
Definition at line 531 of file Hydrogen.h.
|
private |
beatcounter event
Definition at line 526 of file Hydrogen.h.
|
private |
Controls the instrument selection within a hihat group.
Definition at line 614 of file Hydrogen.h.
| int m_nInstrumentLookupTable[MAX_INSTRUMENTS] |
midi lookuptable
Definition at line 461 of file Hydrogen.h.
|
private |
Definition at line 636 of file Hydrogen.h.
|
private |
Onset of the recorded last in addRealtimeNote().
It is used to determine the custom length of the note in case the note on event is followed by a note off event.
Definition at line 605 of file Hydrogen.h.
|
private |
Instrument currently focused/selected in the GUI.
Within the core it is relevant for the MIDI input. Using Preferences::__playselectedinstrument incoming MIDI signals can be used to play back only the selected instrument or the whole drumkit.
Definition at line 572 of file Hydrogen.h.
|
private |
Index of the pattern selected in the GUI or by a MIDI event.
Definition at line 576 of file Hydrogen.h.
|
private |
ms default 0
Definition at line 532 of file Hydrogen.h.
|
private |
beatcounter note length
Definition at line 524 of file Hydrogen.h.
|
private |
count tempochanges for timeArray
Definition at line 527 of file Hydrogen.h.
|
private |
ms default 0
Definition at line 537 of file Hydrogen.h.
|
private |
Central instance of the audio engine.
Definition at line 609 of file Hydrogen.h.
|
private |
Local instance of the CoreActionController object.
Definition at line 559 of file Hydrogen.h.
|
private |
Definition at line 611 of file Hydrogen.h.
|
private |
Local instance of the Timeline object.
Definition at line 555 of file Hydrogen.h.