リビジョン | 5093ceb887e8e922d05de50e5eeb0fcc3dc351e7 (tree) |
---|---|
日時 | 2014-05-17 18:14:33 |
作者 | alucky4416 <alucky4416@user...> |
コミッター | alucky4416 |
feature: add SoundVolume. and load/save SoundVolumeLevel.
@@ -75,6 +75,10 @@ MainWindow::MainWindow(QWidget *parent) : | ||
75 | 75 | // this, SLOT(slot_calc_end(QString))); |
76 | 76 | ThPlayMusic->start(); |
77 | 77 | |
78 | + float vlmlevel = ThPlayMusic->GetSoundVolume() * 100.0; | |
79 | + // qDebug() << "vlmlevel=" << vlmlevel ; | |
80 | + ui->hSlider_Volume->setValue((int)vlmlevel); | |
81 | + | |
78 | 82 | // ScheduleManager Thread |
79 | 83 | ThSchMngr = new ThSchManager(this); |
80 | 84 | connect(ThSchMngr, SIGNAL(sig_notify_nexttime(QString)), |
@@ -121,6 +125,9 @@ void MainWindow::LoadSaveSetting(QString filepath, bool store = false) | ||
121 | 125 | // Exclude AutoStart flag |
122 | 126 | settings.setValue("SETTING/AUTO_START", ui->checkBox_AutoStart->isChecked()); |
123 | 127 | |
128 | + // Sound Volume Level | |
129 | + settings.setValue("SETTING/VOLUME_LEVEL", ui->hSlider_Volume->value()); | |
130 | + | |
124 | 131 | // Exclude SS flag |
125 | 132 | settings.setValue("SETTING/EXCLUDE_SS", ui->checkBox_Exclude_SS->isChecked()); |
126 | 133 |
@@ -144,6 +151,9 @@ void MainWindow::LoadSaveSetting(QString filepath, bool store = false) | ||
144 | 151 | // Exclude AutoStart flag |
145 | 152 | ui->checkBox_AutoStart->setChecked(settings.value("SETTING/AUTO_START", false).toBool()); |
146 | 153 | |
154 | + // Sound Volume Level | |
155 | + ui->hSlider_Volume->setValue((settings.value("SETTING/VOLUME_LEVEL", 10).toInt())); | |
156 | + | |
147 | 157 | // Exclude SS flag |
148 | 158 | ui->checkBox_Exclude_SS->setChecked(settings.value("SETTING/EXCLUDE_SS", true).toBool()); |
149 | 159 |
@@ -399,3 +409,13 @@ void MainWindow::on_lineEdit_FilePath_textChanged(const QString &arg1) | ||
399 | 409 | ui->pushButton_TestPlay->setEnabled(true); |
400 | 410 | } |
401 | 411 | } |
412 | + | |
413 | +void MainWindow::on_hSlider_Volume_valueChanged(int value) | |
414 | +{ | |
415 | + float volume = value / 100.0; | |
416 | + ThPlayMusic->SetSoundVolume(volume); | |
417 | +#if 0 | |
418 | + volume = ThPlayMusic->GetSoundVolume() * 100.0; | |
419 | + qDebug() << "Volume" << volume; | |
420 | +#endif | |
421 | +} |
@@ -48,6 +48,8 @@ private slots: | ||
48 | 48 | |
49 | 49 | void on_lineEdit_FilePath_textChanged(const QString &arg1); |
50 | 50 | |
51 | + void on_hSlider_Volume_valueChanged(int value); | |
52 | + | |
51 | 53 | private: |
52 | 54 | Ui::MainWindow *ui; |
53 | 55 | QLabel *statusbar_label_status; |
@@ -35,7 +35,7 @@ | ||
35 | 35 | </property> |
36 | 36 | <property name="geometry"> |
37 | 37 | <rect> |
38 | - <x>130</x> | |
38 | + <x>120</x> | |
39 | 39 | <y>270</y> |
40 | 40 | <width>121</width> |
41 | 41 | <height>41</height> |
@@ -64,8 +64,8 @@ | ||
64 | 64 | </property> |
65 | 65 | <property name="geometry"> |
66 | 66 | <rect> |
67 | - <x>290</x> | |
68 | - <y>240</y> | |
67 | + <x>300</x> | |
68 | + <y>230</y> | |
69 | 69 | <width>51</width> |
70 | 70 | <height>23</height> |
71 | 71 | </rect> |
@@ -117,7 +117,7 @@ | ||
117 | 117 | <property name="geometry"> |
118 | 118 | <rect> |
119 | 119 | <x>20</x> |
120 | - <y>200</y> | |
120 | + <y>190</y> | |
121 | 121 | <width>121</width> |
122 | 122 | <height>20</height> |
123 | 123 | </rect> |
@@ -216,7 +216,7 @@ | ||
216 | 216 | <property name="geometry"> |
217 | 217 | <rect> |
218 | 218 | <x>20</x> |
219 | - <y>220</y> | |
219 | + <y>210</y> | |
220 | 220 | <width>321</width> |
221 | 221 | <height>20</height> |
222 | 222 | </rect> |
@@ -226,7 +226,7 @@ | ||
226 | 226 | <property name="geometry"> |
227 | 227 | <rect> |
228 | 228 | <x>340</x> |
229 | - <y>220</y> | |
229 | + <y>210</y> | |
230 | 230 | <width>21</width> |
231 | 231 | <height>18</height> |
232 | 232 | </rect> |
@@ -238,8 +238,8 @@ | ||
238 | 238 | <widget class="QCheckBox" name="checkBox_AutoStart"> |
239 | 239 | <property name="geometry"> |
240 | 240 | <rect> |
241 | - <x>20</x> | |
242 | - <y>240</y> | |
241 | + <x>120</x> | |
242 | + <y>320</y> | |
243 | 243 | <width>191</width> |
244 | 244 | <height>18</height> |
245 | 245 | </rect> |
@@ -251,6 +251,32 @@ | ||
251 | 251 | <bool>false</bool> |
252 | 252 | </property> |
253 | 253 | </widget> |
254 | + <widget class="QSlider" name="hSlider_Volume"> | |
255 | + <property name="geometry"> | |
256 | + <rect> | |
257 | + <x>80</x> | |
258 | + <y>230</y> | |
259 | + <width>211</width> | |
260 | + <height>23</height> | |
261 | + </rect> | |
262 | + </property> | |
263 | + <property name="orientation"> | |
264 | + <enum>Qt::Horizontal</enum> | |
265 | + </property> | |
266 | + </widget> | |
267 | + <widget class="QLabel" name="label_3"> | |
268 | + <property name="geometry"> | |
269 | + <rect> | |
270 | + <x>20</x> | |
271 | + <y>230</y> | |
272 | + <width>51</width> | |
273 | + <height>20</height> | |
274 | + </rect> | |
275 | + </property> | |
276 | + <property name="text"> | |
277 | + <string>Volume</string> | |
278 | + </property> | |
279 | + </widget> | |
254 | 280 | </widget> |
255 | 281 | <widget class="QMenuBar" name="menuBar"> |
256 | 282 | <property name="geometry"> |
@@ -258,7 +284,7 @@ | ||
258 | 284 | <x>0</x> |
259 | 285 | <y>0</y> |
260 | 286 | <width>407</width> |
261 | - <height>20</height> | |
287 | + <height>18</height> | |
262 | 288 | </rect> |
263 | 289 | </property> |
264 | 290 | <widget class="QMenu" name="menuFile"> |