Last soundboard bug was actually 50% fixed...

This commit is contained in:
furrtek 2017-02-02 00:44:35 +00:00
parent 15f66eb74e
commit 799e29e5e6
4 changed files with 10 additions and 10 deletions

View File

@ -28,7 +28,7 @@ set(CHIBIOS_PORTAPACK ${PROJECT_SOURCE_DIR}/chibios-portapack)
set(HACKRF_FIRMWARE_FILENAME hackrf_one_usb_ram.dfu) set(HACKRF_FIRMWARE_FILENAME hackrf_one_usb_ram.dfu)
set(HACKRF_FIRMWARE_IMAGE ${PROJECT_SOURCE_DIR}/${HACKRF_FIRMWARE_FILENAME}) set(HACKRF_FIRMWARE_IMAGE ${PROJECT_SOURCE_DIR}/${HACKRF_FIRMWARE_FILENAME})
set(HACKRF_CPLD_SVF_FILENAME hackrf_cpld_portapack.svf) set(HACKRF_CPLD_SVF_FILENAME hackrf_cpld_default.svf)
set(HACKRF_CPLD_SVF_PATH ${PROJECT_SOURCE_DIR}/${HACKRF_CPLD_SVF_FILENAME}) set(HACKRF_CPLD_SVF_PATH ${PROJECT_SOURCE_DIR}/${HACKRF_CPLD_SVF_FILENAME})
set(EXTRACT_CPLD_DATA ${PROJECT_SOURCE_DIR}/tools/extract_cpld_data.py) set(EXTRACT_CPLD_DATA ${PROJECT_SOURCE_DIR}/tools/extract_cpld_data.py)

View File

@ -208,16 +208,16 @@ SoundBoardView::SoundBoardView(
c = 0; c = 0;
for (auto& path : file_list) { for (auto& path : file_list) {
if (reader->open(u"wav/" + path.native())) { if (reader->open(u"wav/" + path.native())) {
if (reader->channels() == 1) { if ((reader->channels() == 1) && (reader->bits_per_sample() == 8)) {
sounds[c].size = reader->data_size(); sounds[c].size = reader->data_size();
sounds[c].sample_duration = reader->data_size() / (reader->bits_per_sample() / 8); sounds[c].sample_duration = reader->data_size(); // / (reader->bits_per_sample() / 8);
sounds[c].sample_rate = reader->sample_rate(); sounds[c].sample_rate = reader->sample_rate();
if (reader->bits_per_sample() > 8) /*if (reader->bits_per_sample() > 8)
sounds[c].sixteenbit = true; sounds[c].sixteenbit = true;
else else
sounds[c].sixteenbit = false; sounds[c].sixteenbit = false;*/
sounds[c].ms_duration = reader->ms_duration(); sounds[c].ms_duration = reader->ms_duration();
sounds[c].path = path; sounds[c].path = u"wav/" + path.native();
c++; c++;
if (c == 105) break; // Limit to 105 files (5 pages) if (c == 105) break; // Limit to 105 files (5 pages)
} }
@ -233,7 +233,7 @@ SoundBoardView::SoundBoardView(
&field_frequency, &field_frequency,
&number_bw, &number_bw,
&text_kHz, &text_kHz,
//&options_ctcss, &options_ctcss,
&text_page, &text_page,
&text_duration, &text_duration,
&pbar, &pbar,
@ -242,7 +242,7 @@ SoundBoardView::SoundBoardView(
&button_exit &button_exit
}); });
/*ctcss_options.emplace_back(std::make_pair("None", 0)); ctcss_options.emplace_back(std::make_pair("None", 0));
for (c = 0; c < CTCSS_TONES_NB; c++) for (c = 0; c < CTCSS_TONES_NB; c++)
ctcss_options.emplace_back(std::make_pair(ctcss_tones[c].PL_code, c)); ctcss_options.emplace_back(std::make_pair(ctcss_tones[c].PL_code, c));
@ -252,7 +252,7 @@ SoundBoardView::SoundBoardView(
options_ctcss.on_change = [this](size_t, OptionsField::value_t v) { options_ctcss.on_change = [this](size_t, OptionsField::value_t v) {
this->on_ctcss_changed(v); this->on_ctcss_changed(v);
}; };
options_ctcss.set_selected_index(0);*/ options_ctcss.set_selected_index(0);
const auto button_fn = [this](Button& button) { const auto button_fn = [this](Button& button) {
tx_mode = NORMAL; tx_mode = NORMAL;

View File

@ -83,7 +83,7 @@ private:
uint32_t _ctcss_freq { 0 }; uint32_t _ctcss_freq { 0 };
int8_t audio_buffer[1024]; int8_t audio_buffer[2048];
Style style_a { Style style_a {
.font = font::fixed_8x16, .font = font::fixed_8x16,

Binary file not shown.