Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Max Channels, Update macOS brew command and fix compiler warnings #75

Merged
merged 4 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/utils.zsh/check_macos
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions cmake/linux/compilerconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/transcription-filter-data.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <functional>
#include <string>

#define MAX_PREPROC_CHANNELS 2
#define MAX_PREPROC_CHANNELS 10

#define MT_ obs_module_text

Expand Down
37 changes: 18 additions & 19 deletions src/transcription-filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down
Loading