hydrogen 1.1.1
CoreActionController Class Reference

#include <CoreActionController.h>

Inheritance diagram for CoreActionController:
Object

Public Member Functions

 CoreActionController ()
 
 ~CoreActionController ()
 
void setMasterVolume (float masterVolumeValue)
 
void setStripVolume (int nStrip, float fVolumeValue, bool bSelectStrip)
 
void setStripPan (int nStrip, float fPanValue, bool bSelectStrip)
 
void setMetronomeIsActive (bool isActive)
 
void setMasterIsMuted (bool isMuted)
 
void setStripIsMuted (int nStrip, bool isMuted)
 
void toggleStripIsMuted (int nStrip)
 
void setStripIsSoloed (int nStrip, bool isSoloed)
 
void toggleStripIsSoloed (int nStrip)
 
void initExternalControlInterfaces ()
 
void handleOutgoingControlChange (int param, int value)
 
bool newSong (const QString &songPath)
 Create an empty #Song, which will be stored in songPath. More...
 
bool openSong (const QString &songPath)
 Opens the #Song specified in songPath. More...
 
bool openSong (Song *pSong)
 Opens the #Song specified in songPath. More...
 
bool saveSong ()
 Saves the current #Song. More...
 
bool saveSongAs (const QString &songPath)
 Saves the current #Song to the path provided in songPath. More...
 
bool savePreferences ()
 Saves the current state of the #Preferences. More...
 
bool quit ()
 Triggers the shutdown of Hydrogen. More...
 
bool activateTimeline (bool bActivate)
 (De)activates the usage of the Timeline. More...
 
bool addTempoMarker (int nPosition, float fBpm)
 Adds a tempo marker to the Timeline. More...
 
bool deleteTempoMarker (int nPosition)
 Delete a tempo marker from the Timeline. More...
 
bool activateJackTransport (bool bActivate)
 (De)activates the usage of Jack transport. More...
 
bool activateJackTimebaseMaster (bool bActivate)
 (De)activates the usage of Jack timebase master. More...
 
bool activateSongMode (bool bActivate, bool bTriggerEvent)
 Switches between Song and Pattern mode of playback. More...
 
bool activateLoopMode (bool bActivate, bool bTriggerEvent)
 Toggle loop mode of playback. More...
 
bool relocate (int nPatternGroup)
 Relocates transport to the beginning of a particular Pattern. More...
 
bool isSongPathValid (const QString &songPath)
 Checks the path of the .h2song provided via OSC. 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...
 

Private Member Functions

bool setSong (Song *pSong)
 Sets a #Song to be used by Hydrogen. More...
 

Private Attributes

const int m_nDefaultMidiFeedbackChannel
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void set_count (bool flag)
 enable/disable class instances counting More...
 
static bool count_active ()
 return true if class instances counting is enabled More...
 
static unsigned objects_count ()
 return the number of objects More...
 
static void write_objects_map_to (std::ostream &out)
 output the full objects map to a given ostream More...
 
static void write_objects_map_to_cerr ()
 output objects map to stderr More...
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation ! More...
 
static Loggerlogger ()
 return the logger instance More...
 
- 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...
 

Constructor & Destructor Documentation

◆ CoreActionController()

◆ ~CoreActionController()

Member Function Documentation

◆ activateJackTimebaseMaster()

bool activateJackTimebaseMaster ( bool  bActivate)

(De)activates the usage of Jack timebase master.

Note that this function will fail if Jack is not used as audio driver.

Parameters
bActivateIf true - activate or if false - deactivate.
Returns
bool true on success

◆ activateJackTransport()

bool activateJackTransport ( bool  bActivate)

(De)activates the usage of Jack transport.

Note that this function will fail if Jack is not used as audio driver.

Parameters
bActivateIf true - activate or if false - deactivate.
Returns
bool true on success

◆ activateLoopMode()

bool activateLoopMode ( bool  bActivate,
bool  bTriggerEvent 
)

Toggle loop mode of playback.

Parameters
bActivateIf true - activates loop mode.
bTriggerEventSetting this variable to true is intended for its use as a batch function from within Hydrogen's core, which will inform the GUI via an Event about the change of mode. When used from the GUI itself, this parameter has to be set to false.
Returns
bool true on success

◆ activateSongMode()

bool activateSongMode ( bool  bActivate,
bool  bTriggerEvent 
)

Switches between Song and Pattern mode of playback.

Parameters
bActivateIf true - activates Song mode or if false - activates Pattern mode.
bTriggerEventSetting this variable to true is intended for its use as a batch function from within Hydrogen's core, which will inform the GUI via an Event about the change of mode. When used from the GUI itself, this parameter has to be set to false.
Returns
bool true on success

◆ activateTimeline()

bool activateTimeline ( bool  bActivate)

(De)activates the usage of the Timeline.

Note that this function will fail in the presence of the Jack audio driver and an external timebase master (see Hydrogen::getJackTimebaseState()).

Parameters
bActivateIf true - activate or if false - deactivate.
Returns
bool true on success

◆ addTempoMarker()

bool addTempoMarker ( int  nPosition,
float  fBpm 
)

Adds a tempo marker to the Timeline.

Parameters
nPositionLocation of the tempo marker in bars.
fBpmSpeed associated with the tempo marker.
Returns
bool true on success

◆ deleteTempoMarker()

bool deleteTempoMarker ( int  nPosition)

Delete a tempo marker from the Timeline.

If no Tempo marker is present at nPosition, the function will return true as well.

Parameters
nPositionLocation of the tempo marker in bars.
Returns
bool true on success

◆ handleOutgoingControlChange()

void handleOutgoingControlChange ( int  param,
int  value 
)

◆ initExternalControlInterfaces()

void initExternalControlInterfaces ( )

◆ isSongPathValid()

bool isSongPathValid ( const QString &  songPath)

Checks the path of the .h2song provided via OSC.

It will be checked whether songPath

  • is absolute
  • has the '.h2song' suffix
  • is writable (if it exists)
Parameters
songPathAbsolute path to an .h2song file.
Returns
true - if valid.

◆ newSong()

bool newSong ( const QString &  songPath)

Create an empty #Song, which will be stored in songPath.

This will be done immediately and without saving the current #Song. All unsaved changes will be lost! In addition, the new song won't be saved by this function. You can do so using saveSong().

The intended use of this function for session management. Therefore, the function will not store the provided songPath in Preferences::m_lastSongFilename and Hydrogen won't resume with the corresponding song on restarting.

Parameters
songPathAbsolute path to the .h2song file to be opened.
Returns
true on success

◆ openSong() [1/2]

bool openSong ( const QString &  songPath)

Opens the #Song specified in songPath.

This will be done immediately and without saving the current #Song. All unsaved changes will be lost!

The intended use of this function for session management. Therefore, the function will not store the provided songPath in Preferences::m_lastSongFilename and Hydrogen won't resume with the corresponding song on restarting.

Parameters
songPathAbsolute path to the .h2song file to be opened.
Returns
true on success

◆ openSong() [2/2]

bool openSong ( Song pSong)

Opens the #Song specified in songPath.

This will be done immediately and without saving the current #Song. All unsaved changes will be lost!

The intended use of this function for session management. Therefore, the function will not store the provided @pSong in Preferences::m_lastSongFilename and Hydrogen won't resume with the corresponding song on restarting.

Parameters
pSongNew Song.
Returns
true on success

◆ quit()

bool quit ( )

Triggers the shutdown of Hydrogen.

This will be done immediately and without saving the current #Song. All unsaved changes will be lost!

The shutdown will be triggered in both the CLI and the GUI via the H2Core::EVENT_QUIT event.

Returns
true on success

◆ relocate()

bool relocate ( int  nPatternGroup)

Relocates transport to the beginning of a particular Pattern.

Parameters
nPatternGroupPosition of the Song provided as the index of a particular pattern group (starting at zero).
Returns
bool true on success

◆ savePreferences()

bool savePreferences ( )

Saves the current state of the #Preferences.

Returns
true on success

◆ saveSong()

bool saveSong ( )

Saves the current #Song.

Returns
true on success

◆ saveSongAs()

bool saveSongAs ( const QString &  songPath)

Saves the current #Song to the path provided in songPath.

The intended use of this function for session management. Therefore, the function will not store the provided songPath in Preferences::m_lastSongFilename and Hydrogen won't resume with the corresponding song on restarting.

Parameters
songPathAbsolute path to the file to store the current #Song in.
Returns
true on success

◆ setMasterIsMuted()

void setMasterIsMuted ( bool  isMuted)

◆ setMasterVolume()

void setMasterVolume ( float  masterVolumeValue)

◆ setMetronomeIsActive()

void setMetronomeIsActive ( bool  isActive)

◆ setSong()

bool setSong ( Song pSong)
private

Sets a #Song to be used by Hydrogen.

This will be done immediately and without saving the current #Song. All unsaved changes will be lost!

The intended use of this function for session management.

Parameters
pSongPointer to the #Song to set.
Returns
true on success

◆ setStripIsMuted()

void setStripIsMuted ( int  nStrip,
bool  isMuted 
)

◆ setStripIsSoloed()

void setStripIsSoloed ( int  nStrip,
bool  isSoloed 
)

◆ setStripPan()

void setStripPan ( int  nStrip,
float  fPanValue,
bool  bSelectStrip 
)
Parameters
nStripInstrument which to set the volume for.
fPanValueNew pan.
bSelectedStripWhether the corresponding instrument should be selected.

◆ setStripVolume()

void setStripVolume ( int  nStrip,
float  fVolumeValue,
bool  bSelectStrip 
)
Parameters
nStripInstrument which to set the volume for.
fVolumeValueNew volume.
bSelectedStripWhether the corresponding instrument should be selected.

◆ toggleStripIsMuted()

void toggleStripIsMuted ( int  nStrip)

◆ toggleStripIsSoloed()

void toggleStripIsSoloed ( int  nStrip)

Field Documentation

◆ m_nDefaultMidiFeedbackChannel

const int m_nDefaultMidiFeedbackChannel
private