Skip to content

Commit 1939b01

Browse files
committed
Add updAlsaVolume() to snd-config and ren-config
This ensures that current ALSA volume is available to these configs for example after first boot.
1 parent 3eda13d commit 1939b01

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

www/inc/alsa.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ function getAlsaVolumeDb($mixerName) {
100100
return $alsaVolume;
101101
}
102102

103+
function updAlsaVolume($mixerName) {
104+
$result = getAlsaVolume($mixerName);
105+
phpSession('write', 'alsavolume', $result);
106+
}
107+
103108
// Get ALSA card ID's
104109
function getAlsaCardIDs() {
105110
$cardIDs = array();

www/ren-config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
* Copyright 2014 The moOde audio player project / Tim Curtis
55
*/
66

7+
require_once __DIR__ . '/inc/alsa.php';
78
require_once __DIR__ . '/inc/common.php';
89
require_once __DIR__ . '/inc/network.php';
910
require_once __DIR__ . '/inc/session.php';
1011

1112
phpSession('open');
13+
updAlsaVolume($_SESSION['amixname']);
1214

1315
chkVariables($_POST);
1416

www/snd-config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
require_once __DIR__ . '/inc/sql.php';
1515

1616
phpSession('open');
17+
updAlsaVolume($_SESSION['amixname']);
1718
$dbh = sqlConnect();
1819
$cdsp = new CamillaDsp($_SESSION['camilladsp'], $_SESSION['cardnum'], $_SESSION['camilladsp_quickconv']);
1920
$deviceNames = getAlsaDeviceNames();

0 commit comments

Comments
 (0)