04-21-2023, 01:36 PM
1. What does songid point at and under what conditions does it get updated?
MPD maintains two identifiers (song and songid) for an item in the Queue thats playing or stopped and they are reported in the output of the MPD 'status' command.
song - indicates the position of the item in the Queue starting from 0. The value changes each time the item assumes a new position in the Queue.
songid is assigned to each item in the Queue starting at 1 and never changes.
2. If I wished to always start with the same radio stream after restart regardless of what was playing at shutdown, can I just pass that stream into the sendMpdCmd function somehow instead?
Not really because MPD playback commands operate on Queue item identifiers, either 'song' or 'pongid'. This means that the playable URL has to be first loaded into the Queue, then its song or songid identifier retrieved and then finally play [song | songid]. Another option is to clear the Queue first then the added item will always be at song = 0 or songid = 1.
To troubleshoot try turning off Autoplay then examine MPD status via telnet while player is running and then after the "turn off radio via the wall switch" followed by power up.
MPD maintains two identifiers (song and songid) for an item in the Queue thats playing or stopped and they are reported in the output of the MPD 'status' command.
Code:
telnet localhost 6600
status
song - indicates the position of the item in the Queue starting from 0. The value changes each time the item assumes a new position in the Queue.
songid is assigned to each item in the Queue starting at 1 and never changes.
2. If I wished to always start with the same radio stream after restart regardless of what was playing at shutdown, can I just pass that stream into the sendMpdCmd function somehow instead?
Not really because MPD playback commands operate on Queue item identifiers, either 'song' or 'pongid'. This means that the playable URL has to be first loaded into the Queue, then its song or songid identifier retrieved and then finally play [song | songid]. Another option is to clear the Queue first then the added item will always be at song = 0 or songid = 1.
To troubleshoot try turning off Autoplay then examine MPD status via telnet while player is running and then after the "turn off radio via the wall switch" followed by power up.