Skip to content

Commit

Permalink
speed up #477
Browse files Browse the repository at this point in the history
  • Loading branch information
MiczFlor committed Feb 14, 2019
2 parents 0506bec + fb5c069 commit 27b4a3c
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 88 deletions.
2 changes: 2 additions & 0 deletions htdocs/inc.header.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@

// read the global conf file
$globalConf = parse_ini_file($conf['settings_abs']."/global.conf", $process_sections = null);
//print "<pre>"; print_r($globalConf); print "</pre>"; //???
// assign the values from the global conf file to the vars in PHP
$Audio_Folders_Path = $globalConf['AUDIOFOLDERSPATH'];
$Second_Swipe = $globalConf['SECONDSWIPE'];
$ShowCover = $globalConf['SHOWCOVER'];
$version = $globalConf['VERSION'];
$edition = $globalConf['EDITION'];
$maxvolumevalue = $globalConf['AUDIOVOLMAXLIMIT'];
$conf['settings_lang'] = $globalConf['LANG'];

// vars that must be read continuously and can't be in the global conf file
Expand Down
2 changes: 1 addition & 1 deletion htdocs/inc.setMaxVolume.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-->
<!-- input-group -->
<?php
$maxvolumevalue = exec("/usr/bin/sudo ".$conf['scripts_abs']."/playout_controls.sh -c=getmaxvolume");
//$maxvolumevalue = exec("/usr/bin/sudo ".$conf['scripts_abs']."/playout_controls.sh -c=getmaxvolume");
//$maxvolumevalue = 43.6;//debug
$maxvalueselect = round(($maxvolumevalue/5))*5;
$maxvaluedisplay = round($maxvolumevalue);
Expand Down
8 changes: 4 additions & 4 deletions htdocs/inc.setVolume.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$volumevalueselect = round(($volumevalue/5))*5;
$volumevaluedisplay = round($volumevalue);

$maxvolumevalue = exec("/usr/bin/sudo ".$conf['scripts_abs']."/playout_controls.sh -c=getmaxvolume");
//$maxvolumevalue = exec("/usr/bin/sudo ".$conf['scripts_abs']."/playout_controls.sh -c=getmaxvolume");
$maxvalueselect = round(($maxvolumevalue/5))*5;
$maxvaluedisplay = round($maxvolumevalue);
?>
Expand All @@ -27,11 +27,11 @@
if($volumevalueselect == $i) {
print " selected";
}
if($i > $maxvalueselect ) {
if($i > $maxvalueselect ) {
print " disabled";
}
print ">".$i."%";
if($i == $maxvalueselect ) {
print ">".$i."%";
if($i == $maxvalueselect ) {
print " limit";
}
print "</option>";
Expand Down
13 changes: 13 additions & 0 deletions scripts/inc.writeGlobalConfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ fi
# 2. then|or read value from file
AUDIOVOLMINLIMIT=`cat $PATHDATA/../settings/Min_Volume_Limit`

##############################################
# Change_Volume_Idle
# Change volume during idle (or only change it during Play and in the WebApp)
#TRUE=Change Volume during all Time (Default; FALSE=Change Volume only during "Play"; OnlyDown=It is possible to decrease Volume during Idle; OnlyUp=It is possible to increase Volume during Idle
# 1. create a default if file does not exist (set default do TRUE - Volume Change is possible every time)
if [ ! -f $PATHDATA/../settings/Change_Volume_Idle ]; then
echo "TRUE" > $PATHDATA/../settings/Change_Volume_Idle
fi
# 2. then|or read value from file
VOLCHANGEIDLE=`cat $PATHDATA/../settings/Change_Volume_Idle`

##############################################
# Idle_Time_Before_Shutdown
# 1. create a default if file does not exist
Expand Down Expand Up @@ -157,6 +168,7 @@ VERSION=`cat $PATHDATA/../settings/version`
# AUDIOVOLCHANGESTEP
# AUDIOVOLMAXLIMIT
# AUDIOVOLMINLIMIT
# VOLCHANGEIDLE
# IDLETIMESHUTDOWN
# SHOWCOVER
# EDITION
Expand All @@ -173,6 +185,7 @@ echo "AUDIOIFACENAME=\"${AUDIOIFACENAME}\"" >> "${PATHDATA}/../settings/global.c
echo "AUDIOVOLCHANGESTEP=\"${AUDIOVOLCHANGESTEP}\"" >> "${PATHDATA}/../settings/global.conf"
echo "AUDIOVOLMAXLIMIT=\"${AUDIOVOLMAXLIMIT}\"" >> "${PATHDATA}/../settings/global.conf"
echo "AUDIOVOLMINLIMIT=\"${AUDIOVOLMINLIMIT}\"" >> "${PATHDATA}/../settings/global.conf"
echo "VOLCHANGEIDLE=\"${VOLCHANGEIDLE}\"" >> "${PATHDATA}/../settings/global.conf"
echo "IDLETIMESHUTDOWN=\"${IDLETIMESHUTDOWN}\"" >> "${PATHDATA}/../settings/global.conf"
echo "SHOWCOVER=\"${SHOWCOVER}\"" >> "${PATHDATA}/../settings/global.conf"
echo "EDITION=\"${EDITION}\"" >> "${PATHDATA}/../settings/global.conf"
Expand Down
Loading

0 comments on commit 27b4a3c

Please sign in to comment.