|
hydrogen 1.2.3
|
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(). | |
| void | addRealtimeNote (int instrument, float velocity, float fPan=0.0f, 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 |
| bool | getIsExportSessionActive () const |
| bool | getIsModified () const |
| Wrapper around Song::getIsModified() that checks whether a song is set. | |
| JackAudioDriver::Timebase | getJackTimebaseState () const |
| QString | getLastLoadedDrumkitName () const |
| QString | getLastLoadedDrumkitPath () const |
| MidiMessage::Event | getLastMidiEvent () const |
| Last received midi message. | |
| int | getLastMidiEventParameter () const |
| float | getMasterBpm () 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 |
| 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 a JACK timebase master 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 | offJackMaster () |
| Calling JackAudioDriver::releaseTimebaseMaster() directly from the GUI. | |
| void | onJackMaster () |
| Calling JackAudioDriver::initTimebaseMaster() directly from the GUI. | |
| 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 | 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 | 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 rate, int depth) |
| 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 | 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_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 |
Hydrogen Audio Engine.
Definition at line 53 of file Hydrogen.h.
| enum ErrorMessages |
| Enumerator | |
|---|---|
| UNKNOWN_DRIVER | The provided input string in createDriver() does not match any of the choices for Preferences::m_sAudioDriver. |
| 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 239 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 388 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 master 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 154 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 1134 of file Hydrogen.cpp.
| void __panic | ( | ) |
Definition at line 1160 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 1129 of file Hydrogen.cpp.
| void addRealtimeNote | ( | int | instrument, |
| float | velocity, | ||
| float | fPan = 0.0f, | ||
| bool | noteoff = false, | ||
| int | msg1 = 0 ) |
Definition at line 357 of file Hydrogen.cpp.
|
static |
Creates all the instances used within Hydrogen in the right order.
Definition at line 181 of file Hydrogen.cpp.
| bool flushAndAddNextPattern | ( | int | nPatternNumber | ) |
Wrapper around AudioEngine::flushAndAddNextPattern().
Definition at line 610 of file Hydrogen.cpp.
|
inlinestatic |
Returns the current Hydrogen instance __instance.
Definition at line 83 of file Hydrogen.h.
| Song::ActionMode getActionMode | ( | ) | const |
Definition at line 1290 of file Hydrogen.cpp.
|
inline |
Definition at line 649 of file Hydrogen.h.
| AudioOutput * getAudioOutput | ( | ) | const |
Used to display audio driver info.
Definition at line 719 of file Hydrogen.cpp.
| int getBcStatus | ( | ) |
Definition at line 978 of file Hydrogen.cpp.
| int getbeatsToCount | ( | ) |
Definition at line 963 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 1504 of file Hydrogen.cpp.
|
inline |
Definition at line 639 of file Hydrogen.h.
|
inline |
Definition at line 653 of file Hydrogen.h.
|
inline |
Definition at line 644 of file Hydrogen.h.
| bool getIsModified | ( | ) | const |
Wrapper around Song::getIsModified() that checks whether a song is set.
Definition at line 1449 of file Hydrogen.cpp.
| JackAudioDriver::Timebase getJackTimebaseState | ( | ) | const |
Definition at line 1212 of file Hydrogen.cpp.
| QString getLastLoadedDrumkitName | ( | ) | const |
Definition at line 1465 of file Hydrogen.cpp.
| QString getLastLoadedDrumkitPath | ( | ) | const |
Definition at line 1456 of file Hydrogen.cpp.
|
inline |
Last received midi message.
Definition at line 681 of file Hydrogen.h.
|
inline |
Definition at line 687 of file Hydrogen.h.
| float getMasterBpm | ( | ) | const |
Definition at line 1196 of file Hydrogen.cpp.
| MidiInput * getMidiInput | ( | ) | const |
Used to display midi driver info.
Definition at line 725 of file Hydrogen.cpp.
| MidiOutput * getMidiOutput | ( | ) | const |
Definition at line 730 of file Hydrogen.cpp.
| Song::Mode getMode | ( | ) | const |
Definition at line 1274 of file Hydrogen.cpp.
| float getNoteLength | ( | ) |
Definition at line 973 of file Hydrogen.cpp.
| Song::PatternMode getPatternMode | ( | ) | const |
Definition at line 1305 of file Hydrogen.cpp.
| Song::PlaybackTrack getPlaybackTrackState | ( | ) | const |
Wrapper around Song::getPlaybackTrackState().
Definition at line 240 of file Hydrogen.cpp.
| std::shared_ptr< Instrument > getSelectedInstrument | ( | ) | const |
Definition at line 1622 of file Hydrogen.cpp.
|
inline |
Definition at line 664 of file Hydrogen.h.
|
inline |
Definition at line 660 of file Hydrogen.h.
|
inline |
Definition at line 672 of file Hydrogen.h.
|
inline |
Definition at line 678 of file Hydrogen.h.
|
inline |
|
inline |
Definition at line 94 of file Hydrogen.h.
| Hydrogen::Tempo getTempoSource | ( | ) | const |
Definition at line 1339 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 1573 of file Hydrogen.cpp.
|
inline |
Definition at line 630 of file Hydrogen.h.
| bool handleBeatCounter | ( | ) |
Definition at line 993 of file Hydrogen.cpp.
| bool hasJackAudioDriver | ( | ) | const |
Definition at line 1168 of file Hydrogen.cpp.
| bool hasJackTransport | ( | ) | const |
Definition at line 1181 of file Hydrogen.cpp.
|
private |
Auxiliary function setting a bunch of global variables.
Definition at line 206 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 736 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 1250 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 a JACK timebase master present.
Definition at line 1240 of file Hydrogen.cpp.
| bool isUnderSessionManagement | ( | ) | const |
Definition at line 1224 of file Hydrogen.cpp.
| void loadPlaybackTrack | ( | QString | sFilename | ) |
Wrapper function for loading the playback track.
Definition at line 262 of file Hydrogen.cpp.
| void midi_noteOn | ( | Note * | note | ) |
Definition at line 352 of file Hydrogen.cpp.
| void mutePlaybackTrack | ( | const bool | bMuted | ) |
Wrapper around Song::setPlaybackTrackEnabled().
Definition at line 250 of file Hydrogen.cpp.
| void offJackMaster | ( | ) |
Calling JackAudioDriver::releaseTimebaseMaster() directly from the GUI.
Definition at line 1107 of file Hydrogen.cpp.
| void onJackMaster | ( | ) |
Calling JackAudioDriver::initTimebaseMaster() directly from the GUI.
Definition at line 1118 of file Hydrogen.cpp.
| void onTapTempoAccelEvent | ( | ) |
Definition at line 779 of file Hydrogen.cpp.
| void previewInstrument | ( | std::shared_ptr< Instrument > | pInstr | ) |
| void previewSample | ( | Sample * | pSample | ) |
| void raiseError | ( | unsigned | nErrorCode | ) |
Definition at line 774 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 1389 of file Hydrogen.cpp.
| void recreateOscServer | ( | ) |
Destroys and recreates the OscServer singleton in order to adopt a new OSC port.
Definition at line 1361 of file Hydrogen.cpp.
| void removeInstrument | ( | int | nInstrumentNumber | ) |
Delete an #Instrument.
Definition at line 754 of file Hydrogen.cpp.
| void removeSong | ( | ) |
Definition at line 346 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 931 of file Hydrogen.cpp.
| void restartDrivers | ( | ) |
Definition at line 626 of file Hydrogen.cpp.
| void restartLadspaFX | ( | ) |
Definition at line 864 of file Hydrogen.cpp.
| void sequencer_play | ( | ) |
Start the internal sequencer.
Definition at line 218 of file Hydrogen.cpp.
| void sequencer_stop | ( | ) |
Stop the internal sequencer.
Definition at line 226 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 1297 of file Hydrogen.cpp.
| void setBcOffsetAdjust | ( | ) |
Definition at line 983 of file Hydrogen.cpp.
| void setbeatsToCount | ( | int | beatstocount | ) |
Updates m_nbeatsToCount.
| beatstocount | New value |
Definition at line 958 of file Hydrogen.cpp.
|
inline |
| state | Specifies whether the Qt5 GUI is active. Sets m_GUIState. |
Definition at line 657 of file Hydrogen.h.
| void setIsModified | ( | bool | bIsModified | ) |
Wrapper around Song::setIsModified() that checks whether a song is set.
Definition at line 1442 of file Hydrogen.cpp.
| void setIsPatternEditorLocked | ( | bool | bValue | ) |
Definition at line 1261 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 1474 of file Hydrogen.cpp.
|
inline |
Definition at line 684 of file Hydrogen.h.
|
inline |
Definition at line 690 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 1282 of file Hydrogen.cpp.
| void setNoteLength | ( | float | notelength | ) |
Definition at line 968 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 1312 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 918 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 889 of file Hydrogen.cpp.
|
inline |
Definition at line 669 of file Hydrogen.h.
|
inline |
Definition at line 675 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 288 of file Hydrogen.cpp.
| void setTapTempo | ( | float | fInterval | ) |
Definition at line 804 of file Hydrogen.cpp.
|
inline |
Definition at line 634 of file Hydrogen.h.
| bool startExportSession | ( | int | rate, |
| int | depth ) |
Definition at line 631 of file Hydrogen.cpp.
| void startExportSong | ( | const QString & | filename | ) |
Export a song to a wav file.
Definition at line 680 of file Hydrogen.cpp.
| void startNsmClient | ( | ) |
Definition at line 1376 of file Hydrogen.cpp.
| void stopExportSession | ( | ) |
Definition at line 699 of file Hydrogen.cpp.
| void stopExportSong | ( | ) |
Definition at line 692 of file Hydrogen.cpp.
| void toggleNextPattern | ( | int | nPatternNumber | ) |
Wrapper around AudioEngine::toggleNextPattern().
Definition at line 598 of file Hydrogen.cpp.
| void toggleOscServer | ( | bool | bEnable | ) |
Starts/stops the OSC server.
| bEnable | true = start, false = stop. |
Definition at line 1351 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 1667 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 877 of file Hydrogen.cpp.
| void updateSongSize | ( | ) |
Definition at line 1618 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 1646 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 490 of file Hydrogen.h.
|
private |
Deleting instruments too soon leads to potential crashes.
Definition at line 551 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 497 of file Hydrogen.h.
|
private |
Definition at line 528 of file Hydrogen.h.
|
private |
Definition at line 527 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 582 of file Hydrogen.h.
|
private |
Indicates whether NSM session is saved or exported when entering the CoreActionController::saveSong() function.
Definition at line 587 of file Hydrogen.h.
|
private |
timeval
Definition at line 519 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 539 of file Hydrogen.h.
|
private |
Cache last incoming MIDI event to be used in MidiSenseWidget.
Definition at line 621 of file Hydrogen.h.
|
private |
beatcounter beat to count
Definition at line 517 of file Hydrogen.h.
|
private |
beat diff
Definition at line 518 of file Hydrogen.h.
|
private |
beatcounter beats to count
Definition at line 514 of file Hydrogen.h.
|
private |
Definition at line 520 of file Hydrogen.h.
|
private |
beatcounter event
Definition at line 515 of file Hydrogen.h.
| int m_nInstrumentLookupTable[MAX_INSTRUMENTS] |
midi lookuptable
Definition at line 450 of file Hydrogen.h.
|
private |
Definition at line 622 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 594 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 561 of file Hydrogen.h.
|
private |
Index of the pattern selected in the GUI or by a MIDI event.
Definition at line 565 of file Hydrogen.h.
|
private |
ms default 0
Definition at line 521 of file Hydrogen.h.
|
private |
beatcounter note length
Definition at line 513 of file Hydrogen.h.
|
private |
count tempochanges for timeArray
Definition at line 516 of file Hydrogen.h.
|
private |
ms default 0
Definition at line 526 of file Hydrogen.h.
|
private |
Central instance of the audio engine.
Definition at line 598 of file Hydrogen.h.
|
private |
Local instance of the CoreActionController object.
Definition at line 548 of file Hydrogen.h.
|
private |
Definition at line 600 of file Hydrogen.h.
|
private |
Local instance of the Timeline object.
Definition at line 544 of file Hydrogen.h.