hydrogen 1.1.1
HydrogenApp Class Reference

#include <HydrogenApp.h>

Inheritance diagram for HydrogenApp:
EventListener Object

Public Types

enum  SetPropertyFlag {
  SetX = 1 << 0 , SetY = 1 << 1 , SetWidth = 1 << 2 , SetHeight = 1 << 3 ,
  SetVisible = 1 << 4 , SetAll = SetX + SetY + SetWidth + SetHeight + SetVisible , SetDefault = SetAll
}
 

Public Slots

void onEventQueueTimer ()
 Function called every QUEUE_TIMER_PERIOD millisecond to pop all Events from the EventQueue and invoke the corresponding functions. More...
 
void currentTabChanged (int)
 

Public Member Functions

 HydrogenApp (MainForm *pMainForm, H2Core::Song *pFirstSong)
 
virtual ~HydrogenApp ()
 
bool openSong (const QString sFilename)
 
bool openSong (H2Core::Song *pSong)
 
void showPreferencesDialog ()
 
void updateMixerCheckbox ()
 
void showMixer (bool bShow)
 
void showInstrumentPanel (bool)
 
void showAudioEngineInfoForm ()
 
void showFilesystemInfoForm ()
 
void showPlaylistDialog ()
 
void showDirector ()
 
void showSampleEditor (QString name, int mSelectedComponemt, int mSelectedLayer)
 
bool hideKeyboardCursor ()
 
void setHideKeyboardCursor (bool bHidden)
 
MixergetMixer ()
 
MainFormgetMainForm ()
 
SongEditorPanelgetSongEditorPanel ()
 
AudioEngineInfoFormgetAudioEngineInfoForm ()
 
PlaylistDialoggetPlayListDialog ()
 
DirectorgetDirector ()
 
SampleEditorgetSampleEditor ()
 
PatternEditorPanelgetPatternEditorPanel ()
 
PlayerControlgetPlayerControl ()
 
InstrumentRackgetInstrumentRack ()
 
InfoBaraddInfoBar ()
 
void setStatusBarMessage (const QString &msg, int msec=0)
 
void setScrollStatusBarMessage (const QString &msg, int msec=0, bool test=true)
 
void updateWindowTitle ()
 
void addEventListener (EventListener *pListener)
 
void removeEventListener (EventListener *pListener)
 
void closeFXProperties ()
 
void onDrumkitLoad (QString name)
 
void cleanupTemporaryFiles ()
 Removes temporary files that were created for undo'ing things. More...
 
void setWindowProperties (QWidget *pWindow, H2Core::WindowProperties &prop, unsigned flags=SetAll)
 
H2Core::WindowProperties getWindowProperties (QWidget *pWindow)
 
- Public Member Functions inherited from EventListener
virtual void stateChangedEvent (int nState)
 
virtual void patternChangedEvent ()
 
virtual void patternModifiedEvent ()
 
virtual void songModifiedEvent ()
 
virtual void selectedPatternChangedEvent ()
 
virtual void selectedInstrumentChangedEvent ()
 
virtual void parametersInstrumentChangedEvent ()
 
virtual void midiActivityEvent ()
 
virtual void noteOnEvent (int nInstrument)
 
virtual void XRunEvent ()
 
virtual void errorEvent (int nErrorCode)
 
virtual void metronomeEvent (int nValue)
 
virtual void rubberbandbpmchangeEvent ()
 
virtual void progressEvent (int nValue)
 
virtual void jacksessionEvent (int nValue)
 
virtual void playlistLoadSongEvent (int nIndex)
 
virtual void undoRedoActionEvent (int nValue)
 
virtual void tempoChangedEvent (int nValue)
 
virtual void updateSongEvent (int nValue)
 
virtual void quitEvent (int nValue)
 
virtual void timelineActivationEvent (int nValue)
 
virtual void timelineUpdateEvent (int nValue)
 
virtual void jackTransportActivationEvent (int nValue)
 
virtual void jackTimebaseActivationEvent (int nValue)
 
virtual void songModeActivationEvent (int nValue)
 
virtual void loopModeActivationEvent (int nValue)
 
virtual void updatePreferencesEvent (int nValue)
 
virtual void actionModeChangeEvent (int nValue)
 
virtual ~EventListener ()
 
- 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 HydrogenAppget_instance ()
 Returns the instance of HydrogenApp class. 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 Loggerlogger ()
 return the logger instance More...
 

Data Fields

QUndoStack * m_pUndoStack
 

Private Member Functions

void engineError (uint nErrorCode)
 
void setupSinglePanedInterface ()
 
virtual void songModifiedEvent () override
 
virtual void updatePreferencesEvent (int nValue) override
 Handles the loading and saving of the H2Core::Preferences from the core part of H2Core::Hydrogen. More...
 
virtual void updateSongEvent (int nValue) override
 Refreshes and updates the GUI after the Song was changed in the core part of Hydrogen. More...
 
virtual void quitEvent (int nValue) override
 Calls closeAll() to shutdown Hydrogen. More...
 

Private Attributes

MainFormm_pMainForm
 
Mixerm_pMixer
 
PatternEditorPanelm_pPatternEditorPanel
 
AudioEngineInfoFormm_pAudioEngineInfoForm
 
FilesystemInfoFormm_pFilesystemInfoForm
 
SongEditorPanelm_pSongEditorPanel
 
InstrumentRackm_pInstrumentRack
 
PlayerControlm_pPlayerControl
 
PlaylistDialogm_pPlaylistDialog
 
SampleEditorm_pSampleEditor
 
Directorm_pDirector
 
QTimer * m_pEventQueueTimer
 
std::vector< EventListener * > m_EventListeners
 
QTabWidget * m_pTab
 
QSplitter * m_pSplitter
 
QVBoxLayout * m_pMainVBox
 
bool m_bHideKeyboardCursor
 

Static Private Attributes

static HydrogenAppm_pInstance = nullptr
 HydrogenApp instance. 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...
 

Member Enumeration Documentation

◆ SetPropertyFlag

Enumerator
SetX 
SetY 
SetWidth 
SetHeight 
SetVisible 
SetAll 
SetDefault 

Constructor & Destructor Documentation

◆ HydrogenApp()

HydrogenApp ( MainForm pMainForm,
H2Core::Song pFirstSong 
)

◆ ~HydrogenApp()

~HydrogenApp ( )
virtual

Member Function Documentation

◆ addEventListener()

void addEventListener ( EventListener pListener)

◆ addInfoBar()

InfoBar * addInfoBar ( )

◆ cleanupTemporaryFiles()

void cleanupTemporaryFiles ( )

Removes temporary files that were created for undo'ing things.

◆ closeFXProperties()

void closeFXProperties ( )

◆ currentTabChanged

void currentTabChanged ( int  index)
slot

◆ engineError()

void engineError ( uint  nErrorCode)
private

◆ get_instance()

HydrogenApp * get_instance ( )
static

Returns the instance of HydrogenApp class.

Return an HydrogenApp m_pInstance.

◆ getAudioEngineInfoForm()

AudioEngineInfoForm * getAudioEngineInfoForm ( )
inline

◆ getDirector()

Director * getDirector ( )
inline

◆ getInstrumentRack()

InstrumentRack * getInstrumentRack ( )
inline

◆ getMainForm()

MainForm * getMainForm ( )
inline

◆ getMixer()

Mixer * getMixer ( )
inline

◆ getPatternEditorPanel()

PatternEditorPanel * getPatternEditorPanel ( )
inline

◆ getPlayerControl()

PlayerControl * getPlayerControl ( )
inline

◆ getPlayListDialog()

PlaylistDialog * getPlayListDialog ( )
inline

◆ getSampleEditor()

SampleEditor * getSampleEditor ( )
inline

◆ getSongEditorPanel()

SongEditorPanel * getSongEditorPanel ( )
inline

◆ getWindowProperties()

WindowProperties getWindowProperties ( QWidget *  pWindow)

◆ hideKeyboardCursor()

bool hideKeyboardCursor ( )
inline

◆ onDrumkitLoad()

void onDrumkitLoad ( QString  name)

◆ onEventQueueTimer

void onEventQueueTimer ( )
slot

Function called every QUEUE_TIMER_PERIOD millisecond to pop all Events from the EventQueue and invoke the corresponding functions.

Depending on the H2Core::EventType, the following members of EventListener will be called:

In addition, all MIDI notes in H2Core::EventQueue::m_addMidiNoteVector will converted into actions via SE_addNoteAction() and deleted from the former array.

◆ openSong() [1/2]

bool openSong ( const QString  sFilename)
Parameters
sFilenameAbsolute path used to load the next Song.
Returns
bool true on success

◆ openSong() [2/2]

bool openSong ( H2Core::Song pSong)

◆ quitEvent()

void quitEvent ( int  nValue)
overrideprivatevirtual

Calls closeAll() to shutdown Hydrogen.

Parameters
nValueunused

Reimplemented from EventListener.

◆ removeEventListener()

void removeEventListener ( EventListener pListener)

◆ setHideKeyboardCursor()

void setHideKeyboardCursor ( bool  bHidden)
inline

◆ setScrollStatusBarMessage()

void setScrollStatusBarMessage ( const QString &  msg,
int  msec = 0,
bool  test = true 
)

◆ setStatusBarMessage()

void setStatusBarMessage ( const QString &  msg,
int  msec = 0 
)

◆ setupSinglePanedInterface()

void setupSinglePanedInterface ( )
private

◆ setWindowProperties()

void setWindowProperties ( QWidget *  pWindow,
H2Core::WindowProperties prop,
unsigned  flags = SetAll 
)

◆ showAudioEngineInfoForm()

void showAudioEngineInfoForm ( )

◆ showDirector()

void showDirector ( )

◆ showFilesystemInfoForm()

void showFilesystemInfoForm ( )

◆ showInstrumentPanel()

void showInstrumentPanel ( bool  show)

◆ showMixer()

void showMixer ( bool  bShow)

◆ showPlaylistDialog()

void showPlaylistDialog ( )

◆ showPreferencesDialog()

void showPreferencesDialog ( )

◆ showSampleEditor()

void showSampleEditor ( QString  name,
int  mSelectedComponemt,
int  mSelectedLayer 
)

◆ songModifiedEvent()

void songModifiedEvent ( )
overrideprivatevirtual

Reimplemented from EventListener.

◆ updateMixerCheckbox()

void updateMixerCheckbox ( )

◆ updatePreferencesEvent()

void updatePreferencesEvent ( int  nValue)
overrideprivatevirtual

Handles the loading and saving of the H2Core::Preferences from the core part of H2Core::Hydrogen.

If nValue is 0 - the H2Core::Preferences got saved - it triggers the display of a message in the status bar. If, on the other hand, nValue is 1 and the configuration file has been reloaded, it gets a fresh version of H2Core::Preferences and updates all widgets and setting to reflect the changes in the configuration.

Parameters
nValueIf 0, Preferences was save. If 1, it was loaded.

Reimplemented from EventListener.

◆ updateSongEvent()

void updateSongEvent ( int  nValue)
overrideprivatevirtual

Refreshes and updates the GUI after the Song was changed in the core part of Hydrogen.

When using session management or changing the Song using an OSC message, this command will get core and GUI in sync again.

Parameters
nValueIf 0 or 1, loads the Song stored in H2Core::Hydrogen::m_pNextSong. If 1, also restarts the audio driver via H2Core::Hydrogen::restartDrivers(). If 2, a message in the status bar will be displayed notifying the user about the saving of the current Song to the config file.

Reimplemented from EventListener.

◆ updateWindowTitle()

void updateWindowTitle ( )

Field Documentation

◆ m_bHideKeyboardCursor

bool m_bHideKeyboardCursor
private

◆ m_EventListeners

std::vector<EventListener*> m_EventListeners
private

◆ m_pAudioEngineInfoForm

AudioEngineInfoForm* m_pAudioEngineInfoForm
private

◆ m_pDirector

Director* m_pDirector
private

◆ m_pEventQueueTimer

QTimer* m_pEventQueueTimer
private

◆ m_pFilesystemInfoForm

FilesystemInfoForm* m_pFilesystemInfoForm
private

◆ m_pInstance

HydrogenApp * m_pInstance = nullptr
staticprivate

HydrogenApp instance.

◆ m_pInstrumentRack

InstrumentRack* m_pInstrumentRack
private

◆ m_pMainForm

MainForm* m_pMainForm
private

◆ m_pMainVBox

QVBoxLayout* m_pMainVBox
private

◆ m_pMixer

Mixer* m_pMixer
private

◆ m_pPatternEditorPanel

PatternEditorPanel* m_pPatternEditorPanel
private

◆ m_pPlayerControl

PlayerControl* m_pPlayerControl
private

◆ m_pPlaylistDialog

PlaylistDialog* m_pPlaylistDialog
private

◆ m_pSampleEditor

SampleEditor* m_pSampleEditor
private

◆ m_pSongEditorPanel

SongEditorPanel* m_pSongEditorPanel
private

◆ m_pSplitter

QSplitter* m_pSplitter
private

◆ m_pTab

QTabWidget* m_pTab
private

◆ m_pUndoStack

QUndoStack* m_pUndoStack