Add progress bar to Soundboard app (#1875)

* Add progress bar to Soundboard app

* Clang
This commit is contained in:
Mark Thompson 2024-02-09 19:04:00 -06:00 committed by GitHub
parent b2ad1fa979
commit bbbf5a37c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 11 deletions

View File

@ -1,6 +1,7 @@
/* /*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek * Copyright (C) 2016 Furrtek
* Copyright (C) 2024 Mark Thompson
* *
* This file is part of PortaPack. * This file is part of PortaPack.
* *
@ -51,7 +52,7 @@ void SoundBoardView::stop() {
void SoundBoardView::handle_replay_thread_done(const uint32_t return_code) { void SoundBoardView::handle_replay_thread_done(const uint32_t return_code) {
stop(); stop();
// progressbar.set_value(0); progressbar.set_value(0);
if (return_code == ReplayThread::END_OF_FILE) { if (return_code == ReplayThread::END_OF_FILE) {
if (check_random.value()) { if (check_random.value()) {
@ -100,7 +101,7 @@ void SoundBoardView::start_tx(const uint32_t id) {
playing_id = id; playing_id = id;
// progressbar.set_max(reader->sample_count()); progressbar.set_max(reader->sample_count());
// button_play.set_bitmap(&bitmap_stop); // button_play.set_bitmap(&bitmap_stop);
@ -148,8 +149,7 @@ void SoundBoardView::start_tx(const uint32_t id) {
}*/ }*/
void SoundBoardView::on_tx_progress(const uint32_t progress) { void SoundBoardView::on_tx_progress(const uint32_t progress) {
(void)progress; // avoid warning progressbar.set_value(progress);
// progressbar.set_value(progress);
} }
void SoundBoardView::on_select_entry() { void SoundBoardView::on_select_entry() {
@ -213,7 +213,7 @@ void SoundBoardView::refresh_list() {
for (size_t n = 0; n < file_list.size(); n++) { for (size_t n = 0; n < file_list.size(); n++) {
menu_view.add_item({file_list[n].string().substr(0, 30), menu_view.add_item({file_list[n].string().substr(0, 30),
ui::Color::white(), ui::Color::dark_magenta(),
nullptr, nullptr,
[this](KeyEvent) { [this](KeyEvent) {
on_select_entry(); on_select_entry();
@ -240,7 +240,7 @@ SoundBoardView::SoundBoardView(
&options_tone_key, &options_tone_key,
//&text_title, //&text_title,
//&text_duration, //&text_duration,
//&progressbar, &progressbar,
&field_volume, &field_volume,
&text_volume_disabled, &text_volume_disabled,
&page_info, &page_info,

View File

@ -1,6 +1,7 @@
/* /*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek * Copyright (C) 2016 Furrtek
* Copyright (C) 2024 Mark Thompson
* *
* This file is part of PortaPack. * This file is part of PortaPack.
* *
@ -103,7 +104,7 @@ class SoundBoardView : public View {
"<="}; "<="};
Text page_info{ Text page_info{
{0, 30 * 8 - 4, 30 * 8, 16}}; {0, 29 * 8, 30 * 8, 16}};
MenuView menu_view{ MenuView menu_view{
{0, 0, 240, 175}, {0, 0, 240, 175},
@ -142,9 +143,8 @@ class SoundBoardView : public View {
6, 6,
"Random"}; "Random"};
// ProgressBar progressbar { ProgressBar progressbar{
// { 0 * 8, 30 * 8 - 4, 30 * 8, 16 } {0 * 8, 31 * 8 + 2, 30 * 8, 4}};
// };
TransmitterView tx_view{ TransmitterView tx_view{
16 * 16, 16 * 16,

View File

@ -1,6 +1,7 @@
/* /*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek * Copyright (C) 2017 Furrtek
* Copyright (C) 2024 Mark Thompson
* *
* This file is part of PortaPack. * This file is part of PortaPack.
* *

View File

@ -1,6 +1,7 @@
/* /*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek * Copyright (C) 2017 Furrtek
* Copyright (C) 2024 Mark Thompson
* *
* This file is part of PortaPack. * This file is part of PortaPack.
* *
@ -126,7 +127,7 @@ class ViewWavView : public View {
Color::white()}; Color::white()};
ProgressBar progressbar{ ProgressBar progressbar{
{0 * 8, 11 * 16, 30 * 8, 8}}; {0 * 8, 11 * 16, 30 * 8, 4}};
NumberField field_pos_seconds{ NumberField field_pos_seconds{
{9 * 8, 12 * 16}, {9 * 8, 12 * 16},