MCPcopy Create free account
hub / github.com/clangen/musikcube / BuildPlaybackOverview

Method BuildPlaybackOverview

src/plugins/server/WebSocketServer.cpp:1611–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1609}
1610
1611void 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
1629void WebSocketServer::OnOpen(connection_hdl connection) {
1630 auto wl = connectionLock.Write();

Callers 2

Calls 13

ReadTrackMetadataMethod · 0.95
GetRepeatModeMethod · 0.80
IsShuffledMethod · 0.80
GetPlayingTrackMethod · 0.80
findMethod · 0.45
GetPlaybackStateMethod · 0.45
GetVolumeMethod · 0.45
IsMutedMethod · 0.45
CountMethod · 0.45
GetIndexMethod · 0.45
GetDurationMethod · 0.45
GetPositionMethod · 0.45

Tested by

no test coverage detected