clang-format

custom
jacqueline 8 months ago committed by cooljqln
parent 9ec8d6dafc
commit 32869129ff
  1. 3
      src/tangara/audio/audio_events.hpp
  2. 6
      src/tangara/audio/audio_fsm.cpp
  3. 6
      src/tangara/audio/track_queue.cpp

@ -119,7 +119,8 @@ struct SetVolumeBalance : tinyfsm::Event {
}; };
/* /*
Event emitted when the hardware volume for a connected Bluetooth device has changed. Event emitted when the hardware volume for a connected Bluetooth device has
changed.
*/ */
struct RemoteVolumeChanged : tinyfsm::Event { struct RemoteVolumeChanged : tinyfsm::Event {
uint_fast8_t value; // 0..127 uint_fast8_t value; // 0..127

@ -237,10 +237,12 @@ void AudioState::react(const internal::StreamEnded& ev) {
void AudioState::react(const system_fsm::HasPhonesChanged& ev) { void AudioState::react(const system_fsm::HasPhonesChanged& ev) {
if (ev.has_headphones) { if (ev.has_headphones) {
events::Audio().Dispatch(audio::OutputModeChanged{.set_to = drivers::NvsStorage::Output::kHeadphones}); events::Audio().Dispatch(audio::OutputModeChanged{
.set_to = drivers::NvsStorage::Output::kHeadphones});
} else { } else {
if (sServices->bluetooth().enabled()) { if (sServices->bluetooth().enabled()) {
events::Audio().Dispatch(audio::OutputModeChanged{.set_to = drivers::NvsStorage::Output::kBluetooth}); events::Audio().Dispatch(audio::OutputModeChanged{
.set_to = drivers::NvsStorage::Output::kBluetooth});
} }
} }
} }

@ -138,7 +138,8 @@ auto TrackQueue::open() -> bool {
return playlist_.open(); return playlist_.open();
} }
auto TrackQueue::openPlaylist(const std::string& playlist_file, bool notify) -> bool { auto TrackQueue::openPlaylist(const std::string& playlist_file, bool notify)
-> bool {
opened_playlist_.emplace(playlist_file); opened_playlist_.emplace(playlist_file);
auto res = opened_playlist_->open(); auto res = opened_playlist_->open();
if (!res) { if (!res) {
@ -414,7 +415,8 @@ cppbor::ParseClient* TrackQueue::QueueParseClient::item(
i_ = 0; i_ = 0;
} else if (item->type() == cppbor::UINT) { } else if (item->type() == cppbor::UINT) {
auto val = item->asUint()->unsignedValue(); auto val = item->asUint()->unsignedValue();
// Save the position so we can apply it later when we have finished serialising // Save the position so we can apply it later when we have finished
// serialising
position_to_set_ = val; position_to_set_ = val;
} else if (item->type() == cppbor::TSTR) { } else if (item->type() == cppbor::TSTR) {
auto val = item->asTstr(); auto val = item->asTstr();

Loading…
Cancel
Save