hydrogen 1.2.3
Preferences.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#ifndef PREFERENCES_H
24#define PREFERENCES_H
25
26#include <list>
27#include <vector>
28#include <cassert>
29#include <memory>
30
31#include "Theme.h"
32#include <core/MidiAction.h>
33#include <core/Globals.h>
34#include <core/Object.h>
35
36#include <QStringList>
37#include <QDomDocument>
38#include <QColor>
39
40namespace H2Core
41{
42
43
48class WindowProperties : public H2Core::Object<WindowProperties>
49{
51public:
52 int x;
53 int y;
54 int width;
55 int height;
56 bool visible;
58
62
63 void set(int _x, int _y, int _width, int _height, bool _visible, QByteArray geometry = QByteArray() ) {
64 x = _x; y = _y;
68 }
69
70};
71
77class Preferences : public H2Core::Object<Preferences>
78{
80public:
81 enum {
98 BC_ON = 0,
113 BC_OFF = 1
114 };
115
118 enum Changes {
119 None = 0x000,
121 Font = 0x001,
123 Colors = 0x002,
129 GeneralTab = 0x008,
131 AudioTab = 0x010,
133 MidiTab = 0x020,
135 OscTab = 0x040
136 };
137
138 bool __playsamplesonclicking; // audio file browser
139
140 bool __playselectedinstrument; // midi keys and keys play instrument or drumset
141
143
144 // switch to enable / disable lash, only on h2 startup
147
148 //soundlibrarypanel expand song and pattern item
151
152 //beatcounter
153 bool m_bbc;
155
158 // ~ beatcounter
159
160 std::list<QString> sServerList;
161 std::list<QString> m_patternCategories;
162
163 // audio engine properties ___
189 unsigned m_nMaxNotes;
204
205 // OSS driver properties ___
206 QString m_sOSSDevice;
207
208 // MIDI Driver properties
232 static QString getNullMidiPort() {
233 return "None";
234 }
235
241
242 // OSC Server properties
285
286 // alsa audio driver properties ___
288
289 // PortAudio properties
293
294 // CoreAudio properties
296
297 // jack driver properties ___
316
323 postFader = 0,
325 preFader = 1 };
326
330 //jack time master
331
345 enum class JackBBTSyncMethod {
348 constMeasure = 0,
353 identicalBars = 1 };
378 // ~ jack driver properties
379
383
386
393 static void create_instance();
398 static Preferences* get_instance(){ assert(__instance); return __instance; }
399
400 ~Preferences();
401
403 bool loadPreferences( bool bGlobal );
404
406 bool savePreferences();
407
408 const QString& getDataDirectory();
409
410 const QString& getDefaultEditor();
411 void setDefaultEditor( QString editor);
412
415
419 void setIconColor( InterfaceTheme::IconColor iconColor );
420
421 // General
422 const QString& getPreferredLanguage();
423 void setPreferredLanguage( const QString& sLanguage );
424
425 void setRestoreLastSongEnabled( bool restore );
426 void setRestoreLastPlaylistEnabled( bool restore );
427 void setUseRelativeFilenamesForPlaylists( bool value );
428
429 void setShowDevelWarning( bool value );
430 bool getShowDevelWarning();
431
433 void setShowNoteOverwriteWarning( bool bValue );
434
438
439 void setLastSongFilename( const QString& filename );
440 const QString& getLastSongFilename();
441
442 void setLastPlaylistFilename( const QString& filename );
443 const QString& getLastPlaylistFilename();
444
445 void setHearNewNotes( bool value );
446 bool getHearNewNotes();
447
448 void setRecordEvents( bool value );
449 bool getRecordEvents();
450
451 void setPunchInPos ( unsigned pos );
452 int getPunchInPos();
453
454 void setPunchOutPos ( unsigned pos );
455 int getPunchOutPos();
456
457 bool inPunchArea (int pos);
458 void unsetPunchArea ();
459
460 void setQuantizeEvents( bool value );
461 bool getQuantizeEvents();
462
463 std::vector<QString> getRecentFiles() const;
464 void setRecentFiles( const std::vector<QString> recentFiles );
465
466 QStringList getRecentFX();
467 void setMostRecentFX( QString );
468
469
470 // GUI Properties
471 const QString& getQTStyle();
472 void setQTStyle( const QString& sStyle );
473
474 const QString& getApplicationFontFamily() const;
475 void setApplicationFontFamily( const QString& family );
476 const QString& getLevel2FontFamily() const;
477 void setLevel2FontFamily( const QString& family );
478 const QString& getLevel3FontFamily() const;
479 void setLevel3FontFamily( const QString& family );
480
482 void setFontSize( FontTheme::FontSize fontSize );
483
484 float getMixerFalloffSpeed();
485 void setMixerFalloffSpeed( float value );
486 bool showInstrumentPeaks();
487 void setInstrumentPeaks( bool value );
488
490 void setPatternEditorGridResolution( int value );
491
493 void setPatternEditorUsingTriplets( bool value );
494
495 bool isFXTabVisible();
496 void setFXTabVisible( bool value );
497
499 void setShowAutomationArea( bool value );
500
502 void setPatternEditorGridHeight( unsigned value );
503
504 unsigned getPatternEditorGridWidth();
505 void setPatternEditorGridWidth( unsigned value );
506
507 unsigned getSongEditorGridHeight();
508 void setSongEditorGridHeight( unsigned value );
509
510 unsigned getSongEditorGridWidth();
511 void setSongEditorGridWidth( unsigned value );
512
515
516 void setPatternColors( std::vector<QColor> patternColors );
517 std::vector<QColor> getPatternColors() const;
518 void setMaxPatternColors( int nValue );
519 int getMaxPatternColors() const;
520 void setVisiblePatternColors( int nValue );
521 int getVisiblePatternColors() const;
522
524 void setMainFormProperties( const WindowProperties& prop );
525
527 void setMixerProperties( const WindowProperties& prop );
528
531
533 void setSongEditorProperties( const WindowProperties& prop );
534
537
540
542 void setLadspaProperties( unsigned nFX, const WindowProperties& prop );
543
546
548 void setDirectorProperties( const WindowProperties& prop );
549
550 const std::shared_ptr<ColorTheme> getColorTheme() const;
551 void setColorTheme( const std::shared_ptr<ColorTheme> pNewColorTheme );
552
553 bool useLash();
554 void setUseLash( bool b );
555
556 bool hideKeyboardCursor();
557 void setHideKeyboardCursor( bool b );
558
560 void setMaxBars( const int bars );
562 int getMaxBars() const;
563
565 void setMaxLayers( const int layers );
567 int getMaxLayers() const;
568
569 void setWaitForSessionHandler(bool value);
571
572#if defined(H2CORE_HAVE_OSC) || _DOXYGEN_
573 void setNsmClientId(const QString& nsmClientId);
574 QString getNsmClientId(void);
575
576 void setNsmSongName(const QString& nsmSongName);
577 QString getNsmSongName(void);
578#endif
579
581 bool getOscServerEnabled();
583 void setOscServerEnabled( bool val );
587 void setOscFeedbackEnabled( bool val );
589 int getOscServerPort();
591 void setOscServerPort( int oscPort );
592
595 bool getUseTimelineBpm();
598 void setUseTimelineBpm( bool val );
599
600 void setShowPlaybackTrack( bool val);
601 bool getShowPlaybackTrack() const;
602
604 void setRubberBandBatchMode( int val );
605
606 int getLastOpenTab();
607 void setLastOpenTab(int n);
608
609 void setH2ProcessName(const QString& processName);
610
611 QString getH2ProcessName();
612
613 QString getLastExportPatternAsDirectory() const;
614 QString getLastExportSongDirectory() const;
615 QString getLastSaveSongAsDirectory() const;
616 QString getLastOpenSongDirectory() const;
617 QString getLastOpenPatternDirectory() const;
618 QString getLastExportLilypondDirectory() const;
619 QString getLastExportMidiDirectory() const;
620 QString getLastImportDrumkitDirectory() const;
621 QString getLastExportDrumkitDirectory() const;
622 QString getLastOpenLayerDirectory() const;
623 QString getLastOpenPlaybackTrackDirectory() const;
624 QString getLastAddSongToPlaylistDirectory() const;
625 QString getLastPlaylistDirectory() const;
626 QString getLastPlaylistScriptDirectory() const;
627 QString getLastImportThemeDirectory() const;
628 QString getLastExportThemeDirectory() const;
629 void setLastExportPatternAsDirectory( QString sPath );
630 void setLastExportSongDirectory( QString sPath );
631 void setLastSaveSongAsDirectory( QString sPath );
632 void setLastOpenSongDirectory( QString sPath );
633 void setLastOpenPatternDirectory( QString sPath );
634 void setLastExportLilypondDirectory( QString sPath );
635 void setLastExportMidiDirectory( QString sPath );
636 void setLastImportDrumkitDirectory( QString sPath );
637 void setLastExportDrumkitDirectory( QString sPath );
638 void setLastOpenLayerDirectory( QString sPath );
639 void setLastOpenPlaybackTrackDirectory( QString sPath );
640 void setLastAddSongToPlaylistDirectory( QString sPath );
641 void setLastPlaylistDirectory( QString sPath );
642 void setLastPlaylistScriptDirectory( QString sPath );
643 void setLastImportThemeDirectory( QString sPath );
644 void setLastExportThemeDirectory( QString sPath );
645
646 int getExportSampleDepthIdx() const;
647 void setExportSampleDepthIdx( int nExportSampleDepthIdx );
648
649 int getExportSampleRateIdx() const;
650 void setExportSampleRateIdx( int nExportSampleRateIdx );
651
652 int getExportModeIdx() const;
653 void setExportModeIdx(int nExportMode);
654
655 int getExportTemplateIdx() const;
656 void setExportTemplateIdx( int nExportTemplateIdx );
657
658 int getMidiExportMode() const;
659 void setMidiExportMode(int nExportMode);
660
665
671 void setPreferencesOverwritePath( const QString& newPath );
672
673 const std::shared_ptr<Theme> getTheme() const;
674 void setTheme( const std::shared_ptr<Theme> pTheme );
675
676 bool getLoadingSuccessful() const;
677
678private:
685
686 std::shared_ptr<Theme> m_pTheme;
687
688 //___ General properties ___
689 QString m_sH2ProcessName; //Name of hydrogen's main process
692
703
729
730 QStringList m_recentFX;
731 std::vector<QString> m_recentFiles;
732
733#if defined(H2CORE_HAVE_OSC) || _DOXYGEN_
736#endif
737
748
749
750 //___ GUI properties ___
753
773
775
776 // Last directories used in QFileDialogs
793
794 //Export dialog
799 // ~ Export dialog
800
801 // Export midi dialog
803 // ~ Export midi dialog
804
820
821 Preferences();
822
823 WindowProperties readWindowProperties( XMLNode parent, const QString& windowName, WindowProperties defaultProp );
824 void writeWindowProperties( XMLNode parent, const QString& windowName, const WindowProperties& prop );
825
827};
828
840}
867}
878{
880}
881inline void Preferences::setLastExportSongDirectory( QString sPath )
882{
884}
885inline void Preferences::setLastSaveSongAsDirectory( QString sPath )
886{
888}
889inline void Preferences::setLastOpenSongDirectory( QString sPath )
890{
892}
894{
896}
898{
900}
901inline void Preferences::setLastExportMidiDirectory( QString sPath )
902{
904}
906{
908}
910{
912}
913inline void Preferences::setLastOpenLayerDirectory( QString sPath )
914{
916}
925inline void Preferences::setLastPlaylistDirectory( QString sPath )
926{
928}
930{
932}
934{
936}
938{
940}
941
943{
944 return m_nMidiExportMode;
945}
946
947inline void Preferences::setMidiExportMode(int ExportMode)
948{
949 m_nMidiExportMode = ExportMode;
950}
951
953{
955}
956
957inline void Preferences::setExportSampleDepthIdx(int ExportSampleDepth)
958{
959 m_nExportSampleDepthIdx = ExportSampleDepth;
960}
961
963{
965}
966
968{
969 return m_nExportModeIdx;
970}
971
972inline void Preferences::setExportModeIdx(int ExportModeIdx)
973{
974 m_nExportModeIdx = ExportModeIdx;
975}
976
977inline void Preferences::setExportSampleRateIdx(int ExportSampleRate)
978{
979 m_nExportSampleRateIdx = ExportSampleRate;
980}
981
983{
985}
986
987inline void Preferences::setExportTemplateIdx(int ExportTemplateIdx)
988{
989 m_nExportTemplateIdx = ExportTemplateIdx;
990}
991
992inline const QString& Preferences::getDefaultEditor() {
993 return m_sDefaultEditor;
994}
995
996inline void Preferences::setDefaultEditor( QString editor){
997 m_sDefaultEditor = editor;
998}
999
1001 return m_pTheme->getInterfaceTheme()->m_layout;
1002}
1003
1005 m_pTheme->getInterfaceTheme()->m_layout = layout;
1006}
1007
1009 return m_pTheme->getInterfaceTheme()->m_scalingPolicy;
1010}
1011
1013 m_pTheme->getInterfaceTheme()->m_scalingPolicy = scalingPolicy;
1014}
1015
1017 return m_pTheme->getInterfaceTheme()->m_iconColor;
1018}
1019
1021 m_pTheme->getInterfaceTheme()->m_iconColor = iconColor;
1022}
1023
1024// General
1025inline const QString& Preferences::getPreferredLanguage() {
1026 return m_sPreferredLanguage;
1027}
1028
1029inline void Preferences::setPreferredLanguage( const QString& sLanguage ) {
1030 m_sPreferredLanguage = sLanguage;
1031}
1032
1033inline void Preferences::setRestoreLastSongEnabled( bool restore ) {
1034 m_brestoreLastSong = restore;
1035}
1036
1038 m_brestoreLastPlaylist = restore;
1039}
1040
1044
1045inline void Preferences::setShowDevelWarning( bool value ) {
1046 m_bShowDevelWarning = value;
1047}
1048
1052
1056
1059}
1060
1061inline void Preferences::setHideKeyboardCursor( bool value ) {
1062 m_bHideKeyboardCursor = value;
1063}
1064
1068
1072
1076
1080
1081inline void Preferences::setLastSongFilename( const QString& filename ) {
1082 m_lastSongFilename = filename;
1083}
1084inline const QString& Preferences::getLastSongFilename() {
1085 return m_lastSongFilename;
1086}
1087
1088inline void Preferences::setLastPlaylistFilename( const QString& filename ) {
1089 m_lastPlaylistFilename = filename;
1090}
1093}
1094
1095inline void Preferences::setHearNewNotes( bool value ) {
1096 hearNewNotes = value;
1097}
1099 return hearNewNotes;
1100}
1101
1102inline void Preferences::setRecordEvents( bool value ) {
1103 recordEvents = value;
1104}
1106 return recordEvents;
1107}
1108
1109inline void Preferences::setPunchInPos ( unsigned pos ) {
1110 punchInPos = pos;
1111}
1113 return punchInPos;
1114}
1115
1116inline void Preferences::setPunchOutPos ( unsigned pos ) {
1117 punchOutPos = pos;
1118}
1120 return punchOutPos;
1121}
1122
1123inline bool Preferences::inPunchArea (int pos) {
1124 // Return true if punch area not defined
1125 if ( punchInPos <= punchOutPos ) {
1126 if ( pos < punchInPos || punchOutPos < pos ) {
1127 return false;
1128 }
1129 }
1130 return true;
1131}
1132
1134 punchInPos = 0;
1135 punchOutPos = -1;
1136}
1137
1138inline void Preferences::setQuantizeEvents( bool value ) {
1139 quantizeEvents = value;
1140}
1142 return quantizeEvents;
1143}
1144
1145inline void Preferences::setRecentFiles( const std::vector<QString> recentFiles ) {
1146 m_recentFiles = recentFiles;
1147}
1148inline std::vector<QString> Preferences::getRecentFiles() const {
1149 return m_recentFiles;
1150}
1151
1152inline QStringList Preferences::getRecentFX() {
1153 return m_recentFX;
1154}
1155
1156
1157// GUI Properties
1158inline const QString& Preferences::getQTStyle() {
1159 return m_pTheme->getInterfaceTheme()->m_sQTStyle;
1160}
1161inline void Preferences::setQTStyle( const QString& sStyle ) {
1162 m_pTheme->getInterfaceTheme()->m_sQTStyle = sStyle;
1163}
1164inline const QString& Preferences::getApplicationFontFamily() const {
1165 return m_pTheme->getFontTheme()->m_sApplicationFontFamily;
1166}
1167inline void Preferences::setApplicationFontFamily( const QString& family ) {
1168 m_pTheme->getFontTheme()->m_sApplicationFontFamily = family;
1169}
1170
1171inline const QString& Preferences::getLevel2FontFamily() const {
1172 return m_pTheme->getFontTheme()->m_sLevel2FontFamily;
1173}
1174inline void Preferences::setLevel2FontFamily( const QString& family ) {
1175 m_pTheme->getFontTheme()->m_sLevel2FontFamily = family;
1176}
1177
1178inline const QString& Preferences::getLevel3FontFamily() const {
1179 return m_pTheme->getFontTheme()->m_sLevel3FontFamily;
1180}
1181inline void Preferences::setLevel3FontFamily( const QString& family ) {
1182 m_pTheme->getFontTheme()->m_sLevel3FontFamily = family;
1183}
1184
1186 return m_pTheme->getFontTheme()->m_fontSize;
1187}
1189 m_pTheme->getFontTheme()->m_fontSize = fontSize;
1190}
1191
1193 return m_pTheme->getInterfaceTheme()->m_fMixerFalloffSpeed;
1194}
1195inline void Preferences::setMixerFalloffSpeed( float value ) {
1196 m_pTheme->getInterfaceTheme()->m_fMixerFalloffSpeed = value;
1197}
1201inline void Preferences::setInstrumentPeaks( bool value ) {
1202 m_bShowInstrumentPeaks = value;
1203}
1204
1211
1218
1220 return m_bIsFXTabVisible;
1221}
1222inline void Preferences::setFXTabVisible( bool value ) {
1223 m_bIsFXTabVisible = value;
1224}
1225
1229inline void Preferences::setShowAutomationArea( bool value ) {
1230 m_bShowAutomationArea = value;
1231}
1232
1233
1237inline void Preferences::setSongEditorGridHeight( unsigned value ) {
1239}
1243inline void Preferences::setSongEditorGridWidth( unsigned value ) {
1244 m_nSongEditorGridWidth = value;
1245}
1246
1250inline void Preferences::setPatternEditorGridHeight( unsigned value ) {
1252}
1256inline void Preferences::setPatternEditorGridWidth( unsigned value ) {
1258}
1259
1260inline void Preferences::setPatternColors( std::vector<QColor> patternColors ) {
1261 m_pTheme->getInterfaceTheme()->m_patternColors = patternColors;
1262}
1263inline std::vector<QColor> Preferences::getPatternColors() const {
1264 return m_pTheme->getInterfaceTheme()->m_patternColors;
1265}
1266inline void Preferences::setVisiblePatternColors( int nValue ) {
1267 m_pTheme->getInterfaceTheme()->m_nVisiblePatternColors = nValue;
1268}
1270 return m_pTheme->getInterfaceTheme()->m_nVisiblePatternColors;
1271}
1272inline void Preferences::setMaxPatternColors( int nValue ) {
1273 m_pTheme->getInterfaceTheme()->m_nMaxPatternColors = nValue;
1274}
1276 return m_pTheme->getInterfaceTheme()->m_nMaxPatternColors;
1277}
1278
1280 m_pTheme->getInterfaceTheme()->m_coloringMethod = coloringMethod;
1281}
1282
1284 return m_pTheme->getInterfaceTheme()->m_coloringMethod;
1285}
1286
1291 mainFormProperties = prop;
1292}
1293
1298 mixerProperties = prop;
1299}
1300
1307
1314
1315
1322
1329
1331 return m_ladspaProperties[nFX];
1332}
1333inline void Preferences::setLadspaProperties( unsigned nFX, const WindowProperties& prop ) {
1334 m_ladspaProperties[nFX] = prop;
1335}
1336
1343
1348 m_directorProperties = prop;
1349}
1350
1351inline const std::shared_ptr<ColorTheme> Preferences::getColorTheme() const {
1352 return m_pTheme->getColorTheme();
1353}
1354inline void Preferences::setColorTheme( const std::shared_ptr<ColorTheme> pNewColorTheme ) {
1355 m_pTheme->setColorTheme( pNewColorTheme );
1356}
1357
1359 return m_bUseLash;
1360}
1361inline void Preferences::setUseLash( bool b ){
1362 m_bUseLash = b;
1363}
1364
1365inline void Preferences::setMaxBars( const int bars ){
1366 m_nMaxBars = bars;
1367}
1368
1369inline int Preferences::getMaxBars() const {
1370 return m_nMaxBars;
1371}
1372
1373inline void Preferences::setMaxLayers( const int layers ){
1374 m_nMaxLayers = layers;
1375}
1376
1377inline int Preferences::getMaxLayers() const {
1378 return m_nMaxLayers;
1379}
1380
1383}
1384
1388
1389#if defined(H2CORE_HAVE_OSC) || _DOXYGEN_
1390inline void Preferences::setNsmClientId(const QString& nsmClientId){
1391 m_sNsmClientId = nsmClientId;
1392}
1393
1394inline QString Preferences::getNsmClientId(void){
1395 return m_sNsmClientId;
1396}
1397
1398inline void Preferences::setNsmSongName(const QString& nsmSongName){
1399 m_sNsmSongName = nsmSongName;
1400}
1401
1402inline QString Preferences::getNsmSongName(void){
1403 return m_sNsmSongName;
1404}
1405
1406#endif
1407
1411inline void Preferences::setOscServerEnabled( bool val ){
1412 m_bOscServerEnabled = val;
1413}
1414
1420}
1421
1423 return m_nOscServerPort;
1424}
1425inline void Preferences::setOscServerPort( int oscPort ){
1426 m_nOscServerPort = oscPort;
1427}
1428
1430 return __useTimelineBpm;
1431}
1432inline void Preferences::setUseTimelineBpm( bool val ){
1433 __useTimelineBpm = val;
1434}
1435
1436inline void Preferences::setShowPlaybackTrack( bool val ) {
1437 m_bShowPlaybackTrack = val;
1438}
1440 return m_bShowPlaybackTrack;
1441}
1442
1449
1451 return m_nLastOpenTab;
1452}
1454 m_nLastOpenTab = n;
1455}
1456
1457inline void Preferences::setH2ProcessName(const QString& processName){
1458 m_sH2ProcessName = processName;
1459}
1460
1462 return m_sH2ProcessName;
1463}
1464inline void Preferences::setTheme( const std::shared_ptr<Theme> pTheme ) {
1465 m_pTheme->setTheme( pTheme );
1466}
1467inline const std::shared_ptr<Theme> Preferences::getTheme() const {
1468 return m_pTheme;
1469}
1471 return m_bLoadingSuccessful;
1472}
1473};
1474
1475#endif
1476
#define H2_OBJECT(name)
Definition Object.h:224
FontSize
Enables custom scaling of the font size in the GUI.
Definition Theme.h:184
Manager for User Preferences File (singleton)
Definition Preferences.h:78
void setMaxBars(const int bars)
WindowProperties audioEngineInfoProperties
void writeWindowProperties(XMLNode parent, const QString &windowName, const WindowProperties &prop)
Write the xml nodes related to window properties.
void setRestoreLastPlaylistEnabled(bool restore)
QString getLastImportDrumkitDirectory() const
WindowProperties getAudioEngineInfoProperties()
QString m_sLastExportPatternAsDirectory
bool isPlaylistUsingRelativeFilenames()
void setLastExportMidiDirectory(QString sPath)
void setRecentFiles(const std::vector< QString > recentFiles)
void setOscFeedbackEnabled(bool val)
bool m_bShowExportDrumkitAttributionWarning
void setPatternEditorGridHeight(unsigned value)
QString getLastSaveSongAsDirectory() const
unsigned getSongEditorGridHeight()
WindowProperties m_playlistDialogProperties
QString m_sDefaultEditor
Default text editor (used by Playlisteditor)
bool inPunchArea(int pos)
void setPatternColors(std::vector< QColor > patternColors)
void setHearNewNotes(bool value)
QString getLastPlaylistScriptDirectory() const
bool __useTimelineBpm
Whether to use local speeds specified along the Timeline or a constant tempo for the whole Song in Hy...
int getExportSampleDepthIdx() const
void setLastAddSongToPlaylistDirectory(QString sPath)
void setShowAutomationArea(bool value)
void setMidiExportMode(int nExportMode)
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 setHideKeyboardCursor(bool b)
static Preferences * get_instance()
Returns a pointer to the current Preferences singleton stored in __instance.
const QString & getLastSongFilename()
QString getLastExportPatternAsDirectory() const
void setLadspaProperties(unsigned nFX, const WindowProperties &prop)
WindowProperties songEditorProperties
void setMixerProperties(const WindowProperties &prop)
void setExportTemplateIdx(int nExportTemplateIdx)
void setPatternEditorProperties(const WindowProperties &prop)
int getExportSampleRateIdx() const
void setShowPlaybackTrack(bool val)
void setLastOpenTab(int n)
bool m_bOscFeedbackEnabled
Whether to send the current state of Hydrogen to the OSC clients.
WindowProperties getMainFormProperties()
void setQTStyle(const QString &sStyle)
const QString & getApplicationFontFamily() const
void setLastPlaylistDirectory(QString sPath)
int getExportModeIdx() const
void setMostRecentFX(QString)
void setLastExportLilypondDirectory(QString sPath)
void setSongEditorProperties(const WindowProperties &prop)
std::vector< QString > m_recentFiles
const QString & getQTStyle()
QString getLastAddSongToPlaylistDirectory() const
QString getLastExportLilypondDirectory() const
void setPatternEditorUsingTriplets(bool value)
void setExportModeIdx(int nExportMode)
int m_bJackMasterMode
Specifies if Hydrogen should run as JACK time master.
WindowProperties mixerProperties
unsigned m_nPatternEditorGridWidth
QString m_sAudioDriver
Audio driver.
const std::shared_ptr< ColorTheme > getColorTheme() const
QStringList getRecentFX()
unsigned m_nSampleRate
Sample rate of the audio.
bool m_bShowNoteOverwriteWarning
Last song used.
void setShowDevelWarning(bool value)
void setTheme(const std::shared_ptr< Theme > pTheme)
WindowProperties instrumentRackProperties
QString m_sPortAudioHostAPI
void setLastImportThemeDirectory(QString sPath)
QString getLastOpenSongDirectory() const
void setLastOpenLayerDirectory(QString sPath)
void setMaxLayers(const int layers)
bool savePreferences()
Save the preferences file.
bool m_bPatternEditorUsingTriplets
int getExportTemplateIdx() const
void setVisiblePatternColors(int nValue)
int getPatternEditorGridResolution()
void setColoringMethod(InterfaceTheme::ColoringMethod coloringMethod)
const QString & getLevel3FontFamily() const
void setIconColor(InterfaceTheme::IconColor iconColor)
QString getH2ProcessName()
void setDefaultEditor(QString editor)
void setFXTabVisible(bool value)
void setInstrumentRackProperties(const WindowProperties &prop)
bool isPatternEditorUsingTriplets()
InterfaceTheme::Layout getDefaultUILayout()
WindowProperties getDirectorProperties()
bool m_bOscServerEnabled
Whether to start the OscServer thread.
void setSongEditorGridWidth(unsigned value)
QString m_sMidiOutputPortName
unsigned m_nSongEditorGridHeight
void setLastPlaylistScriptDirectory(QString sPath)
void setInstrumentPeaks(bool value)
void setApplicationFontFamily(const QString &family)
QString m_sLastImportDrumkitDirectory
void setRubberBandBatchMode(int val)
unsigned getPatternEditorGridHeight()
QString getLastOpenPatternDirectory() const
void setExportSampleDepthIdx(int nExportSampleDepthIdx)
QString m_sLastExportSongDirectory
QString m_sLastOpenPatternDirectory
void setPunchInPos(unsigned pos)
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
void setLastExportSongDirectory(QString sPath)
WindowProperties m_directorProperties
void setExportSampleRateIdx(int nExportSampleRateIdx)
void setLevel3FontFamily(const QString &family)
void setDirectorProperties(const WindowProperties &prop)
void setShowNoteOverwriteWarning(bool bValue)
const QString & getDataDirectory()
void setPlaylistDialogProperties(const WindowProperties &prop)
InterfaceTheme::IconColor getIconColor()
void setUseRelativeFilenamesForPlaylists(bool value)
QString m_sMidiDriver
MIDI driver.
WindowProperties getMixerProperties()
void setPreferencesOverwritePath(const QString &newPath)
Setting m_sPreferencesOverwritePath.
QString getNsmSongName(void)
unsigned m_nSongEditorGridWidth
void setLastOpenSongDirectory(QString sPath)
int getMidiExportMode() const
bool getShowNoteOverwriteWarning()
bool m_bShowExportDrumkitCopyleftWarning
QString m_lastPlaylistFilename
void setNsmClientId(const QString &nsmClientId)
QString m_sLastExportThemeDirectory
bool getWaitForSessionHandler()
bool isRestoreLastSongEnabled()
bool isRestoreLastPlaylistEnabled()
void setLastOpenPatternDirectory(QString sPath)
void setMainFormProperties(const WindowProperties &prop)
void setAudioEngineInfoProperties(const WindowProperties &prop)
std::list< QString > sServerList
JackTrackOutputMode
Specifies which audio settings will be applied to the sample supplied in the JACK per track output po...
@ 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.
bool getUseTimelineBpm()
Whether to use the bpm of the timeline.
std::vector< QString > getRecentFiles() const
const QString & getLastPlaylistFilename()
QString m_sLastExportDrumkitDirectory
QString m_sLastExportMidiDirectory
void setLastExportDrumkitDirectory(QString sPath)
QString m_sLastImportThemeDirectory
void setColorTheme(const std::shared_ptr< ColorTheme > pNewColorTheme)
std::list< QString > m_patternCategories
QString getLastImportThemeDirectory() const
FontTheme::FontSize getFontSize() const
const QString & getPreferredLanguage()
bool m_bJackConnectDefaults
Toggles auto-connecting of the main stereo output ports to the system's default ports when starting t...
const QString & getDefaultEditor()
QString m_sPreferencesOverwritePath
Full path to local preferences file.
bool getLoadingSuccessful() const
unsigned m_nMaxNotes
max notes
void setLastSongFilename(const QString &filename)
QString getLastExportMidiDirectory() const
void setSongEditorGridHeight(unsigned value)
const std::shared_ptr< Theme > getTheme() const
int getMaxBars() const
bool m_bUseLash
Show development version warning?
QString getLastExportSongDirectory() const
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
@ GeneralTab
Any option in the General tab appeared.
@ AppearanceTab
Any option in the Appearance tab excluding colors, font size, or font family.
@ Font
Either the font size or font family have changed.
@ Colors
At least one of the colors has changed.
@ OscTab
Any option in the OSC tab appeared.
@ MidiTab
Any option in the MIDI tab appeared.
@ AudioTab
Any option in the Audio tab appeared.
void setPreferredLanguage(const QString &sLanguage)
void setPunchOutPos(unsigned pos)
QString getLastOpenLayerDirectory() const
void setOscServerPort(int oscPort)
void setOscServerEnabled(bool val)
void setFontSize(FontTheme::FontSize fontSize)
bool getShowPlaybackTrack() const
InterfaceTheme::ColoringMethod getColoringMethod() const
bool m_bMidiDiscardNoteAfterAction
void setPatternEditorGridResolution(int value)
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...
void setQuantizeEvents(bool value)
QString m_sLastOpenLayerDirectory
WindowProperties mainFormProperties
void setLastSaveSongAsDirectory(QString sPath)
void setUseTimelineBpm(bool val)
Setting __useTimelineBpm.
QString m_sOSSDevice
Device used for output.
InterfaceTheme::ScalingPolicy getUIScalingPolicy()
std::vector< QColor > getPatternColors() const
QString getLastExportThemeDirectory() const
QString m_sLastSaveSongAsDirectory
void setNsmSongName(const QString &nsmSongName)
int getMaxLayers() const
QString m_rubberBandCLIexecutable
Rubberband CLI.
QString m_sLastAddSongToPlaylistDirectory
void setUseLash(bool b)
JackBBTSyncMethod m_JackBBTSync
Since Hydrogen uses both fixed pattern lengths and recalculates the tick size each time it encounters...
void setLastImportDrumkitDirectory(QString sPath)
void setRestoreLastSongEnabled(bool restore)
void setLastExportThemeDirectory(QString sPath)
void setLastOpenPlaybackTrackDirectory(QString sPath)
QString getLastOpenPlaybackTrackDirectory() const
WindowProperties patternEditorProperties
WindowProperties getPatternEditorProperties()
void setMaxPatternColors(int nValue)
WindowProperties getLadspaProperties(unsigned nFX)
bool m_bJackTimebaseEnabled
External applications with a faulty JACK timebase master implementation can mess up the transport wit...
void setDefaultUILayout(InterfaceTheme::Layout layout)
JackBBTSyncMethod
Specifies the variable, which has to remain constant in order to guarantee a working synchronization ...
@ 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.
WindowProperties getInstrumentRackProperties()
QString m_sLastPlaylistScriptDirectory
QString getNsmClientId(void)
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...
Definition Preferences.h:96
@ 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.
Definition Preferences.h:89
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.
WindowProperties getSongEditorProperties()
QStringList m_recentFX
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)
unsigned getPatternEditorGridWidth()
void setH2ProcessName(const QString &processName)
int m_bJackTransportMode
Specifies whether or not Hydrogen will use the JACK transport system.
QString m_sPreferredLanguage
QString m_sLastOpenSongDirectory
QString getLastExportDrumkitDirectory() const
std::shared_ptr< Theme > m_pTheme
void setRecordEvents(bool value)
void setLastPlaylistFilename(const QString &filename)
WindowProperties getPlaylistDialogProperties()
unsigned m_nBufferSize
Buffer size of the audio.
unsigned getSongEditorGridWidth()
QString getLastPlaylistDirectory() const
QString m_sLastPlaylistDirectory
void setUIScalingPolicy(InterfaceTheme::ScalingPolicy policy)
void setWaitForSessionHandler(bool value)
QString getPreferencesOverwritePath()
Returns m_sPreferencesOverwritePath.
void setLastExportPatternAsDirectory(QString sPath)
QString m_sLastOpenPlaybackTrackDirectory
void setPatternEditorGridWidth(unsigned value)
WindowProperties m_ladspaProperties[MAX_FX]
void set(int _x, int _y, int _width, int _height, bool _visible, QByteArray geometry=QByteArray())
Definition Preferences.h:63
XMLNode is a subclass of QDomNode with read and write values methods.
Definition Xml.h:39
#define MAX_FX
Maximum number of effects.
Definition config.dox:83