From 2451d3174f3b64d3ce4e311b125813cf2881eca4 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Sun, 22 Oct 2017 16:43:05 -0600 Subject: [PATCH] fix for F_sine segv, bunch of intl fixes --- cinelerra-5.1/cinelerra/channelinfo.C | 2 +- cinelerra-5.1/cinelerra/dbwindow.C | 2 +- cinelerra-5.1/cinelerra/exportedl.C | 38 +++++++----------- cinelerra-5.1/cinelerra/exportedl.h | 9 ++--- cinelerra-5.1/cinelerra/keyframegui.C | 6 +-- cinelerra-5.1/cinelerra/performanceprefs.C | 39 +++++++++---------- cinelerra-5.1/cinelerra/performanceprefs.h | 6 ++- cinelerra-5.1/cinelerra/pluginfclient.C | 10 ++--- .../{presetsgui.C => presetsgui.C.sav1} | 2 +- cinelerra-5.1/cinelerra/recordbatches.C | 3 +- cinelerra-5.1/cinelerra/recordbatches.h | 5 ++- cinelerra-5.1/cinelerra/swindow.C | 2 +- cinelerra-5.1/plugins/crikey/crikeywindow.C | 2 +- 13 files changed, 59 insertions(+), 67 deletions(-) rename cinelerra-5.1/cinelerra/{presetsgui.C => presetsgui.C.sav1} (99%) diff --git a/cinelerra-5.1/cinelerra/channelinfo.C b/cinelerra-5.1/cinelerra/channelinfo.C index a044338e..4a5bdaad 100644 --- a/cinelerra-5.1/cinelerra/channelinfo.C +++ b/cinelerra-5.1/cinelerra/channelinfo.C @@ -337,7 +337,7 @@ ChanSearchGUI::ChanSearchGUI(ChanSearch *cswindow) search_columns[1] = 1; search_columns[2] = 2; search_column_titles[0] = _("Source"); - search_column_titles[1] = _("Title"); + search_column_titles[1] = C_("Title"); search_column_titles[2] = _("Start time"); search_column_widths[0] = 120; search_column_widths[2] = 120; diff --git a/cinelerra-5.1/cinelerra/dbwindow.C b/cinelerra-5.1/cinelerra/dbwindow.C index ec890458..5d93549f 100644 --- a/cinelerra-5.1/cinelerra/dbwindow.C +++ b/cinelerra-5.1/cinelerra/dbwindow.C @@ -588,7 +588,7 @@ DbWindowGUI(DbWindow *dwindow) search_column_titles[col_id] = _("Id"); search_column_titles[col_length] = _("length"); search_column_titles[col_source] = _("Source"); - search_column_titles[col_title] = _("Title"); + search_column_titles[col_title] = C_("Title"); search_column_titles[col_start_time] = _("Start time"); search_column_titles[col_access_time] = _("Access time"); search_column_titles[col_access_count] = _("count"); diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C index 7c8afaa2..8cbbbf3f 100644 --- a/cinelerra-5.1/cinelerra/exportedl.C +++ b/cinelerra-5.1/cinelerra/exportedl.C @@ -325,33 +325,31 @@ void ExportEDL::run() #define WIDTH 410 #define HEIGHT 400 -static const char *list_titles[] = +static const char *default_list_titles[] = { N_("No."), N_("Track name") }; - -static int list_widths[] = +static int default_list_widths[] = { 40, 200 }; + ExportEDLWindow::ExportEDLWindow(MWindow *mwindow, ExportEDL *exportedl, ExportEDLAsset *exportasset) : BC_Window(_(PROGRAM_NAME ": Export EDL"), mwindow->gui->get_screen_w(1, 0) / 2 - WIDTH / 2, mwindow->gui->get_root_h(1) / 2 - HEIGHT / 2, - WIDTH, - HEIGHT, - (int)BC_INFINITY, - (int)BC_INFINITY, - 0, - 0, - 1) + WIDTH, HEIGHT, (int)BC_INFINITY, (int)BC_INFINITY, 0, 0, 1) { this->mwindow = mwindow; this->exportasset = exportasset; + for( int i=0; i<2; ++i ) { + list_titles[i] = _(default_list_titles[i]); + list_widths[i] = default_list_widths[i]; + } } ExportEDLWindow::~ExportEDLWindow() @@ -411,7 +409,7 @@ void ExportEDLWindow::create_objects() } - add_subwindow(track_list = new ExportEDLWindowTrackList(this, x, y, 400, 200, items_tracks)); + add_subwindow(track_list = new ExportEDLWindowTrackList(this, x, y, 400, 200)); y += 5 + track_list->get_h(); add_subwindow(new BC_Title(x, y, _("Currently only CMX 3600 format is supported"))); @@ -439,19 +437,11 @@ int ExportEDLPathText::handle_event() } ExportEDLWindowTrackList::ExportEDLWindowTrackList(ExportEDLWindow *window, - int x, - int y, - int w, - int h, - ArrayList *track_list) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - track_list, - list_titles, - list_widths, + int x, int y, int w, int h) + : BC_ListBox(x, y, w, h, LISTBOX_TEXT, + window->items_tracks, + window->list_titles, + window->list_widths, 2) { this->window = window; diff --git a/cinelerra-5.1/cinelerra/exportedl.h b/cinelerra-5.1/cinelerra/exportedl.h index fdd183bb..79e34be7 100644 --- a/cinelerra-5.1/cinelerra/exportedl.h +++ b/cinelerra-5.1/cinelerra/exportedl.h @@ -122,8 +122,9 @@ public: ExportEDLPathText *path_textbox; BC_RecentList *path_recent; ExportEDLWindowTrackList *track_list; - ArrayList items_tracks[2]; + const char *list_titles[2]; + int list_widths[2]; MWindow *mwindow; }; @@ -146,11 +147,7 @@ class ExportEDLWindowTrackList : public BC_ListBox { public: ExportEDLWindowTrackList(ExportEDLWindow *window, - int x, - int y, - int w, - int h, - ArrayList *track_list); + int x, int y, int w, int h); int handle_event(); ExportEDLWindow *window; diff --git a/cinelerra-5.1/cinelerra/keyframegui.C b/cinelerra-5.1/cinelerra/keyframegui.C index d7d29741..c60459c9 100644 --- a/cinelerra-5.1/cinelerra/keyframegui.C +++ b/cinelerra-5.1/cinelerra/keyframegui.C @@ -479,7 +479,7 @@ void KeyFrameWindow::create_objects() add_subwindow(title1 = new BC_Title(theme->keyframe_list_x, - theme->keyframe_list_y - BC_Title::calculate_h(this, (char*)_("Py"), LARGEFONT) - + theme->keyframe_list_y - BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) - theme->widget_border, _("Keyframe parameters:"), LARGEFONT)); add_subwindow(keyframe_list = new KeyFrameList(thread, this, @@ -505,7 +505,7 @@ void KeyFrameWindow::create_objects() #endif add_subwindow(title4 = new BC_Title(theme->presets_list_x, theme->presets_list_y - - BC_Title::calculate_h(this, (char*)_("Py"), LARGEFONT) - + BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) - theme->widget_border, _("Presets:"), LARGEFONT)); add_subwindow(preset_list = new KeyFramePresetsList(thread, this, theme->presets_list_x, theme->presets_list_y, @@ -796,7 +796,7 @@ KeyFramePresetsSave::KeyFramePresetsSave(KeyFrameThread *thread, KeyFrameWindow *window, int x, int y) -: BC_GenericButton(x, y, _("Save")) +: BC_GenericButton(x, y, C_("Save")) { this->thread = thread; this->window = window; diff --git a/cinelerra-5.1/cinelerra/performanceprefs.C b/cinelerra-5.1/cinelerra/performanceprefs.C index 148670a0..e3c7e2ca 100644 --- a/cinelerra-5.1/cinelerra/performanceprefs.C +++ b/cinelerra-5.1/cinelerra/performanceprefs.C @@ -274,7 +274,7 @@ void PerformancePrefs::generate_node_list() } } -static const char *titles[] = +static const char *default_titles[] = { N_("On"), N_("Hostname"), @@ -282,7 +282,7 @@ static const char *titles[] = N_("Framerate") }; -static int widths[] = +static int default_widths[] = { 30, 150, @@ -293,13 +293,13 @@ static int widths[] = void PerformancePrefs::update_node_list() { - node_list->update(nodes, - titles, - widths, - TOTAL_COLUMNS, - node_list->get_xposition(), - node_list->get_yposition(), - node_list->get_selection_number(0, 0)); + node_list->update_list(); +} + +void PrefsRenderFarmNodes::update_list() +{ + update(subwindow->nodes, titles, widths, PerformancePrefs::TOTAL_COLUMNS, + get_xposition(), get_yposition(), get_selection_number(0, 0)); } @@ -546,19 +546,18 @@ int PrefsRenderFarmPort::handle_event() PrefsRenderFarmNodes::PrefsRenderFarmNodes(PreferencesWindow *pwindow, - PerformancePrefs *subwindow, - int x, - int y) - : BC_ListBox(x, - y, - 340, - 230, + PerformancePrefs *subwindow, int x, int y) + : BC_ListBox(x, y, 340, 230, LISTBOX_TEXT, // Display text list or icons subwindow->nodes, - titles, - widths, - 4) + 0, //default_titles, + 0, //default_widths, + PerformancePrefs::TOTAL_COLUMNS) { + for( int i=0; isubwindow = subwindow; this->pwindow = pwindow; } @@ -568,7 +567,7 @@ PrefsRenderFarmNodes::~PrefsRenderFarmNodes() int PrefsRenderFarmNodes::column_resize_event() { - for(int i = 0; i < 3; i++) + for( int i=0; i nodes[4]; + ArrayList nodes[TOTAL_COLUMNS]; PrefsRenderFarmEditNode *edit_node; PrefsRenderFarmPort *edit_port; PrefsRenderFarmNodes *node_list; @@ -238,6 +238,10 @@ public: int handle_event(); int selection_changed(); int column_resize_event(); + void update_list(); + + const char *titles[PerformancePrefs::TOTAL_COLUMNS]; + int widths[PerformancePrefs::TOTAL_COLUMNS]; PreferencesWindow *pwindow; PerformancePrefs *subwindow; diff --git a/cinelerra-5.1/cinelerra/pluginfclient.C b/cinelerra-5.1/cinelerra/pluginfclient.C index 56b45958..2a35e96c 100644 --- a/cinelerra-5.1/cinelerra/pluginfclient.C +++ b/cinelerra-5.1/cinelerra/pluginfclient.C @@ -836,6 +836,11 @@ int PluginFAClient::process_buffer(int64_t size, Samples **buffer, int64_t start if( ret >= 0 ) { in_channels = get_inchannels(); out_channels = get_outchannels(); + frame->nb_samples = size; + frame->format = AV_SAMPLE_FMT_FLTP; + frame->channel_layout = (1<sample_rate = sample_rate; + frame->pts = local_to_edl(filter_position); } int retry = 10; @@ -846,11 +851,6 @@ int PluginFAClient::process_buffer(int64_t size, Samples **buffer, int64_t start for( int i=0; inb_samples = size; - frame->format = AV_SAMPLE_FMT_FLTP; - frame->channel_layout = (1<sample_rate = sample_rate; - frame->pts = local_to_edl(filter_position); ret = av_frame_get_buffer(frame, 0); if( ret < 0 ) break; float **in_buffers = (float **)&frame->extended_data[0]; diff --git a/cinelerra-5.1/cinelerra/presetsgui.C b/cinelerra-5.1/cinelerra/presetsgui.C.sav1 similarity index 99% rename from cinelerra-5.1/cinelerra/presetsgui.C rename to cinelerra-5.1/cinelerra/presetsgui.C.sav1 index c5dbe8e9..b3ad7ed8 100644 --- a/cinelerra-5.1/cinelerra/presetsgui.C +++ b/cinelerra-5.1/cinelerra/presetsgui.C.sav1 @@ -332,7 +332,7 @@ PresetsSave::PresetsSave(PresetsThread *thread, PresetsWindow *window, int x, int y) -: BC_GenericButton(x, y, _("Save")) +: BC_GenericButton(x, y, C_("Save")) { this->thread = thread; this->window = window; diff --git a/cinelerra-5.1/cinelerra/recordbatches.C b/cinelerra-5.1/cinelerra/recordbatches.C index df576ed1..0fe7d76b 100644 --- a/cinelerra-5.1/cinelerra/recordbatches.C +++ b/cinelerra-5.1/cinelerra/recordbatches.C @@ -18,7 +18,7 @@ #include "timeentry.h" const char * RecordBatches:: -batch_titles[] = { +default_batch_titles[] = { N_("On"), N_("Path"), N_("News"), N_("Start time"), N_("Duration"), N_("Source"), N_("Mode") }; @@ -37,6 +37,7 @@ load_defaults(ChannelDB * channeldb, Record * record) early_margin = defaults->get("RECORD_EARLY_MARGIN", early_margin); late_margin = defaults->get("RECORD_LATE_MARGIN", late_margin); for(int i = 0; i < BATCH_COLUMNS; i++) { + batch_titles[i] = _(default_batch_titles[i]); sprintf(string, "BATCH_COLUMNWIDTH_%d", i); column_widths[i] = defaults->get(string, default_columnwidth[i]); } diff --git a/cinelerra-5.1/cinelerra/recordbatches.h b/cinelerra-5.1/cinelerra/recordbatches.h index b0a4be2b..c587281c 100644 --- a/cinelerra-5.1/cinelerra/recordbatches.h +++ b/cinelerra-5.1/cinelerra/recordbatches.h @@ -18,14 +18,15 @@ class RecordBatchesGUI; class RecordBatches { public: - static const char* batch_titles[]; - static const int default_columnwidth[]; RecordBatchesGUI *gui; MWindow *mwindow; // Don't want to interrupt recording to edit a different batch. int current_item; // Current batch being recorded. int editing_item; // Current batch being edited. int batch_active; + static const char* default_batch_titles[]; + const char *batch_titles[BATCH_COLUMNS]; + static const int default_columnwidth[]; int column_widths[BATCH_COLUMNS]; ArrayList data[BATCH_COLUMNS]; ArrayList batches; diff --git a/cinelerra-5.1/cinelerra/swindow.C b/cinelerra-5.1/cinelerra/swindow.C index ea052eeb..fd173764 100644 --- a/cinelerra-5.1/cinelerra/swindow.C +++ b/cinelerra-5.1/cinelerra/swindow.C @@ -114,7 +114,7 @@ int SWindowLoadFile::handle_event() } SWindowSaveFile::SWindowSaveFile(SWindowGUI *gui, int x, int y) - : BC_GenericButton(x, y, C_("Save")) + : BC_GenericButton(x, y, _("Save")) { this->sw_gui = gui; } diff --git a/cinelerra-5.1/plugins/crikey/crikeywindow.C b/cinelerra-5.1/plugins/crikey/crikeywindow.C index c55b98c7..a289a6d1 100644 --- a/cinelerra-5.1/plugins/crikey/crikeywindow.C +++ b/cinelerra-5.1/plugins/crikey/crikeywindow.C @@ -619,7 +619,7 @@ int CriKeyNewPoint::handle_event() } CriKeyDelPoint::CriKeyDelPoint(CriKeyWindow *gui, CriKey *plugin, int x, int y) - : BC_GenericButton(x, y, 80, _("Del")) + : BC_GenericButton(x, y, 80, C_("Del")) { this->gui = gui; this->plugin = plugin; -- 2.26.2