mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 06:02:20 -04:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -35,148 +35,136 @@
|
|||
namespace ui {
|
||||
|
||||
class SoundBoardView : public View {
|
||||
public:
|
||||
SoundBoardView(NavigationView& nav);
|
||||
~SoundBoardView();
|
||||
public:
|
||||
SoundBoardView(NavigationView& nav);
|
||||
~SoundBoardView();
|
||||
|
||||
SoundBoardView(const SoundBoardView&) = delete;
|
||||
SoundBoardView(SoundBoardView&&) = delete;
|
||||
SoundBoardView& operator=(const SoundBoardView&) = delete;
|
||||
SoundBoardView& operator=(SoundBoardView&&) = delete;
|
||||
SoundBoardView(const SoundBoardView&) = delete;
|
||||
SoundBoardView(SoundBoardView&&) = delete;
|
||||
SoundBoardView& operator=(const SoundBoardView&) = delete;
|
||||
SoundBoardView& operator=(SoundBoardView&&) = delete;
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Soundbrd TX"; };
|
||||
|
||||
private:
|
||||
NavigationView& nav_;
|
||||
void focus() override;
|
||||
|
||||
// app save settings
|
||||
std::app_settings settings { };
|
||||
std::app_settings::AppSettings app_settings { };
|
||||
|
||||
enum tx_modes {
|
||||
NORMAL = 0,
|
||||
RANDOM
|
||||
};
|
||||
|
||||
tx_modes tx_mode = NORMAL;
|
||||
|
||||
uint32_t playing_id { };
|
||||
uint32_t page = 1;
|
||||
uint32_t c_page = 1;
|
||||
|
||||
std::vector<std::filesystem::path> file_list { };
|
||||
std::string title() const override { return "Soundbrd TX"; };
|
||||
|
||||
const size_t read_size { 2048 }; // Less ?
|
||||
const size_t buffer_count { 3 };
|
||||
std::unique_ptr<ReplayThread> replay_thread { };
|
||||
bool ready_signal { false };
|
||||
lfsr_word_t lfsr_v = 1;
|
||||
|
||||
//void show_infos();
|
||||
void start_tx(const uint32_t id);
|
||||
//void on_ctcss_changed(uint32_t v);
|
||||
void stop();
|
||||
bool is_active() const;
|
||||
void set_ready();
|
||||
void handle_replay_thread_done(const uint32_t return_code);
|
||||
void file_error();
|
||||
void on_tx_progress(const uint32_t progress);
|
||||
void refresh_list();
|
||||
void on_select_entry();
|
||||
|
||||
Labels labels {
|
||||
//{ { 0, 20 * 8 + 4 }, "Title:", Color::light_grey() },
|
||||
{ { 0, 180 }, "Key:", Color::light_grey() }
|
||||
};
|
||||
private:
|
||||
NavigationView& nav_;
|
||||
|
||||
Button button_next_page {
|
||||
{ 30 * 7, 25 * 8, 10 * 3, 2 * 14 },
|
||||
"=>"
|
||||
};
|
||||
// app save settings
|
||||
std::app_settings settings{};
|
||||
std::app_settings::AppSettings app_settings{};
|
||||
|
||||
Button button_prev_page {
|
||||
{ 17 * 10, 25 * 8, 10 * 3, 2 * 14 },
|
||||
"<="
|
||||
};
|
||||
enum tx_modes {
|
||||
NORMAL = 0,
|
||||
RANDOM
|
||||
};
|
||||
|
||||
Text page_info {
|
||||
{ 0, 30 * 8 - 4, 30 * 8, 16 }
|
||||
};
|
||||
tx_modes tx_mode = NORMAL;
|
||||
|
||||
MenuView menu_view {
|
||||
{ 0, 0, 240, 175 },
|
||||
true
|
||||
};
|
||||
Text text_empty {
|
||||
{ 7 * 8, 12 * 8, 16 * 8, 16 },
|
||||
"Empty directory !",
|
||||
};
|
||||
|
||||
/*Text text_title {
|
||||
{ 6 * 8, 20 * 8 + 4, 15 * 8, 16 }
|
||||
};*/
|
||||
|
||||
/*Text text_duration {
|
||||
{ 22 * 8, 20 * 8 + 4, 6 * 8, 16 }
|
||||
};*/
|
||||
|
||||
OptionsField options_tone_key {
|
||||
{ 32 , 180 },
|
||||
18,
|
||||
{ }
|
||||
};
|
||||
|
||||
Checkbox check_loop {
|
||||
{ 0, 25 * 8 + 4 },
|
||||
4,
|
||||
"Loop"
|
||||
};
|
||||
|
||||
Checkbox check_random {
|
||||
{ 10 * 7, 25 * 8 + 4 },
|
||||
6,
|
||||
"Random"
|
||||
};
|
||||
|
||||
//ProgressBar progressbar {
|
||||
// { 0 * 8, 30 * 8 - 4, 30 * 8, 16 }
|
||||
//};
|
||||
|
||||
TransmitterView tx_view {
|
||||
16 * 16,
|
||||
5000,
|
||||
12
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_replay_thread_error {
|
||||
Message::ID::ReplayThreadDone,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const ReplayThreadDoneMessage*>(p);
|
||||
this->handle_replay_thread_done(message.return_code);
|
||||
}
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_fifo_signal {
|
||||
Message::ID::RequestSignal,
|
||||
[this](const Message* const p) {
|
||||
const auto message = static_cast<const RequestSignalMessage*>(p);
|
||||
if (message->signal == RequestSignalMessage::Signal::FillRequest) {
|
||||
this->set_ready();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_tx_progress {
|
||||
Message::ID::TXProgress,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
|
||||
this->on_tx_progress(message.progress);
|
||||
}
|
||||
};
|
||||
uint32_t playing_id{};
|
||||
uint32_t page = 1;
|
||||
uint32_t c_page = 1;
|
||||
|
||||
std::vector<std::filesystem::path> file_list{};
|
||||
|
||||
const size_t read_size{2048}; // Less ?
|
||||
const size_t buffer_count{3};
|
||||
std::unique_ptr<ReplayThread> replay_thread{};
|
||||
bool ready_signal{false};
|
||||
lfsr_word_t lfsr_v = 1;
|
||||
|
||||
// void show_infos();
|
||||
void start_tx(const uint32_t id);
|
||||
// void on_ctcss_changed(uint32_t v);
|
||||
void stop();
|
||||
bool is_active() const;
|
||||
void set_ready();
|
||||
void handle_replay_thread_done(const uint32_t return_code);
|
||||
void file_error();
|
||||
void on_tx_progress(const uint32_t progress);
|
||||
void refresh_list();
|
||||
void on_select_entry();
|
||||
|
||||
Labels labels{
|
||||
//{ { 0, 20 * 8 + 4 }, "Title:", Color::light_grey() },
|
||||
{{0, 180}, "Key:", Color::light_grey()}};
|
||||
|
||||
Button button_next_page{
|
||||
{30 * 7, 25 * 8, 10 * 3, 2 * 14},
|
||||
"=>"};
|
||||
|
||||
Button button_prev_page{
|
||||
{17 * 10, 25 * 8, 10 * 3, 2 * 14},
|
||||
"<="};
|
||||
|
||||
Text page_info{
|
||||
{0, 30 * 8 - 4, 30 * 8, 16}};
|
||||
|
||||
MenuView menu_view{
|
||||
{0, 0, 240, 175},
|
||||
true};
|
||||
Text text_empty{
|
||||
{7 * 8, 12 * 8, 16 * 8, 16},
|
||||
"Empty directory !",
|
||||
};
|
||||
|
||||
/*Text text_title {
|
||||
{ 6 * 8, 20 * 8 + 4, 15 * 8, 16 }
|
||||
};*/
|
||||
|
||||
/*Text text_duration {
|
||||
{ 22 * 8, 20 * 8 + 4, 6 * 8, 16 }
|
||||
};*/
|
||||
|
||||
OptionsField options_tone_key{
|
||||
{32, 180},
|
||||
18,
|
||||
{}};
|
||||
|
||||
Checkbox check_loop{
|
||||
{0, 25 * 8 + 4},
|
||||
4,
|
||||
"Loop"};
|
||||
|
||||
Checkbox check_random{
|
||||
{10 * 7, 25 * 8 + 4},
|
||||
6,
|
||||
"Random"};
|
||||
|
||||
// ProgressBar progressbar {
|
||||
// { 0 * 8, 30 * 8 - 4, 30 * 8, 16 }
|
||||
// };
|
||||
|
||||
TransmitterView tx_view{
|
||||
16 * 16,
|
||||
5000,
|
||||
12};
|
||||
|
||||
MessageHandlerRegistration message_handler_replay_thread_error{
|
||||
Message::ID::ReplayThreadDone,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const ReplayThreadDoneMessage*>(p);
|
||||
this->handle_replay_thread_done(message.return_code);
|
||||
}};
|
||||
|
||||
MessageHandlerRegistration message_handler_fifo_signal{
|
||||
Message::ID::RequestSignal,
|
||||
[this](const Message* const p) {
|
||||
const auto message = static_cast<const RequestSignalMessage*>(p);
|
||||
if (message->signal == RequestSignalMessage::Signal::FillRequest) {
|
||||
this->set_ready();
|
||||
}
|
||||
}};
|
||||
|
||||
MessageHandlerRegistration message_handler_tx_progress{
|
||||
Message::ID::TXProgress,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
|
||||
this->on_tx_progress(message.progress);
|
||||
}};
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
||||
#endif/*__UI_SOUNDBOARD_H__*/
|
||||
#endif /*__UI_SOUNDBOARD_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue