SetupDialog.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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 toggleMMPZ(bool enabled);
  64. void toggleDisableBackup(bool enabled);
  65. void toggleOpenLastProject(bool enabled);
  66. void setLanguage(int lang);
  67. // Performance settings widget.
  68. void setAutoSaveInterval(int time);
  69. void resetAutoSave();
  70. void toggleAutoSave(bool enabled);
  71. void toggleRunningAutoSave(bool enabled);
  72. void toggleSmoothScroll(bool enabled);
  73. void toggleAnimateAFP(bool enabled);
  74. void toggleSyncVSTPlugins(bool enabled);
  75. void vstEmbedMethodChanged();
  76. void toggleVSTAlwaysOnTop(bool en);
  77. void toggleDisableAutoQuit(bool enabled);
  78. // Audio settings widget.
  79. void audioInterfaceChanged(const QString & driver);
  80. void toggleHQAudioDev(bool enabled);
  81. void setBufferSize(int value);
  82. void resetBufferSize();
  83. // MIDI settings widget.
  84. void midiInterfaceChanged(const QString & driver);
  85. // Paths settings widget.
  86. void openWorkingDir();
  87. void setWorkingDir(const QString & workingDir);
  88. void openVSTDir();
  89. void setVSTDir(const QString & vstDir);
  90. void openLADSPADir();
  91. void setLADSPADir(const QString & ladspaDir);
  92. void openSF2Dir();
  93. void setSF2Dir(const QString & sf2Dir);
  94. void openSF2File();
  95. void setSF2File(const QString & sf2File);
  96. void openGIGDir();
  97. void setGIGDir(const QString & gigDir);
  98. void openThemeDir();
  99. void setThemeDir(const QString & themeDir);
  100. void openBackgroundPicFile();
  101. void setBackgroundPicFile(const QString & backgroundPicFile);
  102. void showRestartWarning();
  103. private:
  104. TabBar * m_tabBar;
  105. // General settings widgets.
  106. bool m_displaydBFS;
  107. bool m_tooltips;
  108. bool m_displayWaveform;
  109. bool m_printNoteLabels;
  110. bool m_compactTrackButtons;
  111. bool m_oneInstrumentTrackWindow;
  112. bool m_MMPZ;
  113. bool m_disableBackup;
  114. bool m_openLastProject;
  115. QString m_lang;
  116. QStringList m_languages;
  117. // Performance settings widgets.
  118. int m_saveInterval;
  119. bool m_enableAutoSave;
  120. bool m_enableRunningAutoSave;
  121. QSlider * m_saveIntervalSlider;
  122. QLabel * m_saveIntervalLbl;
  123. LedCheckBox * m_autoSave;
  124. LedCheckBox * m_runningAutoSave;
  125. bool m_smoothScroll;
  126. bool m_animateAFP;
  127. QLabel * m_vstEmbedLbl;
  128. QComboBox* m_vstEmbedComboBox;
  129. QString m_vstEmbedMethod;
  130. LedCheckBox * m_vstAlwaysOnTopCheckBox;
  131. bool m_vstAlwaysOnTop;
  132. bool m_syncVSTPlugins;
  133. bool m_disableAutoQuit;
  134. typedef QMap<QString, AudioDeviceSetupWidget *> AswMap;
  135. typedef QMap<QString, MidiSetupWidget *> MswMap;
  136. typedef QMap<QString, QString> trMap;
  137. // Audio settings widgets.
  138. QComboBox * m_audioInterfaces;
  139. AswMap m_audioIfaceSetupWidgets;
  140. trMap m_audioIfaceNames;
  141. bool m_NaNHandler;
  142. bool m_hqAudioDev;
  143. int m_bufferSize;
  144. QSlider * m_bufferSizeSlider;
  145. QLabel * m_bufferSizeLbl;
  146. // MIDI settings widgets.
  147. QComboBox * m_midiInterfaces;
  148. MswMap m_midiIfaceSetupWidgets;
  149. trMap m_midiIfaceNames;
  150. // Paths settings widgets.
  151. QString m_workingDir;
  152. QString m_vstDir;
  153. QString m_ladspaDir;
  154. QString m_gigDir;
  155. QString m_sf2Dir;
  156. #ifdef LMMS_HAVE_FLUIDSYNTH
  157. QString m_sf2File;
  158. #endif
  159. QString m_themeDir;
  160. QString m_backgroundPicFile;
  161. QLineEdit * m_workingDirLineEdit;
  162. QLineEdit * m_vstDirLineEdit;
  163. QLineEdit * m_themeDirLineEdit;
  164. QLineEdit * m_ladspaDirLineEdit;
  165. QLineEdit * m_gigDirLineEdit;
  166. QLineEdit * m_sf2DirLineEdit;
  167. #ifdef LMMS_HAVE_FLUIDSYNTH
  168. QLineEdit * m_sf2FileLineEdit;
  169. #endif
  170. QLineEdit * m_backgroundPicFileLineEdit;
  171. QLabel * restartWarningLbl;
  172. };
  173. #endif