@@ -66,15 +66,21 @@ def _do_save_volume(self, config_string):
66
66
return 'Volume not saved!!!'
67
67
ret_strings = ('Volume: already saved...' ,
68
68
'Volume: {}% saved' ,
69
- 'Volume: {}% NOT saved (Error writing file)' )
69
+ 'Volume: {}% NOT saved (Error writing file)' ,
70
+ 'Volume: NOT saved!' )
70
71
log_strings = ('Volume is -1. Aborting...' ,
71
72
'Volume is {}%. Saving...' ,
72
- 'Error saving profile "{}"' )
73
+ 'Error saving profile "{}"' ,
74
+ 'Error saving volume...' )
73
75
if self .volume == - 1 :
74
76
""" inform no change """
75
77
if (logger .isEnabledFor (logging .DEBUG )):
76
78
logger .debug (log_strings [0 ])
77
79
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 ]
78
84
else :
79
85
""" change volume """
80
86
if (logger .isEnabledFor (logging .DEBUG )):
@@ -197,7 +203,6 @@ def updateStatus(self, *args):
197
203
subsystemOut = subsystemOutRaw .decode ("utf-8" , "replace" )
198
204
if subsystemOut == '' :
199
205
break
200
- logger .error ('DE subsystemOut = "{}"' .format (subsystemOut ))
201
206
if not self ._is_accepted_input (subsystemOut ):
202
207
continue
203
208
subsystemOut = subsystemOut .strip ()
@@ -347,14 +352,10 @@ def play(self, name, streamUrl, encoding = ''):
347
352
logger .error ("playback detection thread start failed" )
348
353
if logger .isEnabledFor (logging .INFO ):
349
354
logger .info ("Player started" )
350
- if self .process and self .PLAYER_CMD == 'mpv' :
351
- self ._sendCommand ('{ "command": ["observe_property", 1, "volume"] }' )
352
355
353
356
def _sendCommand (self , command ):
354
357
""" send keystroke command to player """
355
358
356
- logger .error ('DE command to execute: "{}"' .format (command ))
357
-
358
359
if (self .process is not None ):
359
360
try :
360
361
if logger .isEnabledFor (logging .DEBUG ):
@@ -433,7 +434,6 @@ def _get_volume(self):
433
434
def volumeUp (self ):
434
435
""" increase volume """
435
436
if self .muted is not True :
436
- logger .error ('DE self._volumeUp' )
437
437
self ._volume_up ()
438
438
439
439
def _volume_up (self ):
@@ -502,6 +502,8 @@ class MpvPlayer(Player):
502
502
def save_volume (self ):
503
503
""" Saving Volume in Windows does not work;
504
504
Profiles not supported... """
505
+ if int (self .volume ) > 999 :
506
+ self .volume = - 2
505
507
return self ._do_save_volume ("[pyradio]\n volume={}\n " )
506
508
507
509
def _configHasProfile (self ):
@@ -572,9 +574,7 @@ def _stop(self):
572
574
573
575
def _volume_up (self ):
574
576
""" increase mpv's volume """
575
- logger .error ('DE mpv volume up' )
576
577
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" );
578
578
579
579
def _volume_down (self ):
580
580
""" decrease mpv's volume """
0 commit comments