hydrogen 1.1.1
MainForm Class Reference

debug only More...

#include <MainForm.h>

Inheritance diagram for MainForm:
EventListener Object

Public Slots

void showPreferencesDialog ()
 
void showUserManual ()
 
void action_file_new ()
 Project > New handling function. More...
 
void action_file_open ()
 Project > Open / Import into Session handling function. More...
 
void action_file_openDemo ()
 
void action_file_save ()
 
void action_file_save_as ()
 Project > Save As / Export from Session handling function. More...
 
void action_file_openPattern ()
 
void action_file_export_pattern_as ()
 
bool action_file_exit ()
 return true if the app needs to be closed. More...
 
void action_file_export ()
 
void action_file_export_midi ()
 
void action_file_export_lilypond ()
 
void action_file_songProperties ()
 
void action_help_about ()
 
void action_report_bug ()
 
void action_donate ()
 
void action_instruments_addInstrument ()
 
void action_instruments_clearAll ()
 
void action_instruments_saveLibrary ()
 
void action_instruments_saveAsLibrary ()
 
void action_instruments_exportLibrary ()
 
void action_instruments_importLibrary ()
 
void action_instruments_onlineImportLibrary ()
 
void action_instruments_addComponent ()
 
void action_banks_properties ()
 
void action_banks_open ()
 
void action_window_showMixer ()
 
void action_window_showPlaylistDialog ()
 
void action_window_show_DirectorWidget ()
 
void action_window_showSongEditor ()
 Shows the song editor. More...
 
void action_window_showPatternEditor ()
 
void action_window_showInstrumentRack ()
 
void action_window_showAutomationArea ()
 
void action_window_showTimeline ()
 
void action_window_showPlaybackTrack ()
 
void action_window_toggleFullscreen ()
 
void update_mixer_checkbox ()
 
void update_instrument_checkbox (bool show)
 
void update_automation_checkbox ()
 
void update_playback_track_group ()
 
void update_director_checkbox ()
 
void update_playlist_checkbox ()
 
void action_debug_printObjects ()
 print the object map More...
 
void action_debug_showAudioEngineInfo ()
 
void action_debug_showFilesystemInfo ()
 
void action_debug_openLogfile ()
 
void action_debug_logLevel_none ()
 
void action_debug_logLevel_error ()
 
void action_debug_logLevel_warn ()
 
void action_debug_logLevel_info ()
 
void action_debug_logLevel_debug ()
 
void closeEvent (QCloseEvent *ev) override
 Window close event. More...
 
void onPlayStopAccelEvent ()
 
void onRestartAccelEvent ()
 
void onBPMPlusAccelEvent ()
 
void onBPMMinusAccelEvent ()
 
void onSaveAsAccelEvent ()
 
void onSaveAccelEvent ()
 
void onOpenAccelEvent ()
 
void action_file_open_recent (QAction *pAction)
 
void showDevelWarning ()
 
void onLashPollTimer ()
 
void openUndoStack ()
 
void action_undo ()
 
void action_redo ()
 
void action_inputMode_instrument ()
 
void action_inputMode_drumkit ()
 
void handleSigUsr1 ()
 
void closeAll ()
 Wrapper around savePreferences() and quit() method of m_pQApp. More...
 
void savePreferences ()
 Stores the current state of the GUI (position, width, height, and visibility of the widgets) in the H2Core::Preferences. More...
 
void checkMidiSetup ()
 
void checkMissingSamples ()
 
void setMainWindowSize (int w, int h)
 

Public Member Functions

 MainForm (QApplication *pQApplication, const QString &songFilename, const bool bLoadSong)
 
 ~MainForm ()
 
void updateRecentUsedSongList ()
 
virtual void errorEvent (int nErrorCode) override
 
virtual void jacksessionEvent (int nValue) override
 
virtual void playlistLoadSongEvent (int nIndex) 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 undoRedoActionEvent (int nEvent) override
 
- 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 void usr1SignalHandler (int unused)
 
- 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

QApplication * m_pQApp
 

Protected Member Functions

bool handleUnsavedChanges ()
 

Private Slots

void onAutoSaveTimer ()
 
void onPlaylistDisplayTimer ()
 
void onFixMidiSetup ()
 
void onFixMissingSamples ()
 

Private Member Functions

void functionDeleteInstrument (int instrument)
 
void createMenuBar ()
 Create the menubar. More...
 
void checkNecessaryDirectories ()
 
bool eventFilter (QObject *o, QEvent *e) override
 
void initKeyInstMap ()
 
QString getAutoSaveFilename ()
 
bool handleSelectNextPrevSongOnPlaylist (int step)
 
void startPlaybackAtCursor (QObject *pObject)
 Relocates to current position of the cursor and starts playback if the transport isn't rolling yet. More...
 

Private Attributes

HydrogenApph2app
 
QSocketNotifier * snUsr1
 
QMenu * m_pLogLevelMenu
 
QMenu * m_pInputModeMenu
 
QAction * m_pViewPlaylistEditorAction
 
QAction * m_pViewDirectorAction
 
QAction * m_pViewMixerAction
 
QAction * m_pViewMixerInstrumentRackAction
 
QAction * m_pViewAutomationPathAction
 
QAction * m_pViewTimelineAction
 
QAction * m_pViewPlaybackTrackAction
 
QActionGroup * m_pViewPlaybackTrackActionGroup
 
QAction * m_pInstrumentAction
 
QAction * m_pDrumkitAction
 
QMenu * m_pRecentFilesMenu
 
QAction * m_pRecentFileAction0
 
QAction * m_pRecentFileAction1
 
QAction * m_pRecentFileAction2
 
QAction * m_pRecentFileAction3
 
QAction * m_pRecentFileAction4
 
QUndoView * m_pUndoView
 
QTimer m_AutosaveTimer
 debug only More...
 
std::map< int, int > keycodeInstrumentMap
 
InfoBarm_pMidiSetupInfoBar
 
InfoBarm_pMissingSamplesInfoBar
 

Static Private Attributes

static int sigusr1Fd [2]
 

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...
 

Detailed Description

debug only

Main window

Constructor & Destructor Documentation

◆ MainForm()

MainForm ( QApplication *  pQApplication,
const QString &  songFilename,
const bool  bLoadSong 
)

◆ ~MainForm()

~MainForm ( )

Member Function Documentation

◆ action_banks_open

void action_banks_open ( )
slot

◆ action_banks_properties

void action_banks_properties ( )
slot

◆ action_debug_logLevel_debug

void action_debug_logLevel_debug ( )
slot

◆ action_debug_logLevel_error

void action_debug_logLevel_error ( )
slot

◆ action_debug_logLevel_info

void action_debug_logLevel_info ( )
slot

◆ action_debug_logLevel_none

void action_debug_logLevel_none ( )
slot

◆ action_debug_logLevel_warn

void action_debug_logLevel_warn ( )
slot

◆ action_debug_openLogfile

void action_debug_openLogfile ( )
slot

◆ action_debug_printObjects

void action_debug_printObjects ( )
slot

print the object map

◆ action_debug_showAudioEngineInfo

void action_debug_showAudioEngineInfo ( )
slot

◆ action_debug_showFilesystemInfo

void action_debug_showFilesystemInfo ( )
slot

◆ action_donate

void action_donate ( )
slot

◆ action_file_exit

bool action_file_exit ( )
slot

return true if the app needs to be closed.

◆ action_file_export

void action_file_export ( )
slot

◆ action_file_export_lilypond

void action_file_export_lilypond ( )
slot

◆ action_file_export_midi

void action_file_export_midi ( )
slot

◆ action_file_export_pattern_as

void action_file_export_pattern_as ( )
slot

◆ action_file_new

void action_file_new ( )
slot

Project > New handling function.

Creates an empty Song and set it as the current one.

When Hydrogen is under session management (NSM) this function will assume that there is already a Song present (which is the case). Else it will return without doing anything. It uses the current Song to assign the it file path to the empty one since the name provided by the NSM server must be used or the restart of the session fails.

◆ action_file_open

void action_file_open ( )
slot

Project > Open / Import into Session handling function.

Opens an existing Song.

When Hydrogen is under session management (NSM) this function will assume that there is already a Song present (which is the case). Else it will return without doing anything. It opens the chosen file and uses the current Song to assign its file path to the opened one since the name provided by the NSM server must be used or the restart of the session fails.

◆ action_file_open_recent

void action_file_open_recent ( QAction *  pAction)
slot

◆ action_file_openDemo

void action_file_openDemo ( )
slot
Todo:
parametrizzare il metodo action_file_open ed eliminare il seguente...

◆ action_file_openPattern

void action_file_openPattern ( )
slot

◆ action_file_save

void action_file_save ( )
slot

◆ action_file_save_as

void action_file_save_as ( )
slot

Project > Save As / Export from Session handling function.

Saves the current Song in a different path.

When Hydrogen is under session management (NSM) this function will store the Song in the chosen location but keeps its previous file path associated with it since the name provided by the NSM server must be used or the restart of the session fails.

◆ action_file_songProperties

void action_file_songProperties ( )
slot

◆ action_help_about

void action_help_about ( )
slot

◆ action_inputMode_drumkit

void action_inputMode_drumkit ( )
slot

◆ action_inputMode_instrument

void action_inputMode_instrument ( )
slot

◆ action_instruments_addComponent

void action_instruments_addComponent ( )
slot

◆ action_instruments_addInstrument

void action_instruments_addInstrument ( )
slot

◆ action_instruments_clearAll

void action_instruments_clearAll ( )
slot

◆ action_instruments_exportLibrary

void action_instruments_exportLibrary ( )
slot

◆ action_instruments_importLibrary

void action_instruments_importLibrary ( )
slot

◆ action_instruments_onlineImportLibrary

void action_instruments_onlineImportLibrary ( )
slot

◆ action_instruments_saveAsLibrary

void action_instruments_saveAsLibrary ( )
slot

◆ action_instruments_saveLibrary

void action_instruments_saveLibrary ( )
slot

◆ action_redo

void action_redo ( )
slot

◆ action_report_bug

void action_report_bug ( )
slot

◆ action_undo

void action_undo ( )
slot

◆ action_window_show_DirectorWidget

void action_window_show_DirectorWidget ( )
slot

◆ action_window_showAutomationArea

void action_window_showAutomationArea ( )
slot

◆ action_window_showInstrumentRack

void action_window_showInstrumentRack ( )
slot

◆ action_window_showMixer

void action_window_showMixer ( )
slot

◆ action_window_showPatternEditor

void action_window_showPatternEditor ( )
slot

◆ action_window_showPlaybackTrack

void action_window_showPlaybackTrack ( )
slot

◆ action_window_showPlaylistDialog

void action_window_showPlaylistDialog ( )
slot

◆ action_window_showSongEditor

void action_window_showSongEditor ( )
slot

Shows the song editor.

◆ action_window_showTimeline

void action_window_showTimeline ( )
slot

◆ action_window_toggleFullscreen

void action_window_toggleFullscreen ( )
slot

◆ checkMidiSetup

void checkMidiSetup ( )
slot

◆ checkMissingSamples

void checkMissingSamples ( )
slot

◆ checkNecessaryDirectories()

void checkNecessaryDirectories ( )
private

◆ closeAll

void closeAll ( )
slot

Wrapper around savePreferences() and quit() method of m_pQApp.

◆ closeEvent

void closeEvent ( QCloseEvent *  ev)
overrideslot

Window close event.

◆ createMenuBar()

void createMenuBar ( )
private

Create the menubar.

◆ errorEvent()

void errorEvent ( int  nErrorCode)
overridevirtual

Reimplemented from EventListener.

◆ eventFilter()

bool eventFilter ( QObject *  o,
QEvent *  e 
)
overrideprivate

◆ functionDeleteInstrument()

void functionDeleteInstrument ( int  instrument)
private

◆ getAutoSaveFilename()

QString getAutoSaveFilename ( )
private

◆ handleSelectNextPrevSongOnPlaylist()

bool handleSelectNextPrevSongOnPlaylist ( int  step)
private

◆ handleSigUsr1

void handleSigUsr1 ( )
slot

◆ handleUnsavedChanges()

bool handleUnsavedChanges ( )
protected

◆ initKeyInstMap()

void initKeyInstMap ( )
private

◆ jacksessionEvent()

void jacksessionEvent ( int  nValue)
overridevirtual

Reimplemented from EventListener.

◆ onAutoSaveTimer

void onAutoSaveTimer ( )
privateslot

◆ onBPMMinusAccelEvent

void onBPMMinusAccelEvent ( )
slot

◆ onBPMPlusAccelEvent

void onBPMPlusAccelEvent ( )
slot

◆ onFixMidiSetup

void onFixMidiSetup ( )
privateslot

◆ onFixMissingSamples

void onFixMissingSamples ( )
privateslot

◆ onLashPollTimer

void onLashPollTimer ( )
slot

◆ onOpenAccelEvent

void onOpenAccelEvent ( )
slot

◆ onPlaylistDisplayTimer

void onPlaylistDisplayTimer ( )
privateslot

◆ onPlayStopAccelEvent

void onPlayStopAccelEvent ( )
slot

◆ onRestartAccelEvent

void onRestartAccelEvent ( )
slot

◆ onSaveAccelEvent

void onSaveAccelEvent ( )
slot

◆ onSaveAsAccelEvent

void onSaveAsAccelEvent ( )
slot

◆ openUndoStack

void openUndoStack ( )
slot

◆ playlistLoadSongEvent()

void playlistLoadSongEvent ( int  nIndex)
overridevirtual

Reimplemented from EventListener.

◆ savePreferences

void savePreferences ( )
slot

Stores the current state of the GUI (position, width, height, and visibility of the widgets) in the H2Core::Preferences.

◆ setMainWindowSize

void setMainWindowSize ( int  w,
int  h 
)
inlineslot

◆ showDevelWarning

void showDevelWarning ( )
slot

◆ showPreferencesDialog

void showPreferencesDialog ( )
slot

◆ showUserManual

void showUserManual ( )
slot

◆ startPlaybackAtCursor()

void startPlaybackAtCursor ( QObject *  pObject)
private

Relocates to current position of the cursor and starts playback if the transport isn't rolling yet.

If triggered while focusing the song editor, the song will be set to H2Core::Song::SONE_MODE. Similarly, H2Core::Song::PATTERN_MODE will be activated if triggered in the pattern editor of note properties ruler.

Parameters
pObjectUsed to determine the focused part of the application.

◆ undoRedoActionEvent()

void undoRedoActionEvent ( int  nEvent)
overridevirtual

Reimplemented from EventListener.

◆ update_automation_checkbox

void update_automation_checkbox ( )
slot

◆ update_director_checkbox

void update_director_checkbox ( )
slot

◆ update_instrument_checkbox

void update_instrument_checkbox ( bool  show)
slot

◆ update_mixer_checkbox

void update_mixer_checkbox ( )
slot

◆ update_playback_track_group

void update_playback_track_group ( )
slot

◆ update_playlist_checkbox

void update_playlist_checkbox ( )
slot

◆ updatePreferencesEvent()

void updatePreferencesEvent ( int  nValue)
overridevirtual

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

If nValue is 0 - the H2Core::Preferences should be saved

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

Reimplemented from EventListener.

◆ updateRecentUsedSongList()

void updateRecentUsedSongList ( )

◆ usr1SignalHandler()

void usr1SignalHandler ( int  unused)
static

Field Documentation

◆ h2app

HydrogenApp* h2app
private

◆ keycodeInstrumentMap

std::map<int,int> keycodeInstrumentMap
private

◆ m_AutosaveTimer

QTimer m_AutosaveTimer
private

debug only

◆ m_pDrumkitAction

QAction* m_pDrumkitAction
private

◆ m_pInputModeMenu

QMenu* m_pInputModeMenu
private

◆ m_pInstrumentAction

QAction* m_pInstrumentAction
private

◆ m_pLogLevelMenu

QMenu* m_pLogLevelMenu
private

◆ m_pMidiSetupInfoBar

InfoBar* m_pMidiSetupInfoBar
private

◆ m_pMissingSamplesInfoBar

InfoBar* m_pMissingSamplesInfoBar
private

◆ m_pQApp

QApplication* m_pQApp

◆ m_pRecentFileAction0

QAction* m_pRecentFileAction0
private

◆ m_pRecentFileAction1

QAction* m_pRecentFileAction1
private

◆ m_pRecentFileAction2

QAction* m_pRecentFileAction2
private

◆ m_pRecentFileAction3

QAction* m_pRecentFileAction3
private

◆ m_pRecentFileAction4

QAction* m_pRecentFileAction4
private

◆ m_pRecentFilesMenu

QMenu* m_pRecentFilesMenu
private

◆ m_pUndoView

QUndoView* m_pUndoView
private

◆ m_pViewAutomationPathAction

QAction* m_pViewAutomationPathAction
private

◆ m_pViewDirectorAction

QAction* m_pViewDirectorAction
private

◆ m_pViewMixerAction

QAction* m_pViewMixerAction
private

◆ m_pViewMixerInstrumentRackAction

QAction* m_pViewMixerInstrumentRackAction
private

◆ m_pViewPlaybackTrackAction

QAction* m_pViewPlaybackTrackAction
private

◆ m_pViewPlaybackTrackActionGroup

QActionGroup* m_pViewPlaybackTrackActionGroup
private

◆ m_pViewPlaylistEditorAction

QAction* m_pViewPlaylistEditorAction
private

◆ m_pViewTimelineAction

QAction* m_pViewTimelineAction
private

◆ sigusr1Fd

int sigusr1Fd
staticprivate

◆ snUsr1

QSocketNotifier* snUsr1
private