CONF_ENTRY_ANNOUNCE_VOLUME_STRATEGY,
CONF_ENTRY_PLAYER_ICON,
CONF_ENTRY_PLAYER_ICON_GROUP,
- CONF_ENTRY_TTS_PRE_ANNOUNCE,
)
from music_assistant.common.models.enums import (
EventType,
CONF_GROUP_MEMBERS,
CONF_HIDE_PLAYER,
CONF_PLAYERS,
+ CONF_TTS_PRE_ANNOUNCE,
SYNCGROUP_PREFIX,
)
from music_assistant.server.helpers.api import api_command
- player_id: player_id of the player to handle the command.
"""
+ player = self.get(player_id, True)
+ # Always prefer queue controller's stop (as it also handles some other logic)
+ if player.active_source == player_id:
+ await self.mass.player_queues.stop(player_id)
+ return
+ # if the player doesn't have our queue controller active, forward the stop command
player_id = self._check_redirect(player_id)
if player_provider := self.get_player_provider(player_id):
await player_provider.cmd_stop(player_id)
- player_id: player_id of the player to handle the command.
"""
+ player = self.get(player_id, True)
+ # Always prefer queue controller's play (as it also handles some other logic)
+ if player.active_source == player_id:
+ await self.mass.player_queues.play(player_id)
+ return
+ # if the player doesn't have our queue controller active, forward the stop command
player_id = self._check_redirect(player_id)
player_provider = self.get_player_provider(player_id)
await player_provider.cmd_play(player_id)
- player_id: player_id of the player to handle the command.
"""
+ player = self.get(player_id, True)
+ # Always prefer queue controller's pause (as it also handles some other logic)
+ if player.active_source == player_id:
+ await self.mass.player_queues.pause(player_id)
+ return
player_id = self._check_redirect(player_id)
player = self.get(player_id, True)
if PlayerFeature.PAUSE not in player.supported_features:
return
# determine pre-announce from (group)player config
if use_pre_announce is None and "tts" in url:
- use_pre_announce = self.mass.config.get_raw_player_config_value(
+ use_pre_announce = await self.mass.config.get_player_config_value(
player_id,
- CONF_ENTRY_TTS_PRE_ANNOUNCE.key,
- CONF_ENTRY_TTS_PRE_ANNOUNCE.default_value,
+ CONF_TTS_PRE_ANNOUNCE,
)
self.logger.info(
"Playback announcement to player %s (with pre-announce: %s): %s",
last_fadeout_part = b""
queue.flow_mode = True
queue.stream_finished = False
- use_crossfade = self.mass.config.get_raw_player_config_value(
- queue.queue_id, CONF_CROSSFADE, False
+ use_crossfade = await self.mass.config.get_player_config_value(
+ queue.queue_id, CONF_CROSSFADE
)
if start_queue_item.media_type != MediaType.TRACK:
use_crossfade = False
# set some basic vars
pcm_sample_size = int(pcm_format.sample_rate * (pcm_format.bit_depth / 8) * 2)
- crossfade_duration = self.mass.config.get_raw_player_config_value(
- queue.queue_id, CONF_CROSSFADE_DURATION, 8
+ crossfade_duration = await self.mass.config.get_player_config_value(
+ queue.queue_id, CONF_CROSSFADE_DURATION
)
crossfade_size = int(pcm_sample_size * crossfade_duration)
bytes_written = 0
),
ConfigEntry(
key=CONF_PASSWORD,
- type=ConfigEntryType.STRING,
+ type=ConfigEntryType.SECURE_STRING,
label="Password to use to connect to the Fully Kiosk API.",
required=True,
),
volume = volume_dict[str(AUDIOMANAGER_STREAM_MUSIC)]
player.volume_level = volume
break
- player.current_item_id = self._fully.deviceInfo.get("soundUrlPlaying")
+ current_url = self._fully.deviceInfo.get("soundUrlPlaying")
+ player.current_item_id = current_url
+ if not current_url:
+ player.state = PlayerState.IDLE
player.available = True
self.mass.players.update(player_id)