@@ -66,15 +66,21 @@ def _do_save_volume(self, config_string):
6666 return 'Volume not saved!!!'
6767 ret_strings = ('Volume: already saved...' ,
6868 'Volume: {}% saved' ,
69- 'Volume: {}% NOT saved (Error writing file)' )
69+ 'Volume: {}% NOT saved (Error writing file)' ,
70+ 'Volume: NOT saved!' )
7071 log_strings = ('Volume is -1. Aborting...' ,
7172 'Volume is {}%. Saving...' ,
72- 'Error saving profile "{}"' )
73+ 'Error saving profile "{}"' ,
74+ 'Error saving volume...' )
7375 if self .volume == - 1 :
7476 """ inform no change """
7577 if (logger .isEnabledFor (logging .DEBUG )):
7678 logger .debug (log_strings [0 ])
7779 return ret_strings [0 ]
80+ elif self .volume == - 2 :
81+ if (logger .isEnabledFor (logging .DEBUG )):
82+ logger .debug (log_strings [3 ])
83+ return ret_strings [3 ]
7884 else :
7985 """ change volume """
8086 if (logger .isEnabledFor (logging .DEBUG )):
@@ -197,7 +203,6 @@ def updateStatus(self, *args):
197203 subsystemOut = subsystemOutRaw .decode ("utf-8" , "replace" )
198204 if subsystemOut == '' :
199205 break
200- logger .error ('DE subsystemOut = "{}"' .format (subsystemOut ))
201206 if not self ._is_accepted_input (subsystemOut ):
202207 continue
203208 subsystemOut = subsystemOut .strip ()
@@ -347,14 +352,10 @@ def play(self, name, streamUrl, encoding = ''):
347352 logger .error ("playback detection thread start failed" )
348353 if logger .isEnabledFor (logging .INFO ):
349354 logger .info ("Player started" )
350- if self .process and self .PLAYER_CMD == 'mpv' :
351- self ._sendCommand ('{ "command": ["observe_property", 1, "volume"] }' )
352355
353356 def _sendCommand (self , command ):
354357 """ send keystroke command to player """
355358
356- logger .error ('DE command to execute: "{}"' .format (command ))
357-
358359 if (self .process is not None ):
359360 try :
360361 if logger .isEnabledFor (logging .DEBUG ):
@@ -433,7 +434,6 @@ def _get_volume(self):
433434 def volumeUp (self ):
434435 """ increase volume """
435436 if self .muted is not True :
436- logger .error ('DE self._volumeUp' )
437437 self ._volume_up ()
438438
439439 def _volume_up (self ):
@@ -502,6 +502,8 @@ class MpvPlayer(Player):
502502 def save_volume (self ):
503503 """ Saving Volume in Windows does not work;
504504 Profiles not supported... """
505+ if int (self .volume ) > 999 :
506+ self .volume = - 2
505507 return self ._do_save_volume ("[pyradio]\n volume={}\n " )
506508
507509 def _configHasProfile (self ):
@@ -572,9 +574,7 @@ def _stop(self):
572574
573575 def _volume_up (self ):
574576 """ increase mpv's volume """
575- logger .error ('DE mpv volume up' )
576577 os .system ("echo 'cycle volume' | socat - " + self .mpvsocket + " 2>/dev/null" );
577- os .system ("echo '{ \" command\" : [\" get_property\" , \" volume\" ] }' | socat - " + self .mpvsocket + " 2>/dev/null" );
578578
579579 def _volume_down (self ):
580580 """ decrease mpv's volume """
0 commit comments