summaryrefslogtreecommitdiff
path: root/src/ui/screen_playing.cpp
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2023-08-28 14:59:52 +1000
committerailurux <ailuruxx@gmail.com>2023-08-28 14:59:52 +1000
commitdb601935c6145445467692c0a4ff2b81e27cf6ce (patch)
treee2eed4a38abd03f14dba504ce5e8dedee0da6a12 /src/ui/screen_playing.cpp
parent6f4ace1dd4b9b34f95af1ba365b68624e209d147 (diff)
parent3a0c42f9240eedfbc6a1e94ad3a59c52664fb5b5 (diff)
downloadtangara-fw-db601935c6145445467692c0a4ff2b81e27cf6ce.tar.gz
Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw
Diffstat (limited to 'src/ui/screen_playing.cpp')
-rw-r--r--src/ui/screen_playing.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ui/screen_playing.cpp b/src/ui/screen_playing.cpp
index ce0f71d6..7538d093 100644
--- a/src/ui/screen_playing.cpp
+++ b/src/ui/screen_playing.cpp
@@ -8,6 +8,7 @@
#include <sys/_stdint.h>
#include <memory>
+#include "audio_events.hpp"
#include "core/lv_event.h"
#include "core/lv_obj.h"
#include "core/lv_obj_scroll.h"
@@ -63,6 +64,10 @@ static void below_fold_focus_cb(lv_event_t* ev) {
instance->OnFocusBelowFold();
}
+static void play_pause_cb(lv_event_t* ev) {
+ events::Audio().Dispatch(audio::TogglePlayPause{});
+}
+
static lv_style_t scrubber_style;
auto info_label(lv_obj_t* parent) -> lv_obj_t* {
@@ -159,7 +164,10 @@ Playing::Playing(std::weak_ptr<database::Database> db, audio::TrackQueue* queue)
LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
play_pause_control_ = control_button(controls_container, LV_SYMBOL_PLAY);
+ lv_obj_add_event_cb(play_pause_control_, play_pause_cb, LV_EVENT_CLICKED,
+ NULL);
lv_group_add_obj(group_, play_pause_control_);
+
lv_group_add_obj(group_, control_button(controls_container, LV_SYMBOL_PREV));
lv_group_add_obj(group_, control_button(controls_container, LV_SYMBOL_NEXT));
lv_group_add_obj(group_,