64 m_pTheme = std::make_shared<Theme>();
73 QString rubberBandCLIPath = getenv(
"PATH" );
74 QStringList rubberBandCLIPathList = rubberBandCLIPath.split(
":");
78 for(
int i = 0; i < rubberBandCLIPathList.size(); ++i){
141 sServerList.push_back( QString(
"http://hydrogen-music.org/feeds/drumkit_list.php") );
157#if defined(H2CORE_HAVE_ALSA)
159#elif defined(H2CORE_HAVE_PORTMIDI)
161#elif defined(H2CORE_HAVE_COREMIDI)
163#elif defined(H2CORE_HAVE_JACK)
187#ifdef H2CORE_HAVE_ALSA
191 if ( alsaDevices.size() == 0 ||
192 alsaDevices.contains(
"hw:0" ) ) {
197 if ( alsaDevices[ 0 ] !=
"null" ) {
199 }
else if ( alsaDevices.size() > 1 ) {
273 if ( bGlobalPrefLoaded || bUserPrefLoaded ) {
304 bool bRecreate =
false;
306 QString sPreferencesFilename;
308 if ( sPreferencesOverwritePath.isEmpty() ) {
310 INFOLOG( QString(
"Loading preferences file (%1) [%2]" ).arg( bGlobal ?
"SYS" :
"USER" ).arg( sPreferencesFilename ) );
313 sPreferencesFilename = sPreferencesOverwritePath;
314 INFOLOG( QString(
"Loading preferences file [%1]" ).arg( sPreferencesFilename ) );
319 ERRORLOG( QString(
"Global preferences file [%1] is not readable!" )
320 .arg( sPreferencesFilename ) );
324 WARNINGLOG( QString(
"User-level preferences file [%1] is not readable! It will be recreated." )
325 .arg( sPreferencesFilename ) );
333 doc.
read( sPreferencesFilename,
nullptr,
false );
334 XMLNode rootNode = doc.firstChildElement(
"hydrogen_preferences" );
336 if ( !rootNode.isNull() ) {
356 rootNode.
read_int(
"defaultUILayout",
359 rootNode.
read_int(
"uiScalingPolicy",
375 QString test = rootNode.
read_string(
"path_to_rubberband",
"",
false,
false );
376 if ( QFile( test ).exists() ==
true ){
384 XMLNode recentUsedSongsNode = rootNode.firstChildElement(
"recentUsedSongs" );
385 if ( ! recentUsedSongsNode.isNull() ) {
386 QDomElement songElement = recentUsedSongsNode.firstChildElement(
"song" );
387 while( !songElement.isNull() && ! songElement.text().isEmpty() ){
389 songElement = songElement.nextSiblingElement(
"song" );
393 WARNINGLOG(
"recentUsedSongs node not found" );
396 XMLNode recentFXNode = rootNode.firstChildElement(
"recentlyUsedEffects" );
397 if ( ! recentFXNode.isNull() ) {
398 QDomElement fxElement = recentFXNode.firstChildElement(
"FX" );
399 while ( !fxElement.isNull() && ! fxElement.text().isEmpty()) {
401 fxElement = fxElement.nextSiblingElement(
"FX" );
404 WARNINGLOG(
"recentlyUsedEffects node not found" );
408 XMLNode serverListNode = rootNode.firstChildElement(
"serverList" );
409 if ( ! serverListNode.isNull() ) {
410 QDomElement serverElement = serverListNode.firstChildElement(
"server" );
411 while ( !serverElement.isNull() && !serverElement.text().isEmpty() ) {
413 serverElement = serverElement.nextSiblingElement(
"server" );
420 XMLNode patternCategoriesNode = rootNode.firstChildElement(
"patternCategories" );
421 if ( ! patternCategoriesNode.isNull() ) {
422 QDomElement patternCategoriesElement = patternCategoriesNode.firstChildElement(
"categories" );
423 while ( !patternCategoriesElement.isNull() && !patternCategoriesElement.text().isEmpty() ) {
425 patternCategoriesElement = patternCategoriesElement.nextSiblingElement(
"categories" );
428 WARNINGLOG(
"patternCategories node not found" );
433 XMLNode audioEngineNode = rootNode.firstChildElement(
"audio_engine" );
434 if ( audioEngineNode.isNull() ) {
457 XMLNode ossDriverNode = audioEngineNode.firstChildElement(
"oss_driver" );
458 if ( ossDriverNode.isNull() ) {
466 XMLNode portAudioDriverNode = audioEngineNode.firstChildElement(
"portaudio_driver" );
467 if ( portAudioDriverNode.isNull() ) {
468 WARNINGLOG(
"portaudio_driver node not found" );
477 XMLNode coreAudioDriverNode = audioEngineNode.firstChildElement(
"coreaudio_driver" );
478 if ( coreAudioDriverNode.isNull() ) {
479 WARNINGLOG(
"coreaudio_driver node not found" );
486 XMLNode jackDriverNode = audioEngineNode.firstChildElement(
"jack_driver" );
487 if ( jackDriverNode.isNull() ) {
493 QString sMode = jackDriverNode.
read_string(
"jack_transport_mode",
"NO_JACK_TRANSPORT",
false,
false );
494 if ( sMode ==
"NO_JACK_TRANSPORT" ) {
496 }
else if ( sMode ==
"USE_JACK_TRANSPORT" ) {
502 QString tmMode = jackDriverNode.
read_string(
"jack_transport_mode_master",
"NO_JACK_TIME_MASTER",
false,
false );
503 if ( tmMode ==
"NO_JACK_TIME_MASTER" ) {
505 }
else if ( tmMode ==
"USE_JACK_TIME_MASTER" ) {
509 int nBBTSync = jackDriverNode.
read_int(
"jack_bbt_sync", 0,
false,
false );
510 if ( nBBTSync == 0 ){
512 }
else if ( nBBTSync == 1 ) {
515 WARNINGLOG( QString(
"Unknown jack_bbt_sync value [%1]. Using JackBBTSyncMethod::constMeasure instead." )
524 int nJackTrackOutputMode = jackDriverNode.
read_int(
"jack_track_output_mode", 0,
false,
false );
525 switch ( nJackTrackOutputMode ) {
533 WARNINGLOG( QString(
"Unknown jack_track_output_mode value [%1]. Using JackTrackOutputMode::postFader instead." )
534 .arg( nJackTrackOutputMode ) );
541 XMLNode alsaAudioDriverNode = audioEngineNode.firstChildElement(
"alsa_audio_driver" );
542 if ( alsaAudioDriverNode.isNull() ) {
543 WARNINGLOG(
"alsa_audio_driver node not found" );
550 XMLNode midiDriverNode = audioEngineNode.firstChildElement(
"midi_driver" );
551 if ( midiDriverNode.isNull() ) {
577 XMLNode oscServerNode = audioEngineNode.firstChildElement(
"osc_configuration" );
578 if ( oscServerNode.isNull() ) {
579 WARNINGLOG(
"osc_configuration node not found" );
589 XMLNode guiNode = rootNode.firstChildElement(
"gui" );
590 if ( guiNode.isNull() ) {
667 guiNode.
read_bool(
"showExportSongLicenseWarning",
true,
671 guiNode.
read_bool(
"showExportDrumkitLicenseWarning",
true,
674 guiNode.
read_bool(
"showExportDrumkitCopyleftWarning",
true,
677 guiNode.
read_bool(
"showExportDrumkitAttributionWarning",
true,
686 QString bcMode = guiNode.
read_string(
"bc",
"BC_OFF",
false,
false );
687 if ( bcMode ==
"BC_OFF" ) {
689 }
else if ( bcMode ==
"BC_ON" ) {
694 QString setPlay = guiNode.
read_string(
"setplay",
"SET_PLAY_OFF",
false,
false );
695 if ( setPlay ==
"SET_PLAY_OFF" ) {
697 }
else if ( setPlay ==
"SET_PLAY_ON" ) {
712 for (
unsigned nFX = 0; nFX <
MAX_FX; nFX++ ) {
713 QString sNodeName = QString(
"ladspaFX_properties%1").arg( nFX );
717 XMLNode pColorThemeNode = guiNode.firstChildElement(
"colorTheme" );
718 if ( !pColorThemeNode.isNull() ) {
727 guiNode.
read_int(
"SongEditor_ColoringMethod",
731 colors[ ii ] = guiNode.
read_color( QString(
"SongEditor_pattern_color_%1" ).arg( ii ),
732 m_pTheme->getColorTheme()->m_accentColor,
false, false );
744 XMLNode filesNode = rootNode.firstChildElement(
"files" );
745 if ( filesNode.isNull() ) {
759 XMLNode pMidiEventMapNode = rootNode.firstChildElement(
"midiEventMap" );
760 if ( !pMidiEventMapNode.isNull() ) {
761 XMLNode pMidiEventNode = pMidiEventMapNode.firstChildElement(
"midiEvent" );
762 while ( !pMidiEventNode.isNull() ) {
763 if( pMidiEventNode.firstChildElement().nodeName() == QString(
"mmcEvent")){
764 QString
event = pMidiEventNode.firstChildElement(
"mmcEvent").text();
765 QString sAction = pMidiEventNode.firstChildElement(
"action").text();
766 QString sParam = pMidiEventNode.firstChildElement(
"parameter").text();
767 QString sParam2 = pMidiEventNode.firstChildElement(
"parameter2").text();
768 QString sParam3 = pMidiEventNode.firstChildElement(
"parameter3").text();
770 std::shared_ptr<Action> pAction = std::make_shared<Action>( sAction );
771 pAction->setParameter1( sParam );
772 pAction->setParameter2( sParam2 );
773 pAction->setParameter3( sParam3 );
777 if( pMidiEventNode.firstChildElement().nodeName() == QString(
"noteEvent")){
778 QString
event = pMidiEventNode.firstChildElement(
"noteEvent").text();
779 QString sAction = pMidiEventNode.firstChildElement(
"action").text();
780 QString sParam = pMidiEventNode.firstChildElement(
"parameter").text();
781 QString sParam2 = pMidiEventNode.firstChildElement(
"parameter2").text();
782 QString sParam3 = pMidiEventNode.firstChildElement(
"parameter3").text();
783 QString s_eventParameter = pMidiEventNode.firstChildElement(
"eventParameter").text();
784 std::shared_ptr<Action> pAction = std::make_shared<Action>( sAction );
785 pAction->setParameter1( sParam );
786 pAction->setParameter2( sParam2 );
787 pAction->setParameter3( sParam3 );
791 if( pMidiEventNode.firstChildElement().nodeName() == QString(
"ccEvent") ){
792 QString
event = pMidiEventNode.firstChildElement(
"ccEvent").text();
793 QString sAction = pMidiEventNode.firstChildElement(
"action").text();
794 QString sParam = pMidiEventNode.firstChildElement(
"parameter").text();
795 QString sParam2 = pMidiEventNode.firstChildElement(
"parameter2").text();
796 QString sParam3 = pMidiEventNode.firstChildElement(
"parameter3").text();
797 QString s_eventParameter = pMidiEventNode.firstChildElement(
"eventParameter").text();
798 std::shared_ptr<Action> pAction = std::make_shared<Action>( sAction );
799 pAction->setParameter1( sParam );
800 pAction->setParameter2( sParam2 );
801 pAction->setParameter3( sParam3 );
805 if( pMidiEventNode.firstChildElement().nodeName() == QString(
"pcEvent") ){
806 QString
event = pMidiEventNode.firstChildElement(
"pcEvent").text();
807 QString sAction = pMidiEventNode.firstChildElement(
"action").text();
808 QString sParam = pMidiEventNode.firstChildElement(
"parameter").text();
809 QString sParam2 = pMidiEventNode.firstChildElement(
"parameter2").text();
810 QString sParam3 = pMidiEventNode.firstChildElement(
"parameter3").text();
811 std::shared_ptr<Action> pAction = std::make_shared<Action>( sAction );
812 pAction->setParameter1( sParam );
813 pAction->setParameter2( sParam2 );
814 pAction->setParameter3( sParam3 );
818 pMidiEventNode = pMidiEventNode.nextSiblingElement(
"midiEvent" );
826 WARNINGLOG(
"hydrogen_preferences node not found" );
836 if ( bRecreate && ! bGlobal ) {
837 WARNINGLOG(
"Recreating configuration file." );
852 QString sPreferencesFilename;
854 if ( sPreferencesOverwritePath.isEmpty() ) {
857 sPreferencesFilename = sPreferencesOverwritePath;
860 INFOLOG( QString(
"Saving preferences file %1" ).arg( sPreferencesFilename ) );
916 for (
unsigned i = 0; i < nSongs; i++ ) {
927 if ( ++nFX > 10 )
break;
932 std::list<QString>::const_iterator cur_Server;
936 serverListNode.
write_string( QString(
"server") , QString( *cur_Server ) );
940 std::list<QString>::const_iterator cur_patternCategories;
944 patternCategoriesNode.
write_string( QString(
"categories") , QString( *cur_patternCategories ) );
989 sMode =
"NO_JACK_TRANSPORT";
991 sMode =
"USE_JACK_TRANSPORT";
993 jackDriverNode.
write_string(
"jack_transport_mode", sMode );
999 tmMode =
"NO_JACK_TIME_MASTER";
1001 tmMode =
"USE_JACK_TIME_MASTER";
1003 jackDriverNode.
write_string(
"jack_transport_mode_master", tmMode );
1011 jackDriverNode.
write_int(
"jack_bbt_sync", nBBTSync );
1018 int nJackTrackOutputMode;
1020 nJackTrackOutputMode = 0;
1022 nJackTrackOutputMode = 1;
1024 jackDriverNode.
write_int(
"jack_track_output_mode", nJackTrackOutputMode );
1031 XMLNode alsaAudioDriverNode = audioEngineNode.
createNode(
"alsa_audio_driver" );
1088 for (
unsigned nFX = 0; nFX <
MAX_FX; nFX++ ) {
1089 QString sNode = QString(
"ladspaFX_properties%1").arg( nFX );
1138 setPlay =
"SET_PLAY_OFF";
1140 setPlay =
"SET_PLAY_ON";
1185 if ( ppAction !=
nullptr && ! ppAction->isNull() ){
1189 midiEventNode.
write_string(
"action" , ppAction->getType());
1190 midiEventNode.
write_string(
"parameter" , ppAction->getParameter1() );
1191 midiEventNode.
write_string(
"parameter2" , ppAction->getParameter2() );
1192 midiEventNode.
write_string(
"parameter3" , ppAction->getParameter3() );
1197 if ( ppAction !=
nullptr && ! ppAction->isNull() ){
1202 midiEventNode.
write_int(
"eventParameter" , nnPitch );
1203 midiEventNode.
write_string(
"action" , ppAction->getType() );
1204 midiEventNode.
write_string(
"parameter" , ppAction->getParameter1() );
1205 midiEventNode.
write_string(
"parameter2" , ppAction->getParameter2() );
1206 midiEventNode.
write_string(
"parameter3" , ppAction->getParameter3() );
1211 if ( ppAction !=
nullptr && ! ppAction->isNull() ){
1216 midiEventNode.
write_int(
"eventParameter" , nnParam );
1217 midiEventNode.
write_string(
"action" , ppAction->getType() );
1218 midiEventNode.
write_string(
"parameter" , ppAction->getParameter1() );
1219 midiEventNode.
write_string(
"parameter2" , ppAction->getParameter2() );
1220 midiEventNode.
write_string(
"parameter3" , ppAction->getParameter3() );
1225 if ( ppAction !=
nullptr && ! ppAction->isNull() ){
1230 midiEventNode.
write_string(
"action" , ppAction->getType() );
1231 midiEventNode.
write_string(
"parameter" , ppAction->getParameter1() );
1232 midiEventNode.
write_string(
"parameter2" , ppAction->getParameter2() );
1233 midiEventNode.
write_string(
"parameter3" , ppAction->getParameter3() );
1237 return doc.
write( sPreferencesFilename );
1256 XMLNode windowPropNode = parent.firstChildElement( windowName );
1257 if ( windowPropNode.isNull() ) {
1258 WARNINGLOG(
"Error reading configuration file: " + windowName +
" node not found" );
1261 prop.
x = windowPropNode.
read_int(
"x", prop.
x,
false,
false );
1262 prop.
y = windowPropNode.
read_int(
"y", prop.
y,
false,
false );
1307 height(other.height),
1308 visible(other.visible)
static QStringList getDevices()
Use the name hints to build a list of potential device names.
static QString scripts_dir()
returns user scripts path
static bool file_executable(const QString &path, bool silent=false)
returns true if the given path is an existing executable regular file
static QString usr_config_path()
returns user config path
static QString songs_dir()
returns user songs path
static QString playlists_dir()
returns user playlist path
static const QString & getPreferencesOverwritePath()
static QString sys_config_path()
returns system config path
static bool file_readable(const QString &path, bool silent=false)
returns true if the given path is an existing readable regular file
static QString patterns_dir()
returns user patterns path
FontSize
Enables custom scaling of the font size in the GUI.
static float FALLOFF_NORMAL
static QString EventToQString(Event event)
float getMixerFalloffSpeed()
WindowProperties audioEngineInfoProperties
void writeWindowProperties(XMLNode parent, const QString &windowName, const WindowProperties &prop)
Write the xml nodes related to window properties.
bool m_bShowAutomationArea
QString m_sPortAudioDevice
QString m_sLastExportPatternAsDirectory
bool m_bShowExportDrumkitAttributionWarning
bool m_bShowInstrumentPeaks
WindowProperties m_playlistDialogProperties
QString m_sDefaultEditor
Default text editor (used by Playlisteditor)
void setPatternColors(std::vector< QColor > patternColors)
bool __useTimelineBpm
Whether to use local speeds specified along the Timeline or a constant tempo for the whole Song in Hy...
JackTrackOutputMode m_JackTrackOutputMode
Specifies which audio settings will be applied to the sample supplied in the JACK per track output po...
bool m_bUseRelativeFilenamesForPlaylists
void setLadspaProperties(unsigned nFX, const WindowProperties &prop)
WindowProperties songEditorProperties
bool __playselectedinstrument
void setMixerProperties(const WindowProperties &prop)
void setPatternEditorProperties(const WindowProperties &prop)
bool m_bOscFeedbackEnabled
Whether to send the current state of Hydrogen to the OSC clients.
void setQTStyle(const QString &sStyle)
const QString & getApplicationFontFamily() const
void setMostRecentFX(QString)
void setSongEditorProperties(const WindowProperties &prop)
std::vector< QString > m_recentFiles
const QString & getQTStyle()
int m_bJackMasterMode
Specifies if Hydrogen should run as JACK time master.
WindowProperties mixerProperties
unsigned m_nPatternEditorGridWidth
QString m_sAudioDriver
Audio driver.
unsigned m_nSampleRate
Sample rate of the audio.
bool m_bShowNoteOverwriteWarning
Last song used.
WindowProperties instrumentRackProperties
QString m_sPortAudioHostAPI
bool savePreferences()
Save the preferences file.
bool m_bPatternEditorUsingTriplets
bool m_bEnableMidiFeedback
void setVisiblePatternColors(int nValue)
void setColoringMethod(InterfaceTheme::ColoringMethod coloringMethod)
const QString & getLevel3FontFamily() const
void setInstrumentRackProperties(const WindowProperties &prop)
InterfaceTheme::Layout getDefaultUILayout()
bool m_bOscServerEnabled
Whether to start the OscServer thread.
QString m_sMidiOutputPortName
unsigned m_nSongEditorGridHeight
void setApplicationFontFamily(const QString &family)
QString m_sLastImportDrumkitDirectory
QString m_sLastExportSongDirectory
QString m_sLastOpenPatternDirectory
static void create_instance()
If __instance equals 0, a new Preferences singleton will be created and stored in it.
int m_nMaxLayers
Maximum number of layers to be used in the Instrument editor.
unsigned m_nPatternEditorGridHeight
int getMaxPatternColors() const
WindowProperties m_directorProperties
void setLevel3FontFamily(const QString &family)
void setDirectorProperties(const WindowProperties &prop)
void setPlaylistDialogProperties(const WindowProperties &prop)
QString m_sMidiDriver
MIDI driver.
QString m_lastSongFilename
unsigned m_nSongEditorGridWidth
int m_nExportSampleRateIdx
bool m_bShowExportDrumkitCopyleftWarning
QString m_lastPlaylistFilename
QString m_sLastExportThemeDirectory
bool m_bLoadingSuccessful
void setMainFormProperties(const WindowProperties &prop)
void setAudioEngineInfoProperties(const WindowProperties &prop)
std::list< QString > sServerList
@ postFader
Applies layer, component, and instrument gain, note and instrument pan, note velocity,...
@ preFader
Only layer gain and note velocity will be applied to the samples.
bool loadPreferences(bool bGlobal)
Load the preferences file.
int m_nPatternEditorGridResolution
QString m_sLastExportDrumkitDirectory
QString m_sLastExportMidiDirectory
QString m_sLastImportThemeDirectory
std::list< QString > m_patternCategories
FontTheme::FontSize getFontSize() const
bool m_bJackConnectDefaults
Toggles auto-connecting of the main stereo output ports to the system's default ports when starting t...
unsigned m_nMaxNotes
max notes
bool readPrefFileforotherplaces
bool m_bUseLash
Show development version warning?
QString m_sAlsaAudioDevice
void setFontSize(FontTheme::FontSize fontSize)
QString m_sCoreAudioDevice
bool __playsamplesonclicking
InterfaceTheme::ColoringMethod getColoringMethod() const
bool m_bMidiDiscardNoteAfterAction
bool m_useTheRubberbandBpmChangeEvent
rubberband bpm change queue
bool m_bUseMetronome
If set to true, samples of the metronome will be added to H2Core::AudioEngine::m_songNoteQueue and th...
QString m_sLastOpenLayerDirectory
WindowProperties mainFormProperties
QString m_sOSSDevice
Device used for output.
InterfaceTheme::ScalingPolicy getUIScalingPolicy()
bool m_bMidiNoteOffIgnore
std::vector< QColor > getPatternColors() const
QString m_sLastSaveSongAsDirectory
bool m_brestoreLastPlaylist
QString m_rubberBandCLIexecutable
Rubberband CLI.
QString m_sLastAddSongToPlaylistDirectory
JackBBTSyncMethod m_JackBBTSync
Since Hydrogen uses both fixed pattern lengths and recalculates the tick size each time it encounters...
int m_nExportSampleDepthIdx
WindowProperties patternEditorProperties
bool m_bJackTimebaseEnabled
External applications with a faulty JACK timebase master implementation can mess up the transport wit...
void setDefaultUILayout(InterfaceTheme::Layout layout)
@ constMeasure
The measure - could be any - does not change during the song.
@ identicalBars
The length of each pattern must match the measure of the corresponding bar in the timebase master.
const QString & getLevel2FontFamily() const
int m_nMaxBars
Maximum number of bars shown in the Song Editor at once.
QString m_sLastPlaylistScriptDirectory
bool m_bShowExportSongLicenseWarning
@ NO_JACK_TRANSPORT
Specifies whether or not to use JACK transport capabilities.
@ USE_JACK_TIME_MASTER
Specifies that Hydrogen is using in the time master mode and will thus control specific aspects of th...
@ NO_JACK_TIME_MASTER
Specifies that Hydrogen is note using in the time master mode.
@ USE_JACK_TRANSPORT
Specifies whether or not to use JACK transport capabilities.
int getVisiblePatternColors() const
float m_fMetronomeVolume
Metronome volume FIXME: remove this volume!!
QString m_sLastExportLilypondDirectory
void setMixerFalloffSpeed(float value)
int m_nOscTemporaryPort
In case m_nOscServerPort is already occupied by another client, the alternative - random - port numbe...
WindowProperties readWindowProperties(XMLNode parent, const QString &windowName, WindowProperties defaultProp)
Read the xml nodes related to window properties.
bool m_bShowExportDrumkitLicenseWarning
static QString getNullMidiPort()
Choice of m_sMidiPortName and m_sMidiOutputPortName in case no port/device was selected.
static Preferences * __instance
Object holding the current Preferences singleton.
int m_nOscServerPort
Port number the OscServer will be started at.
bool m_bJackTrackOuts
If set to true, JackAudioDriver::makeTrackOutputs() will create two individual left and right output ...
void setLevel2FontFamily(const QString &family)
int m_bJackTransportMode
Specifies whether or not Hydrogen will use the JACK transport system.
QString m_sPreferredLanguage
QString m_sLastOpenSongDirectory
bool m_bShowPlaybackTrack
std::shared_ptr< Theme > m_pTheme
unsigned m_nBufferSize
Buffer size of the audio.
QString m_sLastPlaylistDirectory
void setUIScalingPolicy(InterfaceTheme::ScalingPolicy policy)
bool m_bHideKeyboardCursor
QString m_sLastOpenPlaybackTrackDirectory
WindowProperties m_ladspaProperties[MAX_FX]
static void readColorTheme(XMLNode parent, std::shared_ptr< Theme > pTheme)
static void writeColorTheme(XMLNode *parent, std::shared_ptr< Theme > pTheme)
void set(int _x, int _y, int _width, int _height, bool _visible, QByteArray geometry=QByteArray())
XMLDoc is a subclass of QDomDocument with read and write methods.
XMLNode set_root(const QString &node_name, const QString &xmlns=nullptr)
create the xml header and root node
bool read(const QString &filepath, const QString &schemapath=nullptr, bool bSilent=false)
read the content of an xml file
bool write(const QString &filepath)
write itself into a file
XMLNode is a subclass of QDomNode with read and write values methods.
int read_int(const QString &node, int default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false)
reads an integer stored into a child node
bool read_bool(const QString &node, bool default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false)
reads a boolean stored into a child node
QColor read_color(const QString &node, const QColor &defaultValue=QColor(97, 167, 251), bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false)
QString read_string(const QString &node, const QString &default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false)
reads a string stored into a child node
float read_float(const QString &node, float default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false)
reads a float stored into a child node
void write_color(const QString &node, const QColor &color)
void write_float(const QString &node, const float value)
write a float into a child node
XMLNode createNode(const QString &name)
create a new XMLNode that has to be appended into de XMLDoc
void write_string(const QString &node, const QString &value)
write a string into a child node
void write_bool(const QString &node, const bool value)
write a boolean into a child node
void write_int(const QString &node, const int value)
write an integer into a child node
The MidiMap maps MidiActions to MidiEvents.
void registerMMCEvent(QString, std::shared_ptr< Action >)
Sets up the relation between a mmc event and an action.
void registerNoteEvent(int, std::shared_ptr< Action >)
Sets up the relation between a note event and an action.
std::multimap< int, std::shared_ptr< Action > > getCCActionMap() const
void registerPCEvent(std::shared_ptr< Action >)
Sets up the relation between a program change and an action.
std::vector< std::shared_ptr< Action > > getPCActions() const
Returns the pc action which was linked to the given event.
std::multimap< QString, std::shared_ptr< Action > > getMMCActionMap() const
static void create_instance()
If __instance equals 0, a new MidiMap singleton will be created and stored in it.
std::multimap< int, std::shared_ptr< Action > > getNoteActionMap() const
static MidiMap * get_instance()
Returns a pointer to the current MidiMap singleton stored in __instance.
static void reset_instance()
Convenience function calling reset() on the current MidiMap __instance.
void registerCCEvent(int, std::shared_ptr< Action >)
Sets up the relation between a cc event and an action.
#define MAX_FX
Maximum number of effects.
std::string get_version()
Returns the current Hydrogen version string.
static const std::string version