INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: [MCWS] Playback/Mute switches mute off if called without parameter  (Read 508 times)

DrKNo

  • World Citizen
  • ***
  • Posts: 201

I hope I'm not making eyes roll with my constant posts right now. I will be working normally again next week, I'll promise ill be quieter then  ;D

So, I think Playback mute changes the state of mute when called without parameter (When it should only return the value). Just to get an idea of what's happening: I'm turning on mute, test the return value of that call (True), then look at the result from playback/info (VolumeDisplay should be "Muted"), and then call playback/mute without parameter to return the state. The last calls consistently returns False ("0") for me. Please note that the return values here are auto converted to true false, while MCWS returns 1 or 0.

Code: [Select]
       
self.assertEqual(self.server.playback.mute(True), True)    # Set mute to True ('1'), and test proper return value
time.sleep(5)       # wait 5 seconds to make sure JRiver has time to update it's state
print(self.server.playback.info())      # Check what playback info has to say (VolumeDisplay: "Muted")
self.assertEqual(self.server.playback.mute(), True)      # Check fails, mcws returns "False"

So what's happening with the requests?

Code: [Select]
.http://192.168.178.45:52199/MCWS/v1/Playback/Mute?Set=1
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Response Status="OK">
<Item Name="State">1</Item>
</Response>

{ [..] 'Volume': 1, 'VolumeDisplay': 'Muted', [...]}

http://192.168.178.45:52199/MCWS/v1/Playback/Mute
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Response Status="OK">
<Item Name="State">0</Item>
</Response>

So while the initial call returns the expected value, and the display info does too, the last call returns "False" again.
Watching JRiver, the GUI turns mute on as expected, but turns it off after the parameterless call to playback/mute. So I assume the missing value is interpreted as False?

Aaaaaaand finally, after debugging and writing this, I took a look again at the API documentation, and see that the behavior differs from playback/repeat. Is this intended behavior? It would be nice to be able to check the mute status directly. If this is intended, I can just reroute the call to playback/info and test for the DisplayVolume field.

PS: The server this was tested on was the current Raspberry package.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10710
Re: [MCWS] Playback/Mute switches mute off if called without parameter
« Reply #1 on: August 19, 2020, 04:34:37 am »

This is intended behavior.
I mean, the description of Playback/Mute does read "Set the mute.". :)
Logged
~ nevcairiel
~ Author of LAV Filters

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: [MCWS] Playback/Mute switches mute off if called without parameter
« Reply #2 on: August 19, 2020, 05:52:54 am »

Alright, thank you, Hendrick! :)
Logged
Pages: [1]   Go Up