X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Finterfaceprefs.C;h=1a3f1be553c983b84575215abed6d205d00857c8;hb=24db15d85f2e4c986ff91f992e815747c55948f3;hp=a9944e953779901412ca1cc939980b1408052077;hpb=6616b3b82fdbc586f5da00bf772e45d8ada3b464;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index a9944e95..1a3f1be5 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.C +++ b/cinelerra-5.1/cinelerra/interfaceprefs.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "deleteallindexes.h" @@ -85,79 +85,101 @@ void InterfacePrefs::create_objects() x = mwindow->theme->preferencesoptions_x; y = mwindow->theme->preferencesoptions_y; - add_subwindow(new BC_Title(x, y, - _("Time Format"), - LARGEFONT, + add_subwindow(new BC_Title(x, y, _("Time Format"), LARGEFONT, + resources->text_default)); + int x1 = get_w()/2; + add_subwindow(new BC_Title(x1, y, _("Flags"), LARGEFONT, resources->text_default)); y += get_text_height(LARGEFONT) + 5; + int y1 = y; - - add_subwindow(hms = new TimeFormatHMS(pwindow, this, - pwindow->thread->edl->session->time_format == TIME_HMS, + add_subwindow(hms = new TimeFormatHMS(pwindow, this, + pwindow->thread->edl->session->time_format == TIME_HMS, x, y)); y += 20; - add_subwindow(hmsf = new TimeFormatHMSF(pwindow, this, - pwindow->thread->edl->session->time_format == TIME_HMSF, + add_subwindow(hmsf = new TimeFormatHMSF(pwindow, this, + pwindow->thread->edl->session->time_format == TIME_HMSF, x, y)); y += 20; - add_subwindow(samples = new TimeFormatSamples(pwindow, this, - pwindow->thread->edl->session->time_format == TIME_SAMPLES, + add_subwindow(samples = new TimeFormatSamples(pwindow, this, + pwindow->thread->edl->session->time_format == TIME_SAMPLES, x, y)); y += 20; - add_subwindow(hex = new TimeFormatHex(pwindow, this, - pwindow->thread->edl->session->time_format == TIME_SAMPLES_HEX, + add_subwindow(hex = new TimeFormatHex(pwindow, this, + pwindow->thread->edl->session->time_format == TIME_SAMPLES_HEX, x, y)); y += 20; - add_subwindow(frames = new TimeFormatFrames(pwindow, this, - pwindow->thread->edl->session->time_format == TIME_FRAMES, + add_subwindow(frames = new TimeFormatFrames(pwindow, this, + pwindow->thread->edl->session->time_format == TIME_FRAMES, x, y)); y += 20; - int x1 = x; - add_subwindow(feet = new TimeFormatFeet(pwindow, this, - pwindow->thread->edl->session->time_format == TIME_FEET_FRAMES, - x1, y)); - x1 += feet->get_w() + margin; + int x0 = x; + add_subwindow(feet = new TimeFormatFeet(pwindow, this, + pwindow->thread->edl->session->time_format == TIME_FEET_FRAMES, + x0, y)); + x0 += feet->get_w() + 15; BC_Title *title; - add_subwindow(title = new BC_Title(x1, y, _("Frames per foot:"))); - x1 += title->get_w() + margin; + add_subwindow(title = new BC_Title(x0, y, _("Frames per foot:"))); + x0 += title->get_w() + margin; sprintf(string, "%0.2f", pwindow->thread->edl->session->frames_per_foot); - add_subwindow(new TimeFormatFeetSetting(pwindow, - x1, y - 5, string)); + add_subwindow(new TimeFormatFeetSetting(pwindow, + x0, y - 5, string)); y += 20; - add_subwindow(seconds = new TimeFormatSeconds(pwindow, this, - pwindow->thread->edl->session->time_format == TIME_SECONDS, + add_subwindow(seconds = new TimeFormatSeconds(pwindow, this, + pwindow->thread->edl->session->time_format == TIME_SECONDS, x, y)); - y += 35; - add_subwindow(new UseTipWindow(pwindow, x, y)); - add_subwindow(new UseWarnIndecies(pwindow, x+200, y)); - y += 35; + UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1); + add_subwindow(tip_win); + y1 += tip_win->get_h() + 5; + UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1); + add_subwindow(idx_win); + y1 += idx_win->get_h() + 5; + UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1); + add_subwindow(ver_win); + y1 += ver_win->get_h() + 5; + BD_WarnRoot *bdwr_win = new BD_WarnRoot(pwindow, x1, y1); + add_subwindow(bdwr_win); + y1 += bdwr_win->get_h() + 5; + PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1); + add_subwindow(pop_win); + y1 += pop_win->get_h() + 5; + ActivateFocusPolicy *focus_activate = new ActivateFocusPolicy(pwindow, x1, y1); + add_subwindow(focus_activate); + y1 += focus_activate->get_h() + 5; + DeactivateFocusPolicy *focus_deactivate = new DeactivateFocusPolicy(pwindow, x1, y1); + add_subwindow(focus_deactivate); + y1 += focus_deactivate->get_h() + 5; + + if( y < y1 ) y = y1; + y += 10; + add_subwindow(new BC_Bar(5, y, get_w() - 10)); y += 5; add_subwindow(new BC_Title(x, y, _("Index files"), LARGEFONT, resources->text_default)); + add_subwindow(ffmpeg_marker_files = new IndexFFMPEGMarkerFiles(this, x1, y)); - y += 25; - add_subwindow(new BC_Title(x, y + 5, + y += 30; + add_subwindow(new BC_Title(x, y + 5, _("Index files go here:"), MEDIUMFONT, resources->text_default)); - add_subwindow(ipathtext = new IndexPathText(x + 230, y, - pwindow, + add_subwindow(ipathtext = new IndexPathText(x + 230, y, + pwindow, pwindow->thread->preferences->index_directory)); - add_subwindow(ipath = new BrowseButton(mwindow, this, - ipathtext, - x + 230 + ipathtext->get_w(), y, + add_subwindow(ipath = new BrowseButton(mwindow->theme, this, ipathtext, + x1 = x + 230 + ipathtext->get_w(), y, pwindow->thread->preferences->index_directory, - _("Index Path"), + _("Index Path"), _("Select the directory for index files"), 1)); y += 30; - add_subwindow(new BC_Title(x, y + 5, - _("Size of index file:"), - MEDIUMFONT, + add_subwindow(new BC_Title(x, y + 5, + _("Size of index file:"), + MEDIUMFONT, resources->text_default)); sprintf(string, "%jd", pwindow->thread->preferences->index_size); add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string)); @@ -169,16 +191,13 @@ void InterfacePrefs::create_objects() add_subwindow(deleteall = new DeleteAllIndexes(mwindow, pwindow, 350, y)); - - - y += 35; add_subwindow(new BC_Bar(5, y, get_w() - 10)); y += 5; add_subwindow(new BC_Title(x, y, _("Editing"), LARGEFONT, resources->text_default)); - int y1 = y + 5; + y1 = y + 5; y += 35; add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:"))); x1 = x + title->get_w() + 10; @@ -222,27 +241,27 @@ void InterfacePrefs::create_objects() add_subwindow(new BC_Title(x, y, _("Clicking on edit boundaries does what:"))); y += 25; add_subwindow(new BC_Title(x, y, _("Button 1:"))); - + ViewBehaviourText *text; - add_subwindow(text = new ViewBehaviourText(80, y - 5, - behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]), - pwindow, + add_subwindow(text = new ViewBehaviourText(80, y - 5, + behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]), + pwindow, &(pwindow->thread->edl->session->edit_handle_mode[0]))); text->create_objects(); y += 30; add_subwindow(new BC_Title(x, y, _("Button 2:"))); - add_subwindow(text = new ViewBehaviourText(80, - y - 5, - behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[1]), - pwindow, + add_subwindow(text = new ViewBehaviourText(80, + y - 5, + behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[1]), + pwindow, &(pwindow->thread->edl->session->edit_handle_mode[1]))); text->create_objects(); y += 30; add_subwindow(new BC_Title(x, y, _("Button 3:"))); - add_subwindow(text = new ViewBehaviourText(80, - y - 5, - behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]), - pwindow, + add_subwindow(text = new ViewBehaviourText(80, + y - 5, + behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]), + pwindow, &(pwindow->thread->edl->session->edit_handle_mode[2]))); text->create_objects(); @@ -271,23 +290,12 @@ void InterfacePrefs::create_objects() const char* InterfacePrefs::behavior_to_text(int mode) { - switch(mode) - { - case MOVE_ALL_EDITS: - return _(MOVE_ALL_EDITS_TITLE); - break; - case MOVE_ONE_EDIT: - return _(MOVE_ONE_EDIT_TITLE); - break; - case MOVE_NO_EDITS: - return _(MOVE_NO_EDITS_TITLE); - break; - case MOVE_EDITS_DISABLED: - return _(MOVE_EDITS_DISABLED_TITLE); - break; - default: - return ""; - break; + switch(mode) { + case MOVE_ALL_EDITS: return _(MOVE_ALL_EDITS_TITLE); + case MOVE_ONE_EDIT: return _(MOVE_ONE_EDIT_TITLE); + case MOVE_NO_EDITS: return _(MOVE_NO_EDITS_TITLE); + case MOVE_EDITS_DISABLED: return _(MOVE_EDITS_DISABLED_TITLE); + default: return ""; } } @@ -308,24 +316,13 @@ int InterfacePrefs::update(int new_value) - - - - - - - - - - - -IndexPathText::IndexPathText(int x, - int y, - PreferencesWindow *pwindow, +IndexPathText::IndexPathText(int x, + int y, + PreferencesWindow *pwindow, char *text) : BC_TextBox(x, y, 240, 1, text) { - this->pwindow = pwindow; + this->pwindow = pwindow; } IndexPathText::~IndexPathText() {} @@ -339,13 +336,13 @@ int IndexPathText::handle_event() -IndexSize::IndexSize(int x, - int y, - PreferencesWindow *pwindow, +IndexSize::IndexSize(int x, + int y, + PreferencesWindow *pwindow, char *text) : BC_TextBox(x, y, 100, 1, text) -{ - this->pwindow = pwindow; +{ + this->pwindow = pwindow; } int IndexSize::handle_event() @@ -361,13 +358,13 @@ int IndexSize::handle_event() -IndexCount::IndexCount(int x, - int y, - PreferencesWindow *pwindow, +IndexCount::IndexCount(int x, + int y, + PreferencesWindow *pwindow, char *text) : BC_TextBox(x, y, 100, 1, text) -{ - this->pwindow = pwindow; +{ + this->pwindow = pwindow; } int IndexCount::handle_event() @@ -382,15 +379,22 @@ int IndexCount::handle_event() +IndexFFMPEGMarkerFiles::IndexFFMPEGMarkerFiles(InterfacePrefs *iface_prefs, int x, int y) + : BC_CheckBox(x, y, + iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes, + _("build ffmpeg marker indexes")) +{ + this->iface_prefs = iface_prefs; +} +IndexFFMPEGMarkerFiles::~IndexFFMPEGMarkerFiles() +{ +} - - - - - - - - +int IndexFFMPEGMarkerFiles::handle_event() +{ + iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes = get_value(); + return 1; +} @@ -446,9 +450,9 @@ int TimeFormatHex::handle_event() TimeFormatSeconds::TimeFormatSeconds(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y) : BC_Radial(x, y, value, TIME_SECONDS_TEXT) -{ - this->pwindow = pwindow; - this->tfwindow = tfwindow; +{ + this->pwindow = pwindow; + this->tfwindow = tfwindow; } int TimeFormatSeconds::handle_event() @@ -481,10 +485,10 @@ int TimeFormatFeetSetting::handle_event() -ViewBehaviourText::ViewBehaviourText(int x, - int y, - const char *text, - PreferencesWindow *pwindow, +ViewBehaviourText::ViewBehaviourText(int x, + int y, + const char *text, + PreferencesWindow *pwindow, int *output) : BC_PopupMenu(x, y, 200, text) { @@ -533,14 +537,14 @@ int ViewBehaviourItem::handle_event() MeterMinDB::MeterMinDB(PreferencesWindow *pwindow, char *text, int x, int y) : BC_TextBox(x, y, 50, 1, text) -{ - this->pwindow = pwindow; +{ + this->pwindow = pwindow; } int MeterMinDB::handle_event() -{ +{ pwindow->thread->redraw_meters = 1; - pwindow->thread->edl->session->min_meter_db = atol(get_text()); + pwindow->thread->edl->session->min_meter_db = atol(get_text()); return 0; } @@ -549,14 +553,14 @@ int MeterMinDB::handle_event() MeterMaxDB::MeterMaxDB(PreferencesWindow *pwindow, char *text, int x, int y) : BC_TextBox(x, y, 50, 1, text) -{ - this->pwindow = pwindow; +{ + this->pwindow = pwindow; } int MeterMaxDB::handle_event() -{ +{ pwindow->thread->redraw_meters = 1; - pwindow->thread->edl->session->max_meter_db = atol(get_text()); + pwindow->thread->edl->session->max_meter_db = atol(get_text()); return 0; } @@ -566,29 +570,29 @@ int MeterMaxDB::handle_event() MeterVUDB::MeterVUDB(PreferencesWindow *pwindow, char *text, int y) : BC_Radial(145, y, pwindow->thread->edl->session->meter_format == METER_DB, text) -{ - this->pwindow = pwindow; +{ + this->pwindow = pwindow; } -int MeterVUDB::handle_event() -{ +int MeterVUDB::handle_event() +{ pwindow->thread->redraw_meters = 1; -// vu_int->update(0); - pwindow->thread->edl->session->meter_format = METER_DB; +// vu_int->update(0); + pwindow->thread->edl->session->meter_format = METER_DB; return 1; } MeterVUInt::MeterVUInt(PreferencesWindow *pwindow, char *text, int y) : BC_Radial(205, y, pwindow->thread->edl->session->meter_format == METER_INT, text) -{ - this->pwindow = pwindow; +{ + this->pwindow = pwindow; } -int MeterVUInt::handle_event() -{ +int MeterVUInt::handle_event() +{ pwindow->thread->redraw_meters = 1; - vu_db->update(0); - pwindow->thread->edl->session->meter_format = METER_INT; + vu_db->update(0); + pwindow->thread->edl->session->meter_format = METER_INT; return 1; } @@ -607,9 +611,9 @@ ViewTheme::~ViewTheme() void ViewTheme::create_objects() { ArrayList themes; - MWindow::search_plugindb(0, - 0, - 0, + MWindow::search_plugindb(0, + 0, + 0, 0, 1, themes); @@ -643,11 +647,11 @@ int ViewThemeItem::handle_event() return 1; } -ViewThumbnails::ViewThumbnails(int x, - int y, +ViewThumbnails::ViewThumbnails(int x, + int y, PreferencesWindow *pwindow) - : BC_CheckBox(x, - y, + : BC_CheckBox(x, + y, pwindow->thread->preferences->use_thumbnails, _("Use thumbnails in resource window")) { this->pwindow = pwindow; @@ -662,9 +666,9 @@ int ViewThumbnails::handle_event() UseTipWindow::UseTipWindow(PreferencesWindow *pwindow, int x, int y) - : BC_CheckBox(x, - y, - pwindow->thread->preferences->use_tipwindow, + : BC_CheckBox(x, + y, + pwindow->thread->preferences->use_tipwindow, _("Show tip of the day")) { this->pwindow = pwindow; @@ -677,9 +681,7 @@ int UseTipWindow::handle_event() UseWarnIndecies::UseWarnIndecies(PreferencesWindow *pwindow, int x, int y) - : BC_CheckBox(x, - y, - pwindow->thread->preferences->warn_indexes, + : BC_CheckBox(x, y, pwindow->thread->preferences->warn_indexes, _("ffmpeg probe warns rebuild indexes")) { this->pwindow = pwindow; @@ -691,13 +693,83 @@ int UseWarnIndecies::handle_event() return 1; } +UseWarnVersion::UseWarnVersion(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, pwindow->thread->preferences->warn_version, + _("EDL version warns if mismatched")) +{ + this->pwindow = pwindow; +} + +int UseWarnVersion::handle_event() +{ + pwindow->thread->preferences->warn_version = get_value(); + return 1; +} + +BD_WarnRoot::BD_WarnRoot(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, pwindow->thread->preferences->bd_warn_root, + _("Create Bluray warns if not root")) +{ + this->pwindow = pwindow; +} + +int BD_WarnRoot::handle_event() +{ + pwindow->thread->preferences->bd_warn_root = get_value(); + return 1; +} + +PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup, + _("Popups activate on button up")) +{ + this->pwindow = pwindow; +} + +int PopupMenuBtnup::handle_event() +{ + pwindow->thread->preferences->popupmenu_btnup = get_value(); + return 1; +} + +ActivateFocusPolicy::ActivateFocusPolicy(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_ACTIVATE) != 0, + _("Click to activate text focus")) +{ + this->pwindow = pwindow; +} + +int ActivateFocusPolicy::handle_event() +{ + if( get_value() ) + pwindow->thread->preferences->textbox_focus_policy |= CLICK_ACTIVATE; + else + pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_ACTIVATE; + return 1; +} + +DeactivateFocusPolicy::DeactivateFocusPolicy(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_DEACTIVATE) != 0, + _("Click to deactivate text focus")) +{ + this->pwindow = pwindow; +} + +int DeactivateFocusPolicy::handle_event() +{ + if( get_value() ) + pwindow->thread->preferences->textbox_focus_policy |= CLICK_DEACTIVATE; + else + pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_DEACTIVATE; + return 1; +} ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y) - : BC_CheckBox(x, - y, - pwindow->thread->preferences->scan_commercials, + : BC_CheckBox(x, + y, + pwindow->thread->preferences->scan_commercials, _("Scan for commercials during toc build")) { this->pwindow = pwindow; @@ -710,8 +782,8 @@ int ScanCommercials::handle_event() AndroidRemote::AndroidRemote(PreferencesWindow *pwindow, int x, int y) - : BC_CheckBox(x, y, - pwindow->thread->preferences->android_remote, + : BC_CheckBox(x, y, + pwindow->thread->preferences->android_remote, _("Android Remote Control")) { this->pwindow = pwindow; @@ -778,8 +850,8 @@ int ShBtnPrefs::handle_event() StillImageUseDuration::StillImageUseDuration(PreferencesWindow *pwindow, int value, int x, int y) : BC_CheckBox(x, y, value, _("Import images with a duration of")) -{ - this->pwindow = pwindow; +{ + this->pwindow = pwindow; } int StillImageUseDuration::handle_event()