|
hydrogen 1.1.1
|
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 } |
| enum class | GUIState { notReady = -1 , unavailable = 0 , ready = 1 } |
| Specifies the state of the Qt GUI. More... | |
Public Member Functions | |
| ~Hydrogen () | |
| Destructor taking care of most of the clean up. More... | |
| void | sequencer_play () |
| Start the internal sequencer. More... | |
| void | sequencer_stop () |
| Stop the internal sequencer. More... | |
| void | midi_noteOn (Note *note) |
| void | sequencer_setNextPattern (int pos) |
| Adding and removing a Pattern from m_pNextPatterns. More... | |
| void | sequencer_setOnlyNextPattern (int pos) |
| Clear m_pNextPatterns and add one Pattern. More... | |
| void | togglePlaysSelected () |
| Switches playback to focused pattern. More... | |
| Song * | getSong () const |
| Get the current song. More... | |
| void | setSong (Song *newSong) |
| Sets the current song __song to newSong. More... | |
| void | removeSong () |
| void | addRealtimeNote (int instrument, float velocity, float pan_L=1.0, float pan_R=1.0, float pitch=0.0, bool noteoff=false, bool forcePlay=false, int msg1=0) |
| float | getMasterPeak_L () |
| void | setMasterPeak_L (float value) |
| float | getMasterPeak_R () |
| void | setMasterPeak_R (float value) |
| void | getLadspaFXPeak (int nFX, float *fL, float *fR) |
| void | setLadspaFXPeak (int nFX, float fL, float fR) |
| unsigned long | getTickPosition () |
| unsigned long | getRealtimeTickPosition () |
| Keep track of the tick position in realtime. More... | |
| unsigned long | getTotalFrames () |
| void | setRealtimeFrames (unsigned long frames) |
| Sets m_nRealtimeFrames. More... | |
| unsigned long | getRealtimeFrames () |
| Returns the current realtime transport position TransportInfo::m_nFrames. More... | |
| PatternList * | getCurrentPatternList () |
| void | setCurrentPatternList (PatternList *pPatternList) |
| Sets m_pPlayingPatterns. More... | |
| PatternList * | getNextPatterns () |
| int | getPatternPos () |
| Get the position of the current Pattern in the Song. More... | |
| void | setPatternPos (int pos) |
| Relocate the position to another Pattern in the Song. More... | |
| int | getPosForTick (unsigned long TickPos, int *nPatternStartTick) |
| Returns the pattern number corresponding to the tick position TickPos. More... | |
| void | resetPatternStartTick () |
| Move playback in Pattern mode to the beginning of the pattern. More... | |
| long | getTickForPosition (int pos) |
| Get the total number of ticks passed up to a Pattern at position pos. More... | |
| void | restartDrivers () |
| AudioOutput * | getAudioOutput () const |
| Used to display audio driver info. More... | |
| MidiInput * | getMidiInput () const |
| Used to display midi driver info. More... | |
| MidiOutput * | getMidiOutput () const |
| int | getState () const |
| Returns the current state of the audio engine. More... | |
| float | getProcessTime () const |
| float | getMaxProcessTime () const |
| int | loadDrumkit (Drumkit *pDrumkitInfo) |
| Wrapper around loadDrumkit( Drumkit, bool ) with the conditional argument set to true. More... | |
| int | loadDrumkit (Drumkit *pDrumkitInfo, bool conditional) |
| Loads the H2Core::Drumkit provided in pDrumkitInfo into the current session. More... | |
| bool | instrumentHasNotes (Instrument *pInst) |
| Test if an Instrument has some Note in the Pattern (used to test before deleting an Instrument) More... | |
| void | removeInstrument (int instrumentnumber, bool conditional) |
| Delete an Instrument. More... | |
| const QString & | getCurrentDrumkitName () |
| void | setCurrentDrumkitName (const QString &sName) |
| Filesystem::Lookup | getCurrentDrumkitLookup () |
| void | setCurrentDrumkitLookup (Filesystem::Lookup lookup) |
| void | raiseError (unsigned nErrorCode) |
| void | previewSample (Sample *pSample) |
| void | previewInstrument (Instrument *pInstr) |
| void | onTapTempoAccelEvent () |
| void | setTapTempo (float fInterval) |
| void | setBPM (float fBPM) |
| Updates the speed. More... | |
| void | restartLadspaFX () |
| int | getSelectedPatternNumber () |
| void | setSelectedPatternNumber (int nPat) |
| Sets m_nSelectedPatternNumber. More... | |
| int | getSelectedInstrumentNumber () |
| void | setSelectedInstrumentNumber (int nInstrument) |
| void | refreshInstrumentParameters (int nInstrument) |
| void | renameJackPorts (Song *pSong) |
| Calls audioEngine_renameJackPorts() if Preferences::m_bJackTrackOuts is set to true. More... | |
| void | toggleOscServer (bool bEnable) |
| Starts/stops the OSC server. More... | |
| void | recreateOscServer () |
| Destroys and recreates the OscServer singleton in order to adopt a new OSC port. More... | |
| void | startNsmClient () |
| void | setbeatsToCount (int beatstocount) |
| Updates m_nbeatsToCount. More... | |
| int | getbeatsToCount () |
| void | setNoteLength (float notelength) |
| float | getNoteLength () |
| int | getBcStatus () |
| void | handleBeatCounter () |
| void | setBcOffsetAdjust () |
| void | offJackMaster () |
| Calling JackAudioDriver::releaseTimebaseMaster() directly from the GUI. More... | |
| void | onJackMaster () |
| Calling JackAudioDriver::initTimebaseMaster() directly from the GUI. More... | |
| long | getPatternLength (int nPattern) |
| Get the length (in ticks) of the nPattern th pattern. More... | |
| float | getNewBpmJTM () const |
| Returns the fallback speed. More... | |
| void | setNewBpmJTM (float bpmJTM) |
| Set the fallback speed #m_nNewBpmJTM. More... | |
| void | __panic () |
| unsigned int | __getMidiRealtimeNoteTickPosition () const |
| void | setTimelineBpm () |
| Updates Song::m_fBpm, TransportInfo::m_fBPM, and m_fNewBpmJTM to the local speed. More... | |
| float | getTimelineBpm (int nBar) |
| Returns the local speed at a specific nBar in the Timeline. More... | |
| Timeline * | getTimeline () const |
| bool | getIsExportSessionActive () const |
| void | startExportSession (int rate, int depth) |
| void | stopExportSession () |
| void | startExportSong (const QString &filename) |
| Export a song to a wav file. More... | |
| void | stopExportSong () |
| CoreActionController * | getCoreActionController () const |
| bool | setPlaybackTrackState (const bool state) |
| Wrapper around Song::setPlaybackTrackEnabled(). More... | |
| bool | getPlaybackTrackState () const |
| Wrapper around Song::getPlaybackTrackEnabled(). More... | |
| void | loadPlaybackTrack (const QString filename) |
| Wrapper function for loading the playback track. More... | |
| GUIState | getGUIState () const |
| void | setGUIState (const GUIState state) |
| Song * | getNextSong () const |
| void | setNextSong (Song *pNextSong) |
| void | setNextSongPath (const QString sSongPath) |
| QString | getNextSongPath () |
| int | calculateLeadLagFactor (float fTickSize) |
| Calculates the lookahead for a specific tick size. More... | |
| int | calculateLookahead (float fTickSize) |
| Calculates time offset (in frames) used to determine the notes process by the audio engine. More... | |
| bool | haveJackAudioDriver () const |
| bool | haveJackTransport () const |
| JackAudioDriver::Timebase | getJackTimebaseState () const |
| bool | isUnderSessionManagement () const |
| void | setInitialSong (Song *pSong) |
| Sets the first Song to be loaded under session management. More... | |
Public Member Functions inherited from Object | |
| ~Object () | |
| destructor More... | |
| Object (const Object &obj) | |
| copy constructor More... | |
| Object (const char *class_name) | |
| constructor More... | |
| const char * | class_name () const |
| return the class name More... | |
| virtual QString | toQString (const QString &sPrefix, bool bShort=true) const |
| Formatted string version for debugging purposes. More... | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. More... | |
Static Public Member Functions | |
| static void | create_instance () |
| Creates all the instances used within Hydrogen in the right order. More... | |
| static Hydrogen * | get_instance () |
| Returns the current Hydrogen instance __instance. More... | |
Static Public Member Functions inherited from Object | |
| static void | set_count (bool flag) |
| enable/disable class instances counting More... | |
| static bool | count_active () |
| return true if class instances counting is enabled More... | |
| static unsigned | objects_count () |
| return the number of objects More... | |
| static void | write_objects_map_to (std::ostream &out) |
| output the full objects map to a given ostream More... | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr More... | |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! More... | |
| static Logger * | logger () |
| return the logger instance More... | |
Data Fields | |
| QString | lastMidiEvent |
| Last received midi message. More... | |
| int | lastMidiEventParameter |
| int | m_nInstrumentLookupTable [MAX_INSTRUMENTS] |
| midi lookuptable More... | |
| int | m_nMaxTimeHumanize |
| Maximum time (in frames) a note's position can be off due to the humanization (lead-lag). More... | |
Private Member Functions | |
| void | initBeatcounter () |
| Auxiliary function setting a bunch of global variables. More... | |
| Hydrogen () | |
| Constructor, entry point, and initialization of the Hydrogen application. More... | |
| void | __kill_instruments () |
Private Attributes | |
| Song * | __song |
| Pointer to the current song. More... | |
| float | m_ntaktoMeterCompute |
| beatcounter note length More... | |
| int | m_nbeatsToCount |
| beatcounter beats to count More... | |
| int | m_nEventCount |
| beatcounter event More... | |
| int | m_nTempoChangeCounter |
| count tempochanges for timeArray More... | |
| int | m_nBeatCount |
| beatcounter beat to count More... | |
| double | m_nBeatDiffs [16] |
| beat diff More... | |
| timeval | m_CurrentTime |
| timeval More... | |
| int | m_nCoutOffset |
| int | m_nStartOffset |
| ms default 0 More... | |
| Song::SongMode | m_oldEngineMode |
| ms default 0 More... | |
| bool | m_bOldLoopEnabled |
| bool | m_bExportSessionIsActive |
| GUIState | m_GUIState |
| Specifies whether the Qt5 GUI is active. More... | |
| Song * | m_pNextSong |
| Stores a new Song which is about of the loaded by the GUI. More... | |
| QString | m_sNextSongPath |
| Timeline * | m_pTimeline |
| Local instance of the Timeline object. More... | |
| CoreActionController * | m_pCoreActionController |
| Local instance of the CoreActionController object. More... | |
| QString | m_sCurrentDrumkitName |
| Name of the currently used Drumkit. More... | |
| Filesystem::Lookup | m_currentDrumkitLookup |
| Whether the current Drumkit is located at user or system level. More... | |
| std::list< Instrument * > | __instrument_death_row |
| Deleting instruments too soon leads to potential crashes. More... | |
Static Private Attributes | |
| static Hydrogen * | __instance = nullptr |
| Static reference to the Hydrogen singleton. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Object | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. More... | |
Static Protected Attributes inherited from Object | |
| static Logger * | __logger = nullptr |
| logger instance pointer More... | |
Hydrogen Audio Engine.
| 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 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. |
|
strong |
| ~Hydrogen | ( | ) |
Destructor taking care of most of the clean up.
|
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.
| unsigned int __getMidiRealtimeNoteTickPosition | ( | ) | const |
|
private |
| void __panic | ( | ) |
| void addRealtimeNote | ( | int | instrument, |
| float | velocity, | ||
| float | pan_L = 1.0, |
||
| float | pan_R = 1.0, |
||
| float | pitch = 0.0, |
||
| bool | noteoff = false, |
||
| bool | forcePlay = false, |
||
| int | msg1 = 0 |
||
| ) |
| int calculateLeadLagFactor | ( | float | fTickSize | ) |
Calculates the lookahead for a specific tick size.
During the humanization the onset of a Note will be moved Note::__lead_lag times the value calculated by this function.
Since the size of a tick is tempo dependent, fTickSize allows you to calculate the lead-lag factor for an arbitrary position on the Timeline.
| fTickSize | Number of frames that make up one tick. |
| int calculateLookahead | ( | float | fTickSize | ) |
Calculates time offset (in frames) used to determine the notes process by the audio engine.
Due to the humanization there might be negative offset in the position of a particular note. To be able to still render it appropriately, we have to look into and handle notes from the future.
The Lookahead is the sum of the m_nMaxTimeHumanize and calculateLeadLagFactor() plus one (since it has to be larger than that).
| fTickSize | Number of frames that make up one tick. Passed to calculateLeadLagFactor(). |
|
static |
Creates all the instances used within Hydrogen in the right order.
If H2CORE_HAVE_OSC was set during compilation, the following instances will be created as well.
If all instances are created and the actual Hydrogen instance __instance is still 0, it will be properly constructed via Hydrogen().
The AudioEngine::create_instance(), Effects::create_instance(), and Playlist::create_instance() functions will be called from within audioEngine_init().
|
inlinestatic |
Returns the current Hydrogen instance __instance.
| AudioOutput * getAudioOutput | ( | ) | const |
Used to display audio driver info.
| int getBcStatus | ( | ) |
| int getbeatsToCount | ( | ) |
|
inline |
|
inline |
|
inline |
| PatternList * getCurrentPatternList | ( | ) |
|
inline |
|
inline |
| JackAudioDriver::Timebase getJackTimebaseState | ( | ) | const |
| void getLadspaFXPeak | ( | int | nFX, |
| float * | fL, | ||
| float * | fR | ||
| ) |
| float getMasterPeak_L | ( | ) |
| float getMasterPeak_R | ( | ) |
| float getMaxProcessTime | ( | ) | const |
| MidiInput * getMidiInput | ( | ) | const |
Used to display midi driver info.
| MidiOutput * getMidiOutput | ( | ) | const |
| float getNewBpmJTM | ( | ) | const |
Returns the fallback speed.
| PatternList * getNextPatterns | ( | ) |
|
inline |
|
inline |
| float getNoteLength | ( | ) |
| long getPatternLength | ( | int | nPattern | ) |
Get the length (in ticks) of the nPattern th pattern.
Access the length of the first Pattern found in the PatternList at nPattern - 1.
This function should also work if the loop mode is enabled in Song::getIsLoopEnabled().
| nPattern | Position + 1 of the desired PatternList. |
| int getPatternPos | ( | ) |
Get the position of the current Pattern in the Song.
|
inline |
Wrapper around Song::getPlaybackTrackEnabled().
| int getPosForTick | ( | unsigned long | TickPos, |
| int * | nPatternStartTick | ||
| ) |
Returns the pattern number corresponding to the tick position TickPos.
Wrapper around function findPatternInTick() (globally defined in hydrogen.cpp).
| TickPos | Position in ticks. |
| nPatternStartTick | Pointer to an int the starting position (in ticks) of the corresponding pattern will be written to. |
| float getProcessTime | ( | ) | const |
| unsigned long getRealtimeFrames | ( | ) |
Returns the current realtime transport position TransportInfo::m_nFrames.
| unsigned long getRealtimeTickPosition | ( | ) |
Keep track of the tick position in realtime.
Firstly, it gets the current transport position in frames m_nRealtimeFrames and converts it into ticks using TransportInfo::m_fTickSize. Afterwards, it accesses how much time passed since the last update of m_currentTickTime, converts the time difference + AudioOutput::getBufferSize()/ AudioOutput::getSampleRate() in frames, and adds the result to the first value to support keyboard and MIDI events as well.
| int getSelectedInstrumentNumber | ( | ) |
| int getSelectedPatternNumber | ( | ) |
| int getState | ( | ) | const |
Returns the current state of the audio engine.
| long getTickForPosition | ( | int | pos | ) |
Get the total number of ticks passed up to a Pattern at position pos.
The function will loop over all and sums up their Pattern::__length. If one of the Pattern is NULL or no Pattern is present one of the PatternList, MAX_NOTES will be added instead.
The driver should be LOCKED when calling this!
| pos | Position of the Pattern in the Song::__pattern_group_sequence. |
| unsigned long getTickPosition | ( | ) |
|
inline |
| float getTimelineBpm | ( | int | nBar | ) |
Returns the local speed at a specific nBar in the Timeline.
If Hydrogen is in Song::PATTERN_MODE or Preferences::__useTimelineBpm is set to false, the global speed of the current Song Song::m_fBpm or, if no Song is present yet, the result of getNewBpmJTM() will be returned.
Its counterpart is setTimelineBpm().
| nBar | Position (in whole patterns) along the Timeline to access the tempo at. |
| unsigned long getTotalFrames | ( | ) |
| void handleBeatCounter | ( | ) |
| bool haveJackAudioDriver | ( | ) | const |
| bool haveJackTransport | ( | ) | const |
|
private |
Auxiliary function setting a bunch of global variables.
| bool instrumentHasNotes | ( | Instrument * | pInst | ) |
Test if an Instrument has some Note in the Pattern (used to test before deleting an Instrument)
| bool isUnderSessionManagement | ( | ) | const |
| int loadDrumkit | ( | Drumkit * | pDrumkitInfo | ) |
Wrapper around loadDrumkit( Drumkit, bool ) with the conditional argument set to true.
| int loadDrumkit | ( | Drumkit * | pDrumkitInfo, |
| bool | conditional | ||
| ) |
Loads the H2Core::Drumkit provided in pDrumkitInfo into the current session.
When under session management (see NsmClient::m_bUnderSessionManagement) the function will create a symlink to the loaded H2Core::Drumkit using the name "drumkit" in the folder NsmClient::m_sSessionFolderPath.
| pDrumkitInfo | Full-fledged H2Core::Drumkit to load. |
| conditional | Argument passed on as second input argument to removeInstrument(). |
| void loadPlaybackTrack | ( | const QString | filename | ) |
Wrapper function for loading the playback track.
Calls Song::setPlaybackTrackFilename() and Sampler::reinitialize_playback_track(). While the former one is responsible to store metadata about the playback track, the latter one does load it to a new InstrumentLayer. The function is called by SongEditorPanel::editPlaybackTrackBtnPressed()
| filename | Name of the file to load as the playback track |
| void midi_noteOn | ( | Note * | note | ) |
| void offJackMaster | ( | ) |
Calling JackAudioDriver::releaseTimebaseMaster() directly from the GUI.
| void onJackMaster | ( | ) |
Calling JackAudioDriver::initTimebaseMaster() directly from the GUI.
| void onTapTempoAccelEvent | ( | ) |
| void previewInstrument | ( | Instrument * | pInstr | ) |
| void previewSample | ( | Sample * | pSample | ) |
| void raiseError | ( | unsigned | nErrorCode | ) |
| void recreateOscServer | ( | ) |
Destroys and recreates the OscServer singleton in order to adopt a new OSC port.
| void refreshInstrumentParameters | ( | int | nInstrument | ) |
| void removeInstrument | ( | int | instrumentnumber, |
| bool | conditional | ||
| ) |
Delete an Instrument.
If conditional is true, and there are some Pattern that are using this Instrument, it's not deleted anyway.
| void removeSong | ( | ) |
| void renameJackPorts | ( | Song * | pSong | ) |
Calls audioEngine_renameJackPorts() if Preferences::m_bJackTrackOuts is set to true.
| pSong | Handed to audioEngine_renameJackPorts(). |
| void resetPatternStartTick | ( | ) |
Move playback in Pattern mode to the beginning of the pattern.
Resetting the global variable m_nPatternStartTick to -1 if the current Song mode is Song::PATTERN_MODE.
| void restartDrivers | ( | ) |
| void restartLadspaFX | ( | ) |
| void sequencer_play | ( | ) |
Start the internal sequencer.
| void sequencer_setNextPattern | ( | int | pos | ) |
Adding and removing a Pattern from m_pNextPatterns.
After locking the AudioEngine the function retrieves the particular pattern pos from the Song::m_pPatternList and either deletes it from m_pNextPatterns if already present or add it to the same pattern list if not present yet.
If the Song is not in Song::PATTERN_MODE or pos is not within the range of Song::m_pPatternList, m_pNextPatterns will be cleared instead.
| pos | Index of a particular pattern in Song::m_pPatternList, which should be added to m_pNextPatterns. |
| void sequencer_setOnlyNextPattern | ( | int | pos | ) |
Clear m_pNextPatterns and add one Pattern.
After locking the AudioEngine the function clears m_pNextPatterns, fills it with all currently played one in m_pPlayingPatterns, and appends the particular pattern pos from the Song::m_pPatternList.
If the Song is not in Song::PATTERN_MODE or pos is not within the range of Song::m_pPatternList, m_pNextPatterns will be just cleared.
| pos | Index of a particular pattern in Song::m_pPatternList, which should be added to m_pNextPatterns. |
| void sequencer_stop | ( | ) |
Stop the internal sequencer.
| void setBcOffsetAdjust | ( | ) |
| void setbeatsToCount | ( | int | beatstocount | ) |
Updates m_nbeatsToCount.
| beatstocount | New value |
| void setBPM | ( | float | fBPM | ) |
Updates the speed.
It calls AudioOutput::setBpm() and setNewBpmJTM() with fBPM as input argument and sets Song::m_fBpm to fBPM.
This function will be called with the AudioEngine in LOCKED state.
| fBPM | New speed in beats per minute. |
|
inline |
| lookup | sets m_currentDrumkitLookup |
|
inline |
| sName | sets m_sCurrentDrumkitName |
| void setCurrentPatternList | ( | PatternList * | pPatternList | ) |
Sets m_pPlayingPatterns.
Before setting the variable it first locks the AudioEngine. In addition, it also pushes the Event EVENT_PATTERN_CHANGED with the value -1 to the EventQueue.
| pPatternList | Sets m_pPlayingPatterns. |
|
inline |
| state | Specifies whether the Qt5 GUI is active. Sets m_GUIState. |
| void setInitialSong | ( | Song * | pSong | ) |
Sets the first Song to be loaded under session management.
Enables the creation of a JACK client with all per track output ports present right from the start. This is necessary to ensure their connection can be properly restored by external tools.
The function will only work if no audio driver is present (since this is the intended use case and the function will be harmful if used otherwise. Use setSong() instead.) and fails if there is already a Song present.
| pSong | Song to be loaded. |
| void setLadspaFXPeak | ( | int | nFX, |
| float | fL, | ||
| float | fR | ||
| ) |
| void setMasterPeak_L | ( | float | value | ) |
| void setMasterPeak_R | ( | float | value | ) |
| void setNewBpmJTM | ( | float | bpmJTM | ) |
Set the fallback speed #m_nNewBpmJTM.
| bpmJTM | New default tempo. |
|
inline |
| pNextSong | Sets m_pNextSong. Song which is about to be loaded by the GUI. |
|
inline |
| void setNoteLength | ( | float | notelength | ) |
| void setPatternPos | ( | int | pos | ) |
Relocate the position to another Pattern in the Song.
The position of a Pattern in frames (see TransportInfo::m_nFrames for details) will be determined by retrieving the tick number the Pattern is located at using getTickForPosition() and multiplying it with TransportInfo::m_fTickSize. The resulting value will be used by the AudioOutput::locate() function of your audio driver to relocate the playback position.
If m_audioEngineState is not STATE_PLAYING, the variables m_nSongPos and m_nPatternTickPosition will be set to pos and 0 right away.
| bool setPlaybackTrackState | ( | const bool | state | ) |
Wrapper around Song::setPlaybackTrackEnabled().
| void setRealtimeFrames | ( | unsigned long | frames | ) |
Sets m_nRealtimeFrames.
| frames | Current transport realtime position |
| void setSelectedInstrumentNumber | ( | int | nInstrument | ) |
| void setSelectedPatternNumber | ( | int | nPat | ) |
Sets m_nSelectedPatternNumber.
If Preferences::m_pPatternModePlaysSelected is set to true, the AudioEngine is locked before nPat will be assigned. But in any case the function will push the EVENT_SELECTED_PATTERN_CHANGED Event to the EventQueue.
If nPat is equal to m_nSelectedPatternNumber, the function will return right away.
| nPat | Sets m_nSelectedPatternNumber |
| void setSong | ( | Song * | newSong | ) |
| void setTapTempo | ( | float | fInterval | ) |
| void setTimelineBpm | ( | ) |
Updates Song::m_fBpm, TransportInfo::m_fBPM, and m_fNewBpmJTM to the local speed.
The local speed will be obtained by calling getTimelineBpm() with getPatternPos() as input argument and set for the current song and transport. For setting the fallback speed m_fNewBpmJTM, getRealtimeTickPosition() will be used instead.
If Preferences::__useTimelineBpm is set to false or Hydrogen uses JACK transport in the presence of an external timebase master, the function will return without performing any actions.
| void startExportSession | ( | int | rate, |
| int | depth | ||
| ) |
| void startExportSong | ( | const QString & | filename | ) |
Export a song to a wav file.
| void startNsmClient | ( | ) |
| void stopExportSession | ( | ) |
| void stopExportSong | ( | ) |
| void toggleOscServer | ( | bool | bEnable | ) |
Starts/stops the OSC server.
| bEnable | true = start, false = stop. |
| void togglePlaysSelected | ( | ) |
Switches playback to focused pattern.
If the current Song is in Song::PATTERN_MODE, the AudioEngine will be locked and Preferences::m_bPatternModePlaysSelected negated. If the latter was true before calling this function, m_pPlayingPatterns will be cleared and replaced by the Pattern indexed with m_nSelectedPatternNumber.
This function will be called either by MainForm::eventFilter() when pressing Qt::Key_L or by SongEditorPanel::modeActionBtnPressed().
|
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().
|
private |
Deleting instruments too soon leads to potential crashes.
|
private |
Pointer to the current song.
It is initialized with NULL in the Hydrogen() constructor, set via setSong(), and accessed via getSong().
| QString lastMidiEvent |
Last received midi message.
| int lastMidiEventParameter |
|
private |
|
private |
|
private |
Whether the current Drumkit is located at user or system level.
|
private |
timeval
|
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 Song must be set via the GUI if active. Else the GUI will freeze.
Set by setGUIState() and accessed via getGUIState().
|
private |
beatcounter beat to count
|
private |
beat diff
|
private |
beatcounter beats to count
|
private |
|
private |
beatcounter event
| int m_nInstrumentLookupTable[MAX_INSTRUMENTS] |
midi lookuptable
| int m_nMaxTimeHumanize |
Maximum time (in frames) a note's position can be off due to the humanization (lead-lag).
Required to calculateLookahead(). Set to 2000.
|
private |
ms default 0
|
private |
beatcounter note length
|
private |
count tempochanges for timeArray
|
private |
ms default 0
|
private |
Local instance of the CoreActionController object.
|
private |
Stores a new Song which is about of the loaded by the GUI.
If m_GUIState is true, the core part of must not load a new Song itself. Instead, the new Song is prepared and stored in this object to be loaded by HydrogenApp::updateSongEvent() if H2Core::EVENT_UPDATE_SONG is pushed with a '1'.
Set by setNextSong() and accessed via getNextSong().
|
private |
Name of the currently used Drumkit.
|
private |