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:
jLynx
2023-05-19 08:16:05 +12:00
committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
599 changed files with 70746 additions and 66896 deletions

View File

@@ -36,106 +36,102 @@
namespace ui {
class RecordView : public View {
public:
std::function<void(std::string)> on_error { };
public:
std::function<void(std::string)> on_error{};
enum FileType {
RawS16 = 2,
WAV = 3,
};
enum FileType {
RawS16 = 2,
WAV = 3,
};
RecordView(
const Rect parent_rect,
const std::filesystem::path& filename_stem_pattern,
const std::filesystem::path& folder,
FileType file_type,
const size_t write_size,
const size_t buffer_count
);
~RecordView();
RecordView(
const Rect parent_rect,
const std::filesystem::path& filename_stem_pattern,
const std::filesystem::path& folder,
FileType file_type,
const size_t write_size,
const size_t buffer_count);
~RecordView();
void focus() override;
void focus() override;
void set_sampling_rate(const size_t new_sampling_rate);
void set_sampling_rate(const size_t new_sampling_rate);
void start();
void stop();
void on_hide() override;
void start();
void stop();
void on_hide() override;
bool is_active() const;
bool is_active() const;
void set_filename_date_frequency(bool set);
void set_filename_date_frequency(bool set);
private:
void toggle();
//void toggle_pitch_rssi();
Optional<File::Error> write_metadata_file(const std::filesystem::path& filename);
private:
void toggle();
// void toggle_pitch_rssi();
Optional<File::Error> write_metadata_file(const std::filesystem::path& filename);
void on_tick_second();
void update_status_display();
void on_tick_second();
void update_status_display();
void handle_capture_thread_done(const File::Error error);
void handle_error(const File::Error error);
void handle_capture_thread_done(const File::Error error);
void handle_error(const File::Error error);
//bool pitch_rssi_enabled = false;
// Time Stamp
bool filename_date_frequency = false;
rtc::RTC datetime { };
// bool pitch_rssi_enabled = false;
const std::filesystem::path filename_stem_pattern;
const std::filesystem::path folder;
const FileType file_type;
const size_t write_size;
const size_t buffer_count;
size_t sampling_rate { 0 };
SignalToken signal_token_tick_second { };
// Time Stamp
bool filename_date_frequency = false;
rtc::RTC datetime{};
Rectangle rect_background {
Color::black()
};
/*ImageButton button_pitch_rssi {
{ 2, 0 * 16, 3 * 8, 1 * 16 },
&bitmap_rssipwm,
Color::orange(),
Color::black()
};*/
const std::filesystem::path filename_stem_pattern;
const std::filesystem::path folder;
const FileType file_type;
const size_t write_size;
const size_t buffer_count;
size_t sampling_rate{0};
SignalToken signal_token_tick_second{};
ImageButton button_record {
//{ 4 * 8, 0 * 16, 2 * 8, 1 * 16 },
{ 0 * 8, 0 * 16, 2 * 8, 1 * 16 },
&bitmap_record,
Color::red(),
Color::black()
};
Rectangle rect_background{
Color::black()};
Text text_record_filename {
{ 7 * 8, 0 * 16, 8 * 8, 16 },
"",
};
/*ImageButton button_pitch_rssi {
{ 2, 0 * 16, 3 * 8, 1 * 16 },
&bitmap_rssipwm,
Color::orange(),
Color::black()
};*/
Text text_record_dropped {
{ 16 * 8, 0 * 16, 3 * 8, 16 },
"",
};
ImageButton button_record{
//{ 4 * 8, 0 * 16, 2 * 8, 1 * 16 },
{0 * 8, 0 * 16, 2 * 8, 1 * 16},
&bitmap_record,
Color::red(),
Color::black()};
Text text_time_available {
{ 21 * 8, 0 * 16, 9 * 8, 16 },
"",
};
Text text_record_filename{
{7 * 8, 0 * 16, 8 * 8, 16},
"",
};
std::unique_ptr<CaptureThread> capture_thread { };
Text text_record_dropped{
{16 * 8, 0 * 16, 3 * 8, 16},
"",
};
MessageHandlerRegistration message_handler_capture_thread_error {
Message::ID::CaptureThreadDone,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const CaptureThreadDoneMessage*>(p);
this->handle_capture_thread_done(message.error);
}
};
Text text_time_available{
{21 * 8, 0 * 16, 9 * 8, 16},
"",
};
std::unique_ptr<CaptureThread> capture_thread{};
MessageHandlerRegistration message_handler_capture_thread_error{
Message::ID::CaptureThreadDone,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const CaptureThreadDoneMessage*>(p);
this->handle_capture_thread_done(message.error);
}};
};
} /* namespace ui */
#endif/*__UI_RECORD_VIEW_H__*/
#endif /*__UI_RECORD_VIEW_H__*/