| 1609 | } |
| 1610 | |
| 1611 | void WebSocketServer::BuildPlaybackOverview(json& options) { |
| 1612 | options[key::state] = PLAYBACK_STATE_TO_STRING.find(context.playback->GetPlaybackState())->second; |
| 1613 | options[key::repeat_mode] = REPEAT_MODE_TO_STRING.find(context.playback->GetRepeatMode())->second; |
| 1614 | options[key::volume] = context.playback->GetVolume(); |
| 1615 | options[key::shuffled] = context.playback->IsShuffled(); |
| 1616 | options[key::muted] = context.playback->IsMuted(); |
| 1617 | options[key::play_queue_count] = context.playback->Count(); |
| 1618 | options[key::play_queue_position] = context.playback->GetIndex(); |
| 1619 | options[key::playing_duration] = context.playback->GetDuration(); |
| 1620 | options[key::playing_current_time] = context.playback->GetPosition(); |
| 1621 | |
| 1622 | ITrack* track = context.playback->GetPlayingTrack(); |
| 1623 | if (track) { |
| 1624 | options[key::playing_track] = this->ReadTrackMetadata(track); |
| 1625 | track->Release(); |
| 1626 | } |
| 1627 | } |
| 1628 | |
| 1629 | void WebSocketServer::OnOpen(connection_hdl connection) { |
| 1630 | auto wl = connectionLock.Write(); |
no test coverage detected