X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpreferencesthread.C;h=af64fed165775894bd6c9908a9dfcc946b0e3601;hp=8d4544f8d76b42014a8486b73bfaa820d315ac4c;hb=7eded24eb31529ad7652dea64e34b0a6210e5be1;hpb=3ac8199743f244669cc87ceef9c3cd23710552f3 diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 8d4544f8..af64fed1 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -20,6 +20,7 @@ */ #include "aboutprefs.h" +#include "appearanceprefs.h" #include "asset.h" #include "audiodevice.inc" #include "bcsignals.h" @@ -31,6 +32,7 @@ #include "bchash.h" #include "edl.h" #include "edlsession.h" +#include "file.h" #include "filesystem.h" #include "fonts.h" #include "interfaceprefs.h" @@ -62,8 +64,8 @@ -#define WIDTH 770 -#define HEIGHT 740 +#define WIDTH 840 +#define HEIGHT 700 PreferencesMenuitem::PreferencesMenuitem(MWindow *mwindow) @@ -210,18 +212,44 @@ int PreferencesThread::apply_settings() (*this_aconfig != *aconfig) || (*this_vconfig != *vconfig) || !preferences->brender_asset->equivalent(*mwindow->preferences->brender_asset, 0, 1, edl); + if( preferences->yuv_color_space != mwindow->preferences->yuv_color_space || + preferences->yuv_color_range != mwindow->preferences->yuv_color_range ) { + YUV::yuv.yuv_set_colors( + preferences->yuv_color_space, + preferences->yuv_color_range); + rerender = 1; + } + + if( preferences->highlight_inverse != mwindow->preferences->highlight_inverse ) { + mwindow->gui->lock_window("PreferencesThread::apply_settings 0"); + mwindow->gui->hide_cursor(0); + mwindow->gui->unlock_window(); + redraw_overlays = 1; + } + PreferencesWindow *window = (PreferencesWindow*)get_gui(); + if( window ) window->unlock_window(); + mwindow->init_brender(); + if( window ) window->lock_window("PreferencesThread::apply_settings 5"); + if( strcmp(preferences->theme, mwindow->preferences->theme) != 0 ) mwindow->restart_status = -1; // reload, need new bcresources if( strcmp(preferences->plugin_icons, mwindow->preferences->plugin_icons) != 0 ) mwindow->restart_status = -1; + if( strcmp(preferences->lv2_path, mwindow->preferences->lv2_path) != 0 ) + reload_plugins = 1; + if( reload_plugins ) { + MWindow::remove_plugin_index(); + File::setenv_path("LV2_PATH", preferences->lv2_path, 1); + mwindow->restart_status = -1; + } mwindow->edl->copy_session(edl, 1); mwindow->preferences->copy_from(preferences); - mwindow->init_brender(); BC_Signals::set_catch_segv(mwindow->preferences->trap_sigsegv); BC_Signals::set_catch_intr(mwindow->preferences->trap_sigintr); BC_WindowBase::get_resources()->popupmenu_btnup = mwindow->preferences->popupmenu_btnup; + BC_WindowBase::get_resources()->grab_input_focus = mwindow->preferences->grab_input_focus; BC_WindowBase::get_resources()->textbox_focus_policy = mwindow->preferences->textbox_focus_policy; if( mwindow->preferences->trap_sigsegv || mwindow->preferences->trap_sigintr ) { BC_Trace::enable_locks(); @@ -231,7 +259,7 @@ int PreferencesThread::apply_settings() } mwindow->reset_android_remote(); - int ffmpeg_early_probe = mwindow->preferences->get_file_probe_armed("FFPMEG_Early"); + int ffmpeg_early_probe = mwindow->preferences->get_file_probe_armed("FFMPEG_Early"); mwindow->gui->ffmpeg_toggle->update(ffmpeg_early_probe); mwindow->gui->ffmpeg_toggle->set_tooltip(ffmpeg_early_probe ? FFMPEG_EARLY_TIP : FFMPEG_LATE_TIP); @@ -290,6 +318,7 @@ int PreferencesThread::apply_settings() if(redraw_overlays) { mwindow->gui->lock_window("PreferencesThread::apply_settings 2"); + mwindow->gui->show_cursor(0); mwindow->gui->draw_overlays(1); mwindow->gui->unlock_window(); } @@ -307,10 +336,7 @@ int PreferencesThread::apply_settings() //printf("PreferencesThread::apply_settings 1\n"); // This doesn't stop and restart, only reloads the assets before // the next play command. - mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME, - CHANGE_ALL, - mwindow->edl, - 1); + mwindow->cwindow->refresh_frame(CHANGE_ALL, mwindow->edl); //printf("PreferencesThread::apply_settings 10\n"); } @@ -341,6 +367,8 @@ const char* PreferencesThread::category_to_text(int category) return _("Performance"); case INTERFACE: return _("Interface"); + case APPEARANCE: + return _("Appearance"); case ABOUT: return _("About"); } @@ -409,11 +437,7 @@ void PreferencesWindow::create_objects() for(int i = 0; i < CATEGORIES; i++) { add_subwindow(category_button[i] = new PreferencesButton(mwindow, - thread, - x, - y, - i, - thread->category_to_text(i), + thread, x, y, i, thread->category_to_text(i), (i == thread->current_dialog) ? mwindow->theme->get_image_set("category_button_checked") : mwindow->theme->get_image_set("category_button"))); @@ -519,6 +543,10 @@ int PreferencesWindow::set_current_dialog(int number) add_subwindow(dialog = new InterfacePrefs(mwindow, this)); break; + case PreferencesThread::APPEARANCE: + add_subwindow(dialog = new AppearancePrefs(mwindow, this)); + break; + case PreferencesThread::ABOUT: add_subwindow(dialog = new AboutPrefs(mwindow, this)); break; @@ -614,6 +642,7 @@ PreferencesApply::PreferencesApply(MWindow *mwindow, PreferencesThread *thread) int PreferencesApply::handle_event() { thread->apply_settings(); + mwindow->save_defaults(); return 1; } int PreferencesApply::resize_event(int w, int h)