From 8fe7da6d42f8182ed35a29187a39d58ab3eca645 Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Sun, 17 Mar 2024 13:16:01 -0400 Subject: [PATCH] Fix Max Channels, Update macOS brew command and fix compiler warnings (#75) --- .github/scripts/utils.zsh/check_macos | 2 +- cmake/linux/compilerconfig.cmake | 1 + src/transcription-filter-data.h | 2 +- src/transcription-filter.cpp | 37 +++++++++++++-------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/scripts/utils.zsh/check_macos b/.github/scripts/utils.zsh/check_macos index 54b5fbf..9c63496 100644 --- a/.github/scripts/utils.zsh/check_macos +++ b/.github/scripts/utils.zsh/check_macos @@ -17,6 +17,6 @@ if (( ! ${+commands[brew]} )) { return 2 } -brew bundle --file ${SCRIPT_HOME}/.Brewfile +brew bundle --no-upgrade --file ${SCRIPT_HOME}/.Brewfile rehash log_group diff --git a/cmake/linux/compilerconfig.cmake b/cmake/linux/compilerconfig.cmake index 67d2b74..3d1c95f 100644 --- a/cmake/linux/compilerconfig.cmake +++ b/cmake/linux/compilerconfig.cmake @@ -21,6 +21,7 @@ set(_obs_gcc_c_options -Wformat -Wformat-security -Wno-conversion + -Wno-error=deprecated-declarations -Wno-float-conversion -Wno-implicit-fallthrough -Wno-missing-braces diff --git a/src/transcription-filter-data.h b/src/transcription-filter-data.h index 1e877e5..f370765 100644 --- a/src/transcription-filter-data.h +++ b/src/transcription-filter-data.h @@ -15,7 +15,7 @@ #include #include -#define MAX_PREPROC_CHANNELS 2 +#define MAX_PREPROC_CHANNELS 10 #define MT_ obs_module_text diff --git a/src/transcription-filter.cpp b/src/transcription-filter.cpp index 3d1dd50..481e860 100644 --- a/src/transcription-filter.cpp +++ b/src/transcription-filter.cpp @@ -512,7 +512,7 @@ void *transcription_filter_create(obs_data_t *settings, obs_source_t *filter) obs_data_get_bool(settings, "rename_file_to_match_recording"); gf->process_while_muted = obs_data_get_bool(settings, "process_while_muted"); - for (size_t i = 0; i < MAX_AUDIO_CHANNELS; i++) { + for (size_t i = 0; i < gf->channels; i++) { circlebuf_init(&gf->input_buffers[i]); } circlebuf_init(&gf->info_buffer); @@ -614,6 +614,22 @@ void *transcription_filter_create(obs_data_t *settings, obs_source_t *filter) return gf; } +bool subs_output_select_changed(obs_properties_t *props, obs_property_t *property, + obs_data_t *settings) +{ + UNUSED_PARAMETER(property); + // Show or hide the output filename selection input + const char *new_output = obs_data_get_string(settings, "subtitle_sources"); + const bool show_hide = (strcmp(new_output, "text_file") == 0); + obs_property_set_visible(obs_properties_get(props, "subtitle_output_filename"), show_hide); + obs_property_set_visible(obs_properties_get(props, "subtitle_save_srt"), show_hide); + obs_property_set_visible(obs_properties_get(props, "truncate_output_file"), show_hide); + obs_property_set_visible(obs_properties_get(props, "only_while_recording"), show_hide); + obs_property_set_visible(obs_properties_get(props, "rename_file_to_match_recording"), + show_hide); + return true; +} + void transcription_filter_activate(void *data) { struct transcription_filter_data *gf = @@ -731,24 +747,7 @@ obs_properties_t *transcription_filter_properties(void *data) obs_properties_add_bool(ppts, "rename_file_to_match_recording", MT_("rename_file_to_match_recording")); - obs_property_set_modified_callback(subs_output, [](obs_properties_t *props, - obs_property_t *property, - obs_data_t *settings) { - UNUSED_PARAMETER(property); - // Show or hide the output filename selection input - const char *new_output = obs_data_get_string(settings, "subtitle_sources"); - const bool show_hide = (strcmp(new_output, "text_file") == 0); - obs_property_set_visible(obs_properties_get(props, "subtitle_output_filename"), - show_hide); - obs_property_set_visible(obs_properties_get(props, "subtitle_save_srt"), show_hide); - obs_property_set_visible(obs_properties_get(props, "truncate_output_file"), - show_hide); - obs_property_set_visible(obs_properties_get(props, "only_while_recording"), - show_hide); - obs_property_set_visible( - obs_properties_get(props, "rename_file_to_match_recording"), show_hide); - return true; - }); + obs_property_set_modified_callback(subs_output, subs_output_select_changed); // Add a list of available whisper models to download obs_property_t *whisper_models_list =