summaryrefslogtreecommitdiff
path: root/src/ui/screen_playing.cpp
diff options
context:
space:
mode:
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_,