hydrogen 1.2.6
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-2025 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>
35#include <core/Object.h>
36
37#include <QStringList>
38#include <QDomDocument>
39#include <QColor>
40
41namespace H2Core
42{
43
44
49class WindowProperties : public H2Core::Object<WindowProperties>
50{
52public:
53 int x;
54 int y;
55 int width;
56 int height;
57 bool visible;
58 QByteArray m_geometry;
59
63
64 void set(int _x, int _y, int _width, int _height, bool _visible, QByteArray geometry = QByteArray() ) {
65 x = _x; y = _y;
66 width = _width; height = _height;
67 visible = _visible;
68 m_geometry = geometry;
69 }
70
71};
72
78class Preferences : public H2Core::Object<Preferences>
79{
81public:
82 enum {
102 BC_ON = 0,
124 };
125
128 enum Changes {
129 None = 0x000,
131 Font = 0x001,
133 Colors = 0x002,
139 GeneralTab = 0x008,
141 AudioTab = 0x010,
143 MidiTab = 0x020,
145 OscTab = 0x040
146 };
147
148 bool __playsamplesonclicking; // audio file browser
149
150 bool __playselectedinstrument; // midi keys and keys play instrument or drumset
151
153
154 // switch to enable / disable lash, only on h2 startup
157
158 //soundlibrarypanel expand song and pattern item
161
162 //beatcounter
163 bool m_bbc;
165
168 // ~ beatcounter
169
170 std::list<QString> sServerList;
171 std::list<QString> m_patternCategories;
172
173 // audio engine properties ___
187 static AudioDriver parseAudioDriver( const QString& sDriver );
188 static QString audioDriverToQString( const AudioDriver& driver );
189 static std::vector<AudioDriver> getSupportedAudioDrivers();
190
202 static bool checkJackSupport();
203
229 unsigned m_nMaxNotes;
244
245 // OSS driver properties ___
246 QString m_sOSSDevice;
247
248 // MIDI Driver properties
272 static QString getNullMidiPort() {
273 return "None";
274 }
275
281
282 // OSC Server properties
325
326 // alsa audio driver properties ___
328
329 // PortAudio properties
333
334 // CoreAudio properties
336
337 // jack driver properties ___
356
366
370
386 // ~ jack driver properties
387
391
394
401 static void create_instance();
406 static Preferences* get_instance(){ assert(__instance); return __instance; }
407
408 ~Preferences();
409
411 bool loadPreferences( bool bGlobal );
412
414 bool savePreferences();
415
416 const QString& getDataDirectory();
417
418 const QString& getDefaultEditor();
419 void setDefaultEditor( QString editor);
420
423
427 void setIconColor( InterfaceTheme::IconColor iconColor );
428
429 // General
430 const QString& getPreferredLanguage();
431 void setPreferredLanguage( const QString& sLanguage );
432
433 void setRestoreLastSongEnabled( bool restore );
434 void setRestoreLastPlaylistEnabled( bool restore );
435 void setUseRelativeFilenamesForPlaylists( bool value );
436
437 void setShowDevelWarning( bool value );
438 bool getShowDevelWarning();
439
441 void setShowNoteOverwriteWarning( bool bValue );
442
446
447 void setLastSongFilename( const QString& filename );
448 const QString& getLastSongFilename();
449
450 void setLastPlaylistFilename( const QString& filename );
451 const QString& getLastPlaylistFilename();
452
453 void setHearNewNotes( bool value );
454 bool getHearNewNotes();
455
456 void setRecordEvents( bool value );
457 bool getRecordEvents();
458
459 void setPunchInPos ( unsigned pos );
460 int getPunchInPos();
461
462 void setPunchOutPos ( unsigned pos );
463 int getPunchOutPos();
464
465 bool inPunchArea (int pos);
466 void unsetPunchArea ();
467
468 void setQuantizeEvents( bool value );
469 bool getQuantizeEvents();
470
471 std::vector<QString> getRecentFiles() const;
472 void setRecentFiles( const std::vector<QString> recentFiles );
473
474 QStringList getRecentFX();
475 void setMostRecentFX( QString );
476
477
478 // GUI Properties
479 const QString& getQTStyle();
480 void setQTStyle( const QString& sStyle );
481
482 const QString& getApplicationFontFamily() const;
483 void setApplicationFontFamily( const QString& family );
484 const QString& getLevel2FontFamily() const;
485 void setLevel2FontFamily( const QString& family );
486 const QString& getLevel3FontFamily() const;
487 void setLevel3FontFamily( const QString& family );
488
490 void setFontSize( FontTheme::FontSize fontSize );
491
492 float getMixerFalloffSpeed();
493 void setMixerFalloffSpeed( float value );
494 bool showInstrumentPeaks();
495 void setInstrumentPeaks( bool value );
496
498 void setPatternEditorGridResolution( int value );
499
501 void setPatternEditorUsingTriplets( bool value );
502
503 bool isFXTabVisible();
504 void setFXTabVisible( bool value );
505
507 void setShowAutomationArea( bool value );
508
510 void setPatternEditorGridHeight( unsigned value );
511
512 unsigned getPatternEditorGridWidth();
513 void setPatternEditorGridWidth( unsigned value );
514
515 unsigned getSongEditorGridHeight();
516 void setSongEditorGridHeight( unsigned value );
517
518 unsigned getSongEditorGridWidth();
519 void setSongEditorGridWidth( unsigned value );
520
523
524 void setPatternColors( std::vector<QColor> patternColors );
525 std::vector<QColor> getPatternColors() const;
526 void setMaxPatternColors( int nValue );
527 int getMaxPatternColors() const;
528 void setVisiblePatternColors( int nValue );
529 int getVisiblePatternColors() const;
530
532 void setMainFormProperties( const WindowProperties& prop );
533
535 void setMixerProperties( const WindowProperties& prop );
536
539
541 void setSongEditorProperties( const WindowProperties& prop );
542
545
548
550 void setLadspaProperties( unsigned nFX, const WindowProperties& prop );
551
554
556 void setDirectorProperties( const WindowProperties& prop );
557
558 const std::shared_ptr<ColorTheme> getColorTheme() const;
559 void setColorTheme( const std::shared_ptr<ColorTheme> pNewColorTheme );
560
561 bool useLash();
562 void setUseLash( bool b );
563
564 bool hideKeyboardCursor();
565 void setHideKeyboardCursor( bool b );
566
568 void setMaxBars( const int bars );
570 int getMaxBars() const;
571
573 void setMaxLayers( const int layers );
575 int getMaxLayers() const;
576
577 void setWaitForSessionHandler(bool value);
579
580#if defined(H2CORE_HAVE_OSC) || _DOXYGEN_
581 void setNsmClientId(const QString& nsmClientId);
582 QString getNsmClientId(void);
583
584 void setNsmSongName(const QString& nsmSongName);
585 QString getNsmSongName(void);
586#endif
587
589 bool getOscServerEnabled();
591 void setOscServerEnabled( bool val );
595 void setOscFeedbackEnabled( bool val );
597 int getOscServerPort();
599 void setOscServerPort( int oscPort );
600
603 bool getUseTimelineBpm();
606 void setUseTimelineBpm( bool val );
607
608 void setShowPlaybackTrack( bool val);
609 bool getShowPlaybackTrack() const;
610
612 void setRubberBandBatchMode( int val );
613
614 int getLastOpenTab();
615 void setLastOpenTab(int n);
616
617 void setH2ProcessName(const QString& processName);
618
619 QString getH2ProcessName();
620
621 QString getLastExportPatternAsDirectory() const;
622 QString getLastExportSongDirectory() const;
623 QString getLastSaveSongAsDirectory() const;
624 QString getLastOpenSongDirectory() const;
625 QString getLastOpenPatternDirectory() const;
626 QString getLastExportLilypondDirectory() const;
627 QString getLastExportMidiDirectory() const;
628 QString getLastImportDrumkitDirectory() const;
629 QString getLastExportDrumkitDirectory() const;
630 QString getLastOpenLayerDirectory() const;
631 QString getLastOpenPlaybackTrackDirectory() const;
632 QString getLastAddSongToPlaylistDirectory() const;
633 QString getLastPlaylistDirectory() const;
634 QString getLastPlaylistScriptDirectory() const;
635 QString getLastImportThemeDirectory() const;
636 QString getLastExportThemeDirectory() const;
637 void setLastExportPatternAsDirectory( QString sPath );
638 void setLastExportSongDirectory( QString sPath );
639 void setLastSaveSongAsDirectory( QString sPath );
640 void setLastOpenSongDirectory( QString sPath );
641 void setLastOpenPatternDirectory( QString sPath );
642 void setLastExportLilypondDirectory( QString sPath );
643 void setLastExportMidiDirectory( QString sPath );
644 void setLastImportDrumkitDirectory( QString sPath );
645 void setLastExportDrumkitDirectory( QString sPath );
646 void setLastOpenLayerDirectory( QString sPath );
647 void setLastOpenPlaybackTrackDirectory( QString sPath );
648 void setLastAddSongToPlaylistDirectory( QString sPath );
649 void setLastPlaylistDirectory( QString sPath );
650 void setLastPlaylistScriptDirectory( QString sPath );
651 void setLastImportThemeDirectory( QString sPath );
652 void setLastExportThemeDirectory( QString sPath );
653
654 int getExportSampleDepthIdx() const;
655 void setExportSampleDepthIdx( int nExportSampleDepthIdx );
656
657 int getExportSampleRateIdx() const;
658 void setExportSampleRateIdx( int nExportSampleRateIdx );
659
660 int getExportModeIdx() const;
661 void setExportModeIdx(int nExportMode);
662
665 float getExportCompressionLevel() const;
666 void setExportCompressionLevel( float fCompressionLevel );
667
668 int getMidiExportMode() const;
669 void setMidiExportMode(int nExportMode);
670
675
681 void setPreferencesOverwritePath( const QString& newPath );
682
683 const std::shared_ptr<Theme> getTheme() const;
684 void setTheme( const std::shared_ptr<Theme> pTheme );
685
686 bool getLoadingSuccessful() const;
687
688private:
695
696 std::shared_ptr<Theme> m_pTheme;
697
698 //___ General properties ___
699 QString m_sH2ProcessName; //Name of hydrogen's main process
702
713
739
740 QStringList m_recentFX;
741 std::vector<QString> m_recentFiles;
742
743#if defined(H2CORE_HAVE_OSC) || _DOXYGEN_
746#endif
747
758
759
760 //___ GUI properties ___
763
783
785
786 // Last directories used in QFileDialogs
803
804 //Export dialog
810 // ~ Export dialog
811
812 // Export midi dialog
814 // ~ Export midi dialog
815
831
832 Preferences();
833
834 WindowProperties readWindowProperties( XMLNode parent, const QString& windowName, WindowProperties defaultProp );
835 void writeWindowProperties( XMLNode parent, const QString& windowName, const WindowProperties& prop );
836
838};
839
851}
878}
889{
891}
892inline void Preferences::setLastExportSongDirectory( QString sPath )
893{
895}
896inline void Preferences::setLastSaveSongAsDirectory( QString sPath )
897{
899}
900inline void Preferences::setLastOpenSongDirectory( QString sPath )
901{
903}
905{
907}
909{
911}
912inline void Preferences::setLastExportMidiDirectory( QString sPath )
913{
915}
917{
919}
921{
923}
924inline void Preferences::setLastOpenLayerDirectory( QString sPath )
925{
927}
936inline void Preferences::setLastPlaylistDirectory( QString sPath )
937{
939}
941{
943}
945{
947}
949{
951}
952
954{
955 return m_nMidiExportMode;
956}
957
958inline void Preferences::setMidiExportMode(int ExportMode)
959{
960 m_nMidiExportMode = ExportMode;
961}
962
964{
966}
967
968inline void Preferences::setExportSampleDepthIdx(int ExportSampleDepth)
969{
970 m_nExportSampleDepthIdx = ExportSampleDepth;
971}
972
974{
976}
977
979{
980 return m_nExportModeIdx;
981}
982
983inline void Preferences::setExportModeIdx(int ExportModeIdx)
984{
985 m_nExportModeIdx = ExportModeIdx;
986}
987
988inline void Preferences::setExportSampleRateIdx(int ExportSampleRate)
989{
990 m_nExportSampleRateIdx = ExportSampleRate;
991}
992
997
999{
1000 m_exportFormat = format;
1001}
1002
1004{
1006}
1007
1008inline void Preferences::setExportCompressionLevel( float fCompressionLevel )
1009{
1010 m_fExportCompressionLevel = fCompressionLevel;
1011}
1012
1013inline const QString& Preferences::getDefaultEditor() {
1014 return m_sDefaultEditor;
1015}
1016
1017inline void Preferences::setDefaultEditor( QString editor){
1018 m_sDefaultEditor = editor;
1019}
1020
1022 return m_pTheme->getInterfaceTheme()->m_layout;
1023}
1024
1026 m_pTheme->getInterfaceTheme()->m_layout = layout;
1027}
1028
1030 return m_pTheme->getInterfaceTheme()->m_scalingPolicy;
1031}
1032
1034 m_pTheme->getInterfaceTheme()->m_scalingPolicy = scalingPolicy;
1035}
1036
1038 return m_pTheme->getInterfaceTheme()->m_iconColor;
1039}
1040
1042 m_pTheme->getInterfaceTheme()->m_iconColor = iconColor;
1043}
1044
1045// General
1046inline const QString& Preferences::getPreferredLanguage() {
1047 return m_sPreferredLanguage;
1048}
1049
1050inline void Preferences::setPreferredLanguage( const QString& sLanguage ) {
1051 m_sPreferredLanguage = sLanguage;
1052}
1053
1054inline void Preferences::setRestoreLastSongEnabled( bool restore ) {
1055 m_brestoreLastSong = restore;
1056}
1057
1059 m_brestoreLastPlaylist = restore;
1060}
1061
1065
1066inline void Preferences::setShowDevelWarning( bool value ) {
1067 m_bShowDevelWarning = value;
1068}
1069
1073
1077
1080}
1081
1082inline void Preferences::setHideKeyboardCursor( bool value ) {
1083 m_bHideKeyboardCursor = value;
1084}
1085
1089
1093
1097
1101
1102inline void Preferences::setLastSongFilename( const QString& filename ) {
1103 m_lastSongFilename = filename;
1104}
1105inline const QString& Preferences::getLastSongFilename() {
1106 return m_lastSongFilename;
1107}
1108
1109inline void Preferences::setLastPlaylistFilename( const QString& filename ) {
1110 m_lastPlaylistFilename = filename;
1111}
1114}
1115
1116inline void Preferences::setHearNewNotes( bool value ) {
1117 hearNewNotes = value;
1118}
1120 return hearNewNotes;
1121}
1122
1123inline void Preferences::setRecordEvents( bool value ) {
1124 recordEvents = value;
1125}
1127 return recordEvents;
1128}
1129
1130inline void Preferences::setPunchInPos ( unsigned pos ) {
1131 punchInPos = pos;
1132}
1134 return punchInPos;
1135}
1136
1137inline void Preferences::setPunchOutPos ( unsigned pos ) {
1138 punchOutPos = pos;
1139}
1141 return punchOutPos;
1142}
1143
1144inline bool Preferences::inPunchArea (int pos) {
1145 // Return true if punch area not defined
1146 if ( punchInPos <= punchOutPos ) {
1147 if ( pos < punchInPos || punchOutPos < pos ) {
1148 return false;
1149 }
1150 }
1151 return true;
1152}
1153
1155 punchInPos = 0;
1156 punchOutPos = -1;
1157}
1158
1159inline void Preferences::setQuantizeEvents( bool value ) {
1160 quantizeEvents = value;
1161}
1163 return quantizeEvents;
1164}
1165
1166inline void Preferences::setRecentFiles( const std::vector<QString> recentFiles ) {
1167 m_recentFiles = recentFiles;
1168}
1169inline std::vector<QString> Preferences::getRecentFiles() const {
1170 return m_recentFiles;
1171}
1172
1173inline QStringList Preferences::getRecentFX() {
1174 return m_recentFX;
1175}
1176
1177
1178// GUI Properties
1179inline const QString& Preferences::getQTStyle() {
1180 return m_pTheme->getInterfaceTheme()->m_sQTStyle;
1181}
1182inline void Preferences::setQTStyle( const QString& sStyle ) {
1183 m_pTheme->getInterfaceTheme()->m_sQTStyle = sStyle;
1184}
1185inline const QString& Preferences::getApplicationFontFamily() const {
1186 return m_pTheme->getFontTheme()->m_sApplicationFontFamily;
1187}
1188inline void Preferences::setApplicationFontFamily( const QString& family ) {
1189 m_pTheme->getFontTheme()->m_sApplicationFontFamily = family;
1190}
1191
1192inline const QString& Preferences::getLevel2FontFamily() const {
1193 return m_pTheme->getFontTheme()->m_sLevel2FontFamily;
1194}
1195inline void Preferences::setLevel2FontFamily( const QString& family ) {
1196 m_pTheme->getFontTheme()->m_sLevel2FontFamily = family;
1197}
1198
1199inline const QString& Preferences::getLevel3FontFamily() const {
1200 return m_pTheme->getFontTheme()->m_sLevel3FontFamily;
1201}
1202inline void Preferences::setLevel3FontFamily( const QString& family ) {
1203 m_pTheme->getFontTheme()->m_sLevel3FontFamily = family;
1204}
1205
1207 return m_pTheme->getFontTheme()->m_fontSize;
1208}
1210 m_pTheme->getFontTheme()->m_fontSize = fontSize;
1211}
1212
1214 return m_pTheme->getInterfaceTheme()->m_fMixerFalloffSpeed;
1215}
1216inline void Preferences::setMixerFalloffSpeed( float value ) {
1217 m_pTheme->getInterfaceTheme()->m_fMixerFalloffSpeed = value;
1218}
1222inline void Preferences::setInstrumentPeaks( bool value ) {
1223 m_bShowInstrumentPeaks = value;
1224}
1225
1232
1239
1241 return m_bIsFXTabVisible;
1242}
1243inline void Preferences::setFXTabVisible( bool value ) {
1244 m_bIsFXTabVisible = value;
1245}
1246
1250inline void Preferences::setShowAutomationArea( bool value ) {
1251 m_bShowAutomationArea = value;
1252}
1253
1254
1258inline void Preferences::setSongEditorGridHeight( unsigned value ) {
1260}
1264inline void Preferences::setSongEditorGridWidth( unsigned value ) {
1265 m_nSongEditorGridWidth = value;
1266}
1267
1271inline void Preferences::setPatternEditorGridHeight( unsigned value ) {
1273}
1277inline void Preferences::setPatternEditorGridWidth( unsigned value ) {
1279}
1280
1281inline void Preferences::setPatternColors( std::vector<QColor> patternColors ) {
1282 m_pTheme->getInterfaceTheme()->m_patternColors = patternColors;
1283}
1284inline std::vector<QColor> Preferences::getPatternColors() const {
1285 return m_pTheme->getInterfaceTheme()->m_patternColors;
1286}
1287inline void Preferences::setVisiblePatternColors( int nValue ) {
1288 m_pTheme->getInterfaceTheme()->m_nVisiblePatternColors = nValue;
1289}
1291 return m_pTheme->getInterfaceTheme()->m_nVisiblePatternColors;
1292}
1293inline void Preferences::setMaxPatternColors( int nValue ) {
1294 m_pTheme->getInterfaceTheme()->m_nMaxPatternColors = nValue;
1295}
1297 return m_pTheme->getInterfaceTheme()->m_nMaxPatternColors;
1298}
1299
1301 m_pTheme->getInterfaceTheme()->m_coloringMethod = coloringMethod;
1302}
1303
1305 return m_pTheme->getInterfaceTheme()->m_coloringMethod;
1306}
1307
1312 mainFormProperties = prop;
1313}
1314
1319 mixerProperties = prop;
1320}
1321
1328
1335
1336
1343
1350
1352 return m_ladspaProperties[nFX];
1353}
1354inline void Preferences::setLadspaProperties( unsigned nFX, const WindowProperties& prop ) {
1355 m_ladspaProperties[nFX] = prop;
1356}
1357
1364
1369 m_directorProperties = prop;
1370}
1371
1372inline const std::shared_ptr<ColorTheme> Preferences::getColorTheme() const {
1373 return m_pTheme->getColorTheme();
1374}
1375inline void Preferences::setColorTheme( const std::shared_ptr<ColorTheme> pNewColorTheme ) {
1376 m_pTheme->setColorTheme( pNewColorTheme );
1377}
1378
1380 return m_bUseLash;
1381}
1382inline void Preferences::setUseLash( bool b ){
1383 m_bUseLash = b;
1384}
1385
1386inline void Preferences::setMaxBars( const int bars ){
1387 m_nMaxBars = bars;
1388}
1389
1390inline int Preferences::getMaxBars() const {
1391 return m_nMaxBars;
1392}
1393
1394inline void Preferences::setMaxLayers( const int layers ){
1395 m_nMaxLayers = layers;
1396}
1397
1398inline int Preferences::getMaxLayers() const {
1399 return m_nMaxLayers;
1400}
1401
1404}
1405
1409
1410#if defined(H2CORE_HAVE_OSC) || _DOXYGEN_
1411inline void Preferences::setNsmClientId(const QString& nsmClientId){
1412 m_sNsmClientId = nsmClientId;
1413}
1414
1415inline QString Preferences::getNsmClientId(void){
1416 return m_sNsmClientId;
1417}
1418
1419inline void Preferences::setNsmSongName(const QString& nsmSongName){
1420 m_sNsmSongName = nsmSongName;
1421}
1422
1423inline QString Preferences::getNsmSongName(void){
1424 return m_sNsmSongName;
1425}
1426
1427#endif
1428
1432inline void Preferences::setOscServerEnabled( bool val ){
1433 m_bOscServerEnabled = val;
1434}
1435
1441}
1442
1444 return m_nOscServerPort;
1445}
1446inline void Preferences::setOscServerPort( int oscPort ){
1447 m_nOscServerPort = oscPort;
1448}
1449
1451 return __useTimelineBpm;
1452}
1453inline void Preferences::setUseTimelineBpm( bool val ){
1454 __useTimelineBpm = val;
1455}
1456
1457inline void Preferences::setShowPlaybackTrack( bool val ) {
1458 m_bShowPlaybackTrack = val;
1459}
1461 return m_bShowPlaybackTrack;
1462}
1463
1470
1472 return m_nLastOpenTab;
1473}
1475 m_nLastOpenTab = n;
1476}
1477
1478inline void Preferences::setH2ProcessName(const QString& processName){
1479 m_sH2ProcessName = processName;
1480}
1481
1483 return m_sH2ProcessName;
1484}
1485inline void Preferences::setTheme( const std::shared_ptr<Theme> pTheme ) {
1486 m_pTheme->setTheme( pTheme );
1487}
1488inline const std::shared_ptr<Theme> Preferences::getTheme() const {
1489 return m_pTheme;
1490}
1492 return m_bLoadingSuccessful;
1493}
1494};
1495
1496#endif
1497
#define H2_OBJECT(name)
Definition Object.h:227
AudioFormat
All audio file formats supported by Hydrogen.
Definition Filesystem.h:90
FontSize
Enables custom scaling of the font size in the GUI.
Definition Theme.h:184
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()
static AudioDriver parseAudioDriver(const QString &sDriver)
int m_bJackTimebaseMode
Specifies if Hydrogen support the of JACK Timebase protocol.
void setLastExportMidiDirectory(QString sPath)
void setRecentFiles(const std::vector< QString > recentFiles)
Filesystem::AudioFormat m_exportFormat
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 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)
WindowProperties mixerProperties
unsigned m_nPatternEditorGridWidth
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
static std::vector< AudioDriver > getSupportedAudioDrivers()
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
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)
static QString audioDriverToQString(const AudioDriver &driver)
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 setExportFormat(Filesystem::AudioFormat format)
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
AudioDriver m_audioDriver
Audio driver.
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)
float getExportCompressionLevel() const
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.
Filesystem::AudioFormat getExportFormat() const
QString m_sLastAddSongToPlaylistDirectory
void setUseLash(bool b)
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 implementation can mess up the transport within Hyd...
void setDefaultUILayout(InterfaceTheme::Layout layout)
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
int getVisiblePatternColors() const
float m_fMetronomeVolume
Metronome volume FIXME: remove this volume!!
static bool checkJackSupport()
Attempts to call several JACK executables in order to check for existing JACK support.
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...
void setExportCompressionLevel(float fCompressionLevel)
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
float m_fExportCompressionLevel
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
@ NO_JACK_TRANSPORT
Specifies whether or not to use JACK transport capabilities.
@ USE_JACK_TRANSPORT
Specifies whether or not to use JACK transport capabilities.
Definition Preferences.h:90
@ NO_JACK_TIMEBASE_CONTROL
Specifies that Hydrogen should not be in control of JACK Timebase information.
@ USE_JACK_TIMEBASE_CONTROL
Specifies that Hydrogen should attempt to acquire JACK Timebase control.
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:64
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