SetupDialog.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /*
  2. * SetupDialog.h - dialog for setting up LMMS
  3. *
  4. * Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (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 GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #ifndef SETUP_DIALOG_H
  25. #define SETUP_DIALOG_H
  26. #include <QDialog>
  27. #include <QtCore/QMap>
  28. #include "AudioDevice.h"
  29. #include "AudioDeviceSetupWidget.h"
  30. #include "LedCheckbox.h"
  31. #include "lmmsconfig.h"
  32. #include "MidiClient.h"
  33. #include "MidiSetupWidget.h"
  34. class QComboBox;
  35. class QLabel;
  36. class QLineEdit;
  37. class QSlider;
  38. class TabBar;
  39. class SetupDialog : public QDialog
  40. {
  41. Q_OBJECT
  42. public:
  43. enum ConfigTabs
  44. {
  45. GeneralSettings,
  46. PerformanceSettings,
  47. AudioSettings,
  48. MidiSettings,
  49. PathsSettings
  50. };
  51. SetupDialog(ConfigTabs tab_to_open = GeneralSettings);
  52. virtual ~SetupDialog();
  53. protected slots:
  54. void accept() override;
  55. private slots:
  56. // General settings widget.
  57. void toggleDisplaydBFS(bool enabled);
  58. void toggleTooltips(bool enabled);
  59. void toggleDisplayWaveform(bool enabled);
  60. void toggleNoteLabels(bool enabled);
  61. void toggleCompactTrackButtons(bool enabled);
  62. void toggleOneInstrumentTrackWindow(bool enabled);
  63. void toggleSideBarOnRight(bool enabled);
  64. void toggleLetPreviewsFinish(bool enabled);
  65. void toggleSoloLegacyBehavior(bool enabled);
  66. void toggleTrackDeletionWarning(bool enabled);
  67. void toggleMMPZ(bool enabled);
  68. void toggleDisableBackup(bool enabled);
  69. void toggleOpenLastProject(bool enabled);
  70. void setLanguage(int lang);
  71. // Performance settings widget.
  72. void setAutoSaveInterval(int time);
  73. void resetAutoSave();
  74. void toggleAutoSave(bool enabled);
  75. void toggleRunningAutoSave(bool enabled);
  76. void toggleSmoothScroll(bool enabled);
  77. void toggleAnimateAFP(bool enabled);
  78. void toggleSyncVSTPlugins(bool enabled);
  79. void vstEmbedMethodChanged();
  80. void toggleVSTAlwaysOnTop(bool en);
  81. void toggleDisableAutoQuit(bool enabled);
  82. // Audio settings widget.
  83. void audioInterfaceChanged(const QString & driver);
  84. void toggleHQAudioDev(bool enabled);
  85. void setBufferSize(int value);
  86. void resetBufferSize();
  87. // MIDI settings widget.
  88. void midiInterfaceChanged(const QString & driver);
  89. // Paths settings widget.
  90. void openWorkingDir();
  91. void setWorkingDir(const QString & workingDir);
  92. void openVSTDir();
  93. void setVSTDir(const QString & vstDir);
  94. void openLADSPADir();
  95. void setLADSPADir(const QString & ladspaDir);
  96. void openSF2Dir();
  97. void setSF2Dir(const QString & sf2Dir);
  98. void openSF2File();
  99. void setSF2File(const QString & sf2File);
  100. void openGIGDir();
  101. void setGIGDir(const QString & gigDir);
  102. void openThemeDir();
  103. void setThemeDir(const QString & themeDir);
  104. void openBackgroundPicFile();
  105. void setBackgroundPicFile(const QString & backgroundPicFile);
  106. void showRestartWarning();
  107. private:
  108. TabBar * m_tabBar;
  109. // General settings widgets.
  110. bool m_displaydBFS;
  111. bool m_tooltips;
  112. bool m_displayWaveform;
  113. bool m_printNoteLabels;
  114. bool m_compactTrackButtons;
  115. bool m_oneInstrumentTrackWindow;
  116. bool m_sideBarOnRight;
  117. bool m_letPreviewsFinish;
  118. bool m_soloLegacyBehavior;
  119. bool m_trackDeletionWarning;
  120. bool m_MMPZ;
  121. bool m_disableBackup;
  122. bool m_openLastProject;
  123. QString m_lang;
  124. QStringList m_languages;
  125. // Performance settings widgets.
  126. int m_saveInterval;
  127. bool m_enableAutoSave;
  128. bool m_enableRunningAutoSave;
  129. QSlider * m_saveIntervalSlider;
  130. QLabel * m_saveIntervalLbl;
  131. LedCheckBox * m_autoSave;
  132. LedCheckBox * m_runningAutoSave;
  133. bool m_smoothScroll;
  134. bool m_animateAFP;
  135. QLabel * m_vstEmbedLbl;
  136. QComboBox* m_vstEmbedComboBox;
  137. QString m_vstEmbedMethod;
  138. LedCheckBox * m_vstAlwaysOnTopCheckBox;
  139. bool m_vstAlwaysOnTop;
  140. bool m_syncVSTPlugins;
  141. bool m_disableAutoQuit;
  142. typedef QMap<QString, AudioDeviceSetupWidget *> AswMap;
  143. typedef QMap<QString, MidiSetupWidget *> MswMap;
  144. typedef QMap<QString, QString> trMap;
  145. // Audio settings widgets.
  146. QComboBox * m_audioInterfaces;
  147. AswMap m_audioIfaceSetupWidgets;
  148. trMap m_audioIfaceNames;
  149. bool m_NaNHandler;
  150. bool m_hqAudioDev;
  151. int m_bufferSize;
  152. QSlider * m_bufferSizeSlider;
  153. QLabel * m_bufferSizeLbl;
  154. // MIDI settings widgets.
  155. QComboBox * m_midiInterfaces;
  156. MswMap m_midiIfaceSetupWidgets;
  157. trMap m_midiIfaceNames;
  158. QComboBox * m_assignableMidiDevices;
  159. // Paths settings widgets.
  160. QString m_workingDir;
  161. QString m_vstDir;
  162. QString m_ladspaDir;
  163. QString m_gigDir;
  164. QString m_sf2Dir;
  165. #ifdef LMMS_HAVE_FLUIDSYNTH
  166. QString m_sf2File;
  167. #endif
  168. QString m_themeDir;
  169. QString m_backgroundPicFile;
  170. QLineEdit * m_workingDirLineEdit;
  171. QLineEdit * m_vstDirLineEdit;
  172. QLineEdit * m_themeDirLineEdit;
  173. QLineEdit * m_ladspaDirLineEdit;
  174. QLineEdit * m_gigDirLineEdit;
  175. QLineEdit * m_sf2DirLineEdit;
  176. #ifdef LMMS_HAVE_FLUIDSYNTH
  177. QLineEdit * m_sf2FileLineEdit;
  178. #endif
  179. QLineEdit * m_backgroundPicFileLineEdit;
  180. QLabel * restartWarningLbl;
  181. };
  182. #endif