X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Finterfaceprefs.C;h=58aef4973aad16fc6daf2e54bef188257c921289;hb=9db053d413fde01439cc72ec2109913dfda2ec7b;hp=d924a272660819295e5a82740b38ce101b97eace;hpb=29cc4023b50d6f7f9ab518978d8c9e839832b900;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index d924a272..58aef497 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,59 +85,64 @@ 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; - x1 = get_w()/2; 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() + 25; + y1 += idx_win->get_h() + 5; + UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1); + add_subwindow(ver_win); + y1 += ver_win->get_h() + 5; + PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1); + add_subwindow(pop_win); + y1 += pop_win->get_h() + 25; add_subwindow(new BC_Bar(5, y, get_w() - 10)); y += 5; @@ -146,23 +151,22 @@ 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); add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string)); @@ -227,27 +231,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(); @@ -324,13 +328,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() {} @@ -344,13 +348,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() @@ -366,13 +370,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() @@ -451,9 +455,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() @@ -486,10 +490,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) { @@ -538,14 +542,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; } @@ -554,14 +558,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; } @@ -571,29 +575,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; } @@ -612,9 +616,9 @@ ViewTheme::~ViewTheme() void ViewTheme::create_objects() { ArrayList themes; - MWindow::search_plugindb(0, - 0, - 0, + MWindow::search_plugindb(0, + 0, + 0, 0, 1, themes); @@ -648,11 +652,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; @@ -667,9 +671,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; @@ -682,9 +686,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; @@ -696,11 +698,37 @@ 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; +} + +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; +} + 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; @@ -713,8 +741,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; @@ -781,8 +809,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()