X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Finterfaceprefs.C;h=fb58b22eea391a89394bb338bf8850096a4c029b;hb=d85ee0843fbbd79a0a7d2ffa0aac57968e24f6d7;hp=c80a8e916ee99abc3eb7e6bdadb2f61dd3af88a2;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index c80a8e91..fb58b22e 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,55 +85,77 @@ 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; @@ -141,26 +163,24 @@ void InterfacePrefs::create_objects() y += 25; - add_subwindow(new BC_Title(x, y + 5, + 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, + 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); - x1 = x + 230; add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string)); add_subwindow(new ScanCommercials(pwindow, 350,y)); y += 30; @@ -179,11 +199,16 @@ void InterfacePrefs::create_objects() add_subwindow(new BC_Title(x, y, _("Editing"), LARGEFONT, resources->text_default)); + y1 = y + 5; y += 35; - - add_subwindow(thumbnails = new ViewThumbnails(x, y, pwindow)); + add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:"))); + x1 = x + title->get_w() + 10; + keyframe_reticle = new KeyframeReticle(x1, y, &pwindow->thread->preferences->keyframe_reticle); + add_subwindow(keyframe_reticle); + keyframe_reticle->create_objects(); int x2 = x + 400, y2 = y; + add_subwindow(thumbnails = new ViewThumbnails(x2, y1, pwindow)); AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y2); add_subwindow(android_remote); y2 += android_remote->get_h() + 10; @@ -218,27 +243,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(); @@ -315,13 +340,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() {} @@ -335,13 +360,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() @@ -357,13 +382,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() @@ -442,9 +467,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() @@ -477,10 +502,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) { @@ -529,14 +554,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; } @@ -545,14 +570,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; } @@ -562,29 +587,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; } @@ -603,9 +628,9 @@ ViewTheme::~ViewTheme() void ViewTheme::create_objects() { ArrayList themes; - MWindow::search_plugindb(0, - 0, - 0, + MWindow::search_plugindb(0, + 0, + 0, 0, 1, themes); @@ -639,11 +664,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; @@ -658,9 +683,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; @@ -673,9 +698,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; @@ -687,13 +710,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; @@ -706,8 +799,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; @@ -774,8 +867,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() @@ -795,3 +888,50 @@ int StillImageDuration::handle_event() return 1; } + +HairlineItem::HairlineItem(KeyframeReticle *popup, int hairline) + : BC_MenuItem(popup->hairline_to_string(hairline)) +{ + this->popup = popup; + this->hairline = hairline; +} + +HairlineItem::~HairlineItem() +{ +} + +int HairlineItem::handle_event() +{ + popup->set_text(get_text()); + *(popup->output) = hairline; + return 1; +} + + +KeyframeReticle::KeyframeReticle(int x, int y, int *output) + : BC_PopupMenu(x, y, 175, hairline_to_string(*output)) +{ + this->output = output; +} + +KeyframeReticle::~KeyframeReticle() +{ +} + +const char *KeyframeReticle::hairline_to_string(int type) +{ + switch( type ) { + case HAIRLINE_NEVER: return _("Never"); + case HAIRLINE_DRAGGING: return _("Dragging"); + case HAIRLINE_ALWAYS: return _("Always"); + } + return _("Unknown"); +} + +void KeyframeReticle::create_objects() +{ + add_item(new HairlineItem(this, HAIRLINE_NEVER)); + add_item(new HairlineItem(this, HAIRLINE_DRAGGING)); + add_item(new HairlineItem(this, HAIRLINE_ALWAYS)); +} +