UI
This commit is contained in:
@@ -39,6 +39,16 @@ enum class sprite : std::size_t {
|
||||
ELECTRIC,
|
||||
VOCAL,
|
||||
UNAVAILABLE,
|
||||
MAIN_MENU,
|
||||
PERFORMANCE,
|
||||
SETTINGS,
|
||||
PLAYBACK,
|
||||
METRONOME,
|
||||
TEMPO,
|
||||
BACK,
|
||||
ON,
|
||||
OFF,
|
||||
BPM,
|
||||
DIGIT_0,
|
||||
DIGIT_1,
|
||||
DIGIT_2,
|
||||
|
||||
@@ -3,21 +3,11 @@
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
|
||||
#include <vamp_pico/artwork.hpp>
|
||||
#include <vamp_pico/http_client.hpp>
|
||||
#include <vamp_style.hpp>
|
||||
#include <vamp_pico/screen.hpp>
|
||||
|
||||
|
||||
namespace vamp_pico {
|
||||
|
||||
constexpr auto display_width = std::int32_t{320};
|
||||
constexpr auto display_height = std::int32_t{240};
|
||||
|
||||
enum class link_status { CONNECTING,
|
||||
OFFLINE,
|
||||
CONNECTED,
|
||||
ERROR };
|
||||
|
||||
class display {
|
||||
public:
|
||||
auto init() -> void;
|
||||
@@ -32,11 +22,8 @@ private:
|
||||
title_cache title_{};
|
||||
std::array<std::bool_t, display_height> dirty_{};
|
||||
link_status link_{link_status::CONNECTING};
|
||||
std::bool_t active_{};
|
||||
std::bool_t busy_{};
|
||||
sprite part_{sprite::COUNT};
|
||||
std::uint32_t page_{};
|
||||
std::uint32_t pages_{};
|
||||
remote_display_state state_{};
|
||||
std::uint64_t last_write_ms_{};
|
||||
std::size_t next_row_{};
|
||||
};
|
||||
|
||||
@@ -19,9 +19,17 @@ struct remote_display_state {
|
||||
std::char_t title[96]{};
|
||||
std::char_t part[48]{};
|
||||
std::char_t mode[24]{};
|
||||
std::char_t focus[32]{};
|
||||
std::bool_t playback{};
|
||||
std::bool_t metronome{};
|
||||
std::bool_t editing{};
|
||||
std::uint32_t bpm{120U};
|
||||
std::array<std::char_t, vamp_protocol::title_id_size + 1U> title_image{};
|
||||
std::uint32_t page{};
|
||||
std::uint32_t pages{};
|
||||
auto operator==(remote_display_state const &other) const -> std::bool_t {
|
||||
return active == other.active && std::string_view{title} == other.title && std::string_view{part} == other.part && std::string_view{mode} == other.mode && std::string_view{focus} == other.focus && playback == other.playback && metronome == other.metronome && editing == other.editing && bpm == other.bpm && title_image == other.title_image && page == other.page && pages == other.pages;
|
||||
}
|
||||
};
|
||||
|
||||
auto parse_remote_display_body(std::string_view body, vamp_pico::remote_display_state &state) -> std::bool_t;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
#include <vamp_pico/artwork.hpp>
|
||||
#include <vamp_pico/http_client.hpp>
|
||||
#include <vamp_style.hpp>
|
||||
|
||||
|
||||
namespace vamp_pico {
|
||||
|
||||
constexpr auto display_width = std::int32_t{320};
|
||||
constexpr auto display_height = std::int32_t{240};
|
||||
|
||||
enum class link_status { CONNECTING,
|
||||
OFFLINE,
|
||||
CONNECTED,
|
||||
ERROR };
|
||||
|
||||
auto render_scanline(std::array<std::uint16_t, vamp_pico::display_width> &row, std::size_t y, vamp_pico::remote_display_state const &state, vamp_pico::link_status link, std::bool_t busy, vamp_pico::title_cache const &title, std::string_view atlas) -> void;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user