mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-02 13:42:17 -04:00
Wavfile class
This commit is contained in:
parent
e56fa0f479
commit
1db138c27a
20 changed files with 640 additions and 312 deletions
|
@ -28,10 +28,12 @@
|
|||
#include "ui_receiver.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
#include "time.hpp"
|
||||
#include "clock_manager.hpp"
|
||||
#include "message.hpp"
|
||||
#include "baseband_api.hpp"
|
||||
#include "file.hpp"
|
||||
#include "utility.hpp"
|
||||
#include "message.hpp"
|
||||
#include "wavfile.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
|
@ -61,6 +63,7 @@ private:
|
|||
NavigationView& nav_;
|
||||
|
||||
segments segment;
|
||||
bool armed = false;
|
||||
bool file_error = false;
|
||||
uint32_t sound_sizes[11];
|
||||
|
||||
|
@ -77,22 +80,24 @@ private:
|
|||
{ "9" },
|
||||
{ "announce" }
|
||||
};
|
||||
|
||||
const uint8_t month_table[12] = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 };
|
||||
const char * day_of_week[7] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
|
||||
|
||||
File file;
|
||||
uint8_t id_test, announce_loop;
|
||||
uint32_t cnt;
|
||||
// const uint8_t month_table[12] = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 };
|
||||
// const char * day_of_week[7] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
|
||||
|
||||
std::unique_ptr<WAVFileReader> reader;
|
||||
|
||||
uint8_t code_index, announce_loop;
|
||||
uint32_t sample_counter;
|
||||
uint32_t sample_duration;
|
||||
int8_t audio_buffer[1024];
|
||||
uint32_t pause = 0;
|
||||
|
||||
bool armed_blink;
|
||||
SignalToken signal_token_tick_second;
|
||||
|
||||
void on_tick_second();
|
||||
void on_tuning_frequency_changed(rf::Frequency f);
|
||||
void prepare_audio();
|
||||
void start_tx();
|
||||
uint16_t fb_to_uint16(const std::string& fb);
|
||||
uint32_t fb_to_uint32(const std::string& fb);
|
||||
|
||||
// Schedule: save on sd card
|
||||
// For each day of the week, max 8 messages ?
|
||||
|
@ -105,7 +110,7 @@ private:
|
|||
// Frequency list and sequence
|
||||
|
||||
Text text_title {
|
||||
{ 1 * 8, 1 * 16, 11, 16 },
|
||||
{ 1 * 8, 8 * 16, 11, 16 },
|
||||
"Schedule:"
|
||||
};
|
||||
|
||||
|
@ -113,22 +118,31 @@ private:
|
|||
{ 1 * 8, 4 },
|
||||
};
|
||||
NumberField number_bw {
|
||||
{ 12 * 8, 2 * 16 },
|
||||
{ 12 * 8, 4 },
|
||||
3,
|
||||
{1, 150},
|
||||
1,
|
||||
' '
|
||||
};
|
||||
|
||||
Text text_code {
|
||||
{ 20, 4 * 16, 5 * 8, 16 },
|
||||
"Code:"
|
||||
};
|
||||
SymField symfield_code {
|
||||
{ 1*8, 3 * 16 },
|
||||
10,
|
||||
{ 20, 5 * 16 },
|
||||
25,
|
||||
false
|
||||
};
|
||||
|
||||
Button button_tx {
|
||||
{ 21 * 8, 13 * 16, 64, 32 },
|
||||
"TX !"
|
||||
Checkbox check_armed {
|
||||
{ 2 * 8, 13 * 16 },
|
||||
5,
|
||||
"Armed"
|
||||
};
|
||||
Button button_tx_now {
|
||||
{ 18 * 8, 13 * 16, 10 * 8, 32 },
|
||||
"TX now"
|
||||
};
|
||||
Button button_exit {
|
||||
{ 21 * 8, 16 * 16, 64, 32 },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue