4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "deleteallindexes.h"
24 #include "edlsession.h"
27 #include "preferences.h"
28 #include "preferencesthread.h"
29 #include "interfaceprefs.h"
30 #include "shbtnprefs.h"
34 N_("Drag all following edits")
35 N_("Drag only one edit")
36 N_("Drag source only")
40 #define MOVE_ALL_EDITS_TITLE "Drag all following edits"
41 #define MOVE_ONE_EDIT_TITLE "Drag only one edit"
42 #define MOVE_NO_EDITS_TITLE "Drag source only"
43 #define MOVE_EDITS_DISABLED_TITLE "No effect"
45 InterfacePrefs::InterfacePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
46 : PreferencesDialog(mwindow, pwindow)
62 InterfacePrefs::~InterfacePrefs()
79 void InterfacePrefs::create_objects()
82 BC_Resources *resources = BC_WindowBase::get_resources();
83 int margin = mwindow->theme->widget_border;
84 char string[BCTEXTLEN];
85 x = mwindow->theme->preferencesoptions_x;
86 y = mwindow->theme->preferencesoptions_y;
88 add_subwindow(new BC_Title(x, y, _("Time Format"), LARGEFONT,
89 resources->text_default));
91 add_subwindow(new BC_Title(x1, y, _("Flags"), LARGEFONT,
92 resources->text_default));
94 y += get_text_height(LARGEFONT) + 5;
97 add_subwindow(hms = new TimeFormatHMS(pwindow, this,
98 pwindow->thread->edl->session->time_format == TIME_HMS,
101 add_subwindow(hmsf = new TimeFormatHMSF(pwindow, this,
102 pwindow->thread->edl->session->time_format == TIME_HMSF,
105 add_subwindow(samples = new TimeFormatSamples(pwindow, this,
106 pwindow->thread->edl->session->time_format == TIME_SAMPLES,
109 add_subwindow(hex = new TimeFormatHex(pwindow, this,
110 pwindow->thread->edl->session->time_format == TIME_SAMPLES_HEX,
113 add_subwindow(frames = new TimeFormatFrames(pwindow, this,
114 pwindow->thread->edl->session->time_format == TIME_FRAMES,
118 add_subwindow(feet = new TimeFormatFeet(pwindow, this,
119 pwindow->thread->edl->session->time_format == TIME_FEET_FRAMES,
121 x0 += feet->get_w() + 15;
123 add_subwindow(title = new BC_Title(x0, y, _("Frames per foot:")));
124 x0 += title->get_w() + margin;
125 sprintf(string, "%0.2f", pwindow->thread->edl->session->frames_per_foot);
126 add_subwindow(new TimeFormatFeetSetting(pwindow,
129 add_subwindow(seconds = new TimeFormatSeconds(pwindow, this,
130 pwindow->thread->edl->session->time_format == TIME_SECONDS,
134 UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1);
135 add_subwindow(tip_win);
136 y1 += tip_win->get_h() + 5;
137 UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1);
138 add_subwindow(idx_win);
139 y1 += idx_win->get_h() + 5;
140 UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1);
141 add_subwindow(ver_win);
142 y1 += ver_win->get_h() + 5;
143 BD_WarnRoot *bdwr_win = new BD_WarnRoot(pwindow, x1, y1);
144 add_subwindow(bdwr_win);
145 y1 += bdwr_win->get_h() + 5;
146 PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1);
147 add_subwindow(pop_win);
148 y1 += pop_win->get_h() + 5;
149 ActivateFocusPolicy *focus_activate = new ActivateFocusPolicy(pwindow, x1, y1);
150 add_subwindow(focus_activate);
151 y1 += focus_activate->get_h() + 5;
152 DeactivateFocusPolicy *focus_deactivate = new DeactivateFocusPolicy(pwindow, x1, y1);
153 add_subwindow(focus_deactivate);
154 y1 += focus_deactivate->get_h() + 5;
159 add_subwindow(new BC_Bar(5, y, get_w() - 10));
162 add_subwindow(new BC_Title(x, y, _("Index files"), LARGEFONT, resources->text_default));
163 add_subwindow(ffmpeg_marker_files = new IndexFFMPEGMarkerFiles(this, x1, y));
167 add_subwindow(new BC_Title(x, y + 5,
168 _("Index files go here:"), MEDIUMFONT, resources->text_default));
169 add_subwindow(ipathtext = new IndexPathText(x + 230, y,
171 pwindow->thread->preferences->index_directory));
172 add_subwindow(ipath = new BrowseButton(mwindow->theme, this, ipathtext,
173 x1 = x + 230 + ipathtext->get_w(), y,
174 pwindow->thread->preferences->index_directory,
176 _("Select the directory for index files"),
180 add_subwindow(new BC_Title(x, y + 5,
181 _("Size of index file:"),
183 resources->text_default));
184 sprintf(string, "%jd", pwindow->thread->preferences->index_size);
185 add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string));
186 add_subwindow(new ScanCommercials(pwindow, 350,y));
188 add_subwindow(new BC_Title(x, y + 5, _("Number of index files to keep:"), MEDIUMFONT, resources->text_default));
189 sprintf(string, "%ld", (long)pwindow->thread->preferences->index_count);
190 add_subwindow(icount = new IndexCount(x + 230, y, pwindow, string));
191 add_subwindow(deleteall = new DeleteAllIndexes(mwindow, pwindow, 350, y));
195 add_subwindow(new BC_Bar(5, y, get_w() - 10));
198 add_subwindow(new BC_Title(x, y, _("Editing"), LARGEFONT, resources->text_default));
202 add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:")));
203 x1 = x + title->get_w() + 10;
204 keyframe_reticle = new KeyframeReticle(x1, y, &pwindow->thread->preferences->keyframe_reticle);
205 add_subwindow(keyframe_reticle);
206 keyframe_reticle->create_objects();
208 int x2 = x + 400, y2 = y;
209 add_subwindow(thumbnails = new ViewThumbnails(x2, y1, pwindow));
210 AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y2);
211 add_subwindow(android_remote);
212 y2 += android_remote->get_h() + 10;
213 add_subwindow(title = new BC_Title(x2, y2, _("Port:")));
214 int x3 = x2 + title->get_w() + margin;
215 AndroidPort *android_port = new AndroidPort(pwindow, x3, y2);
216 add_subwindow(android_port);
217 y2 += title->get_h() + 10;
218 add_subwindow(title = new BC_Title(x2, y2, _("PIN:")));
219 AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y2);
220 add_subwindow(android_pin);
222 y2 += title->get_h() + 30;
223 ShBtnPrefs *shbtn_prefs = new ShBtnPrefs(pwindow, this, x2, y2);
224 add_subwindow(shbtn_prefs);
226 y2 += shbtn_prefs->get_h() + 30;
227 StillImageUseDuration *use_stduration = new StillImageUseDuration(pwindow,
228 pwindow->thread->edl->session->si_useduration, x2, y2);
229 add_subwindow(use_stduration);
231 BC_CheckBox::calculate_extents(this, &tw, &th, 0, 0);
233 y2 += use_stduration->get_h() + 3;
234 StillImageDuration *stduration = new StillImageDuration(pwindow, x2, y2);
235 add_subwindow(stduration);
236 x2 += stduration->get_w() + 10;
238 add_subwindow(new BC_Title(x2, y2, _("Seconds")));
241 add_subwindow(new BC_Title(x, y, _("Clicking on edit boundaries does what:")));
243 add_subwindow(new BC_Title(x, y, _("Button 1:")));
245 ViewBehaviourText *text;
246 add_subwindow(text = new ViewBehaviourText(80, y - 5,
247 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]),
249 &(pwindow->thread->edl->session->edit_handle_mode[0])));
250 text->create_objects();
252 add_subwindow(new BC_Title(x, y, _("Button 2:")));
253 add_subwindow(text = new ViewBehaviourText(80,
255 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[1]),
257 &(pwindow->thread->edl->session->edit_handle_mode[1])));
258 text->create_objects();
260 add_subwindow(new BC_Title(x, y, _("Button 3:")));
261 add_subwindow(text = new ViewBehaviourText(80,
263 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]),
265 &(pwindow->thread->edl->session->edit_handle_mode[2])));
266 text->create_objects();
270 add_subwindow(title = new BC_Title(x, y + 5, _("Min DB for meter:")));
271 x += title->get_w() + 10;
272 sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db);
273 add_subwindow(min_db = new MeterMinDB(pwindow, string, x, y));
275 x += min_db->get_w() + 10;
276 add_subwindow(title = new BC_Title(x, y + 5, _("Max DB:")));
277 x += title->get_w() + 10;
278 sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db);
279 add_subwindow(max_db = new MeterMaxDB(pwindow, string, x, y));
284 add_subwindow(new BC_Title(x, y, _("Theme:")));
286 add_subwindow(theme = new ViewTheme(x, y, pwindow));
287 theme->create_objects();
291 const char* InterfacePrefs::behavior_to_text(int mode)
294 case MOVE_ALL_EDITS: return _(MOVE_ALL_EDITS_TITLE);
295 case MOVE_ONE_EDIT: return _(MOVE_ONE_EDIT_TITLE);
296 case MOVE_NO_EDITS: return _(MOVE_NO_EDITS_TITLE);
297 case MOVE_EDITS_DISABLED: return _(MOVE_EDITS_DISABLED_TITLE);
302 int InterfacePrefs::update(int new_value)
304 pwindow->thread->redraw_times = 1;
305 pwindow->thread->edl->session->time_format = new_value;
306 hms->update(new_value == TIME_HMS);
307 hmsf->update(new_value == TIME_HMSF);
308 samples->update(new_value == TIME_SAMPLES);
309 hex->update(new_value == TIME_SAMPLES_HEX);
310 frames->update(new_value == TIME_FRAMES);
311 feet->update(new_value == TIME_FEET_FRAMES);
312 seconds->update(new_value == TIME_SECONDS);
319 IndexPathText::IndexPathText(int x,
321 PreferencesWindow *pwindow,
323 : BC_TextBox(x, y, 240, 1, text)
325 this->pwindow = pwindow;
328 IndexPathText::~IndexPathText() {}
330 int IndexPathText::handle_event()
332 strcpy(pwindow->thread->preferences->index_directory, get_text());
339 IndexSize::IndexSize(int x,
341 PreferencesWindow *pwindow,
343 : BC_TextBox(x, y, 100, 1, text)
345 this->pwindow = pwindow;
348 int IndexSize::handle_event()
352 result = atol(get_text());
353 if(result < 64000) result = 64000;
354 //if(result < 500000) result = 500000;
355 pwindow->thread->preferences->index_size = result;
361 IndexCount::IndexCount(int x,
363 PreferencesWindow *pwindow,
365 : BC_TextBox(x, y, 100, 1, text)
367 this->pwindow = pwindow;
370 int IndexCount::handle_event()
374 result = atol(get_text());
375 if(result < 1) result = 1;
376 pwindow->thread->preferences->index_count = result;
382 IndexFFMPEGMarkerFiles::IndexFFMPEGMarkerFiles(InterfacePrefs *iface_prefs, int x, int y)
384 iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes,
385 _("build ffmpeg marker indexes"))
387 this->iface_prefs = iface_prefs;
389 IndexFFMPEGMarkerFiles::~IndexFFMPEGMarkerFiles()
393 int IndexFFMPEGMarkerFiles::handle_event()
395 iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes = get_value();
401 TimeFormatHMS::TimeFormatHMS(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
402 : BC_Radial(x, y, value, TIME_HMS_TEXT)
403 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
405 int TimeFormatHMS::handle_event()
407 tfwindow->update(TIME_HMS);
411 TimeFormatHMSF::TimeFormatHMSF(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
412 : BC_Radial(x, y, value, TIME_HMSF_TEXT)
413 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
415 int TimeFormatHMSF::handle_event()
417 tfwindow->update(TIME_HMSF);
421 TimeFormatSamples::TimeFormatSamples(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
422 : BC_Radial(x, y, value, TIME_SAMPLES_TEXT)
423 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
425 int TimeFormatSamples::handle_event()
427 tfwindow->update(TIME_SAMPLES);
431 TimeFormatFrames::TimeFormatFrames(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
432 : BC_Radial(x, y, value, TIME_FRAMES_TEXT)
433 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
435 int TimeFormatFrames::handle_event()
437 tfwindow->update(TIME_FRAMES);
441 TimeFormatHex::TimeFormatHex(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
442 : BC_Radial(x, y, value, TIME_SAMPLES_HEX_TEXT)
443 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
445 int TimeFormatHex::handle_event()
447 tfwindow->update(TIME_SAMPLES_HEX);
451 TimeFormatSeconds::TimeFormatSeconds(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
452 : BC_Radial(x, y, value, TIME_SECONDS_TEXT)
454 this->pwindow = pwindow;
455 this->tfwindow = tfwindow;
458 int TimeFormatSeconds::handle_event()
460 tfwindow->update(TIME_SECONDS);
464 TimeFormatFeet::TimeFormatFeet(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
465 : BC_Radial(x, y, value, TIME_FEET_FRAMES_TEXT)
466 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
468 int TimeFormatFeet::handle_event()
470 tfwindow->update(TIME_FEET_FRAMES);
474 TimeFormatFeetSetting::TimeFormatFeetSetting(PreferencesWindow *pwindow, int x, int y, char *string)
475 : BC_TextBox(x, y, 90, 1, string)
476 { this->pwindow = pwindow; }
478 int TimeFormatFeetSetting::handle_event()
480 pwindow->thread->edl->session->frames_per_foot = atof(get_text());
481 if(pwindow->thread->edl->session->frames_per_foot < 1) pwindow->thread->edl->session->frames_per_foot = 1;
488 ViewBehaviourText::ViewBehaviourText(int x,
491 PreferencesWindow *pwindow,
493 : BC_PopupMenu(x, y, 200, text)
495 this->output = output;
498 ViewBehaviourText::~ViewBehaviourText()
502 int ViewBehaviourText::handle_event()
507 void ViewBehaviourText::create_objects()
509 // Video4linux versions are automatically detected
510 add_item(new ViewBehaviourItem(this, _(MOVE_ALL_EDITS_TITLE), MOVE_ALL_EDITS));
511 add_item(new ViewBehaviourItem(this, _(MOVE_ONE_EDIT_TITLE), MOVE_ONE_EDIT));
512 add_item(new ViewBehaviourItem(this, _(MOVE_NO_EDITS_TITLE), MOVE_NO_EDITS));
513 add_item(new ViewBehaviourItem(this, _(MOVE_EDITS_DISABLED_TITLE), MOVE_EDITS_DISABLED));
517 ViewBehaviourItem::ViewBehaviourItem(ViewBehaviourText *popup, char *text, int behaviour)
521 this->behaviour = behaviour;
524 ViewBehaviourItem::~ViewBehaviourItem()
528 int ViewBehaviourItem::handle_event()
530 popup->set_text(get_text());
531 *(popup->output) = behaviour;
538 MeterMinDB::MeterMinDB(PreferencesWindow *pwindow, char *text, int x, int y)
539 : BC_TextBox(x, y, 50, 1, text)
541 this->pwindow = pwindow;
544 int MeterMinDB::handle_event()
546 pwindow->thread->redraw_meters = 1;
547 pwindow->thread->edl->session->min_meter_db = atol(get_text());
554 MeterMaxDB::MeterMaxDB(PreferencesWindow *pwindow, char *text, int x, int y)
555 : BC_TextBox(x, y, 50, 1, text)
557 this->pwindow = pwindow;
560 int MeterMaxDB::handle_event()
562 pwindow->thread->redraw_meters = 1;
563 pwindow->thread->edl->session->max_meter_db = atol(get_text());
571 MeterVUDB::MeterVUDB(PreferencesWindow *pwindow, char *text, int y)
572 : BC_Radial(145, y, pwindow->thread->edl->session->meter_format == METER_DB, text)
574 this->pwindow = pwindow;
577 int MeterVUDB::handle_event()
579 pwindow->thread->redraw_meters = 1;
580 // vu_int->update(0);
581 pwindow->thread->edl->session->meter_format = METER_DB;
585 MeterVUInt::MeterVUInt(PreferencesWindow *pwindow, char *text, int y)
586 : BC_Radial(205, y, pwindow->thread->edl->session->meter_format == METER_INT, text)
588 this->pwindow = pwindow;
591 int MeterVUInt::handle_event()
593 pwindow->thread->redraw_meters = 1;
595 pwindow->thread->edl->session->meter_format = METER_INT;
602 ViewTheme::ViewTheme(int x, int y, PreferencesWindow *pwindow)
603 : BC_PopupMenu(x, y, 200, pwindow->thread->preferences->theme, 1)
605 this->pwindow = pwindow;
607 ViewTheme::~ViewTheme()
611 void ViewTheme::create_objects()
613 ArrayList<PluginServer*> themes;
614 MWindow::search_plugindb(0,
621 for(int i = 0; i < themes.total; i++)
623 add_item(new ViewThemeItem(this, themes.values[i]->title));
627 int ViewTheme::handle_event()
636 ViewThemeItem::ViewThemeItem(ViewTheme *popup, char *text)
642 int ViewThemeItem::handle_event()
644 popup->set_text(get_text());
645 strcpy(popup->pwindow->thread->preferences->theme, get_text());
646 popup->handle_event();
650 ViewThumbnails::ViewThumbnails(int x,
652 PreferencesWindow *pwindow)
655 pwindow->thread->preferences->use_thumbnails, _("Use thumbnails in resource window"))
657 this->pwindow = pwindow;
660 int ViewThumbnails::handle_event()
662 pwindow->thread->preferences->use_thumbnails = get_value();
668 UseTipWindow::UseTipWindow(PreferencesWindow *pwindow, int x, int y)
671 pwindow->thread->preferences->use_tipwindow,
672 _("Show tip of the day"))
674 this->pwindow = pwindow;
676 int UseTipWindow::handle_event()
678 pwindow->thread->preferences->use_tipwindow = get_value();
683 UseWarnIndecies::UseWarnIndecies(PreferencesWindow *pwindow, int x, int y)
684 : BC_CheckBox(x, y, pwindow->thread->preferences->warn_indexes,
685 _("ffmpeg probe warns rebuild indexes"))
687 this->pwindow = pwindow;
690 int UseWarnIndecies::handle_event()
692 pwindow->thread->preferences->warn_indexes = get_value();
696 UseWarnVersion::UseWarnVersion(PreferencesWindow *pwindow, int x, int y)
697 : BC_CheckBox(x, y, pwindow->thread->preferences->warn_version,
698 _("EDL version warns if mismatched"))
700 this->pwindow = pwindow;
703 int UseWarnVersion::handle_event()
705 pwindow->thread->preferences->warn_version = get_value();
709 BD_WarnRoot::BD_WarnRoot(PreferencesWindow *pwindow, int x, int y)
710 : BC_CheckBox(x, y, pwindow->thread->preferences->bd_warn_root,
711 _("Create Bluray warns if not root"))
713 this->pwindow = pwindow;
716 int BD_WarnRoot::handle_event()
718 pwindow->thread->preferences->bd_warn_root = get_value();
722 PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y)
723 : BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup,
724 _("Popups activate on button up"))
726 this->pwindow = pwindow;
729 int PopupMenuBtnup::handle_event()
731 pwindow->thread->preferences->popupmenu_btnup = get_value();
735 ActivateFocusPolicy::ActivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
736 : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_ACTIVATE) != 0,
737 _("Click to activate text focus"))
739 this->pwindow = pwindow;
742 int ActivateFocusPolicy::handle_event()
745 pwindow->thread->preferences->textbox_focus_policy |= CLICK_ACTIVATE;
747 pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_ACTIVATE;
751 DeactivateFocusPolicy::DeactivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
752 : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_DEACTIVATE) != 0,
753 _("Click to deactivate text focus"))
755 this->pwindow = pwindow;
758 int DeactivateFocusPolicy::handle_event()
761 pwindow->thread->preferences->textbox_focus_policy |= CLICK_DEACTIVATE;
763 pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_DEACTIVATE;
769 ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y)
772 pwindow->thread->preferences->scan_commercials,
773 _("Scan for commercials during toc build"))
775 this->pwindow = pwindow;
777 int ScanCommercials::handle_event()
779 pwindow->thread->preferences->scan_commercials = get_value();
784 AndroidRemote::AndroidRemote(PreferencesWindow *pwindow, int x, int y)
786 pwindow->thread->preferences->android_remote,
787 _("Android Remote Control"))
789 this->pwindow = pwindow;
791 int AndroidRemote::handle_event()
793 pwindow->thread->preferences->android_remote = get_value();
797 AndroidPIN::AndroidPIN(PreferencesWindow *pwindow, int x, int y)
798 : BC_TextBox(x, y, 240, 1, pwindow->thread->preferences->android_pin)
800 this->pwindow = pwindow;
803 int AndroidPIN::handle_event()
805 char *txt = pwindow->thread->preferences->android_pin;
806 int len = sizeof(pwindow->thread->preferences->android_pin);
807 strncpy(txt, get_text(), len);
812 AndroidPort::AndroidPort(PreferencesWindow *pwindow, int x, int y)
813 : BC_TextBox(x, y, 72, 1, pwindow->thread->preferences->android_port)
815 this->pwindow = pwindow;
818 int AndroidPort::handle_event()
820 unsigned short port = atoi(get_text());
821 if( port < 1024 ) port = 1024;
822 pwindow->thread->preferences->android_port = port;
824 sprintf(str,"%u",port);
829 int InterfacePrefs::start_shbtn_dialog()
832 shbtn_dialog = new ShBtnEditDialog(pwindow);
833 shbtn_dialog->start();
837 ShBtnPrefs::ShBtnPrefs(PreferencesWindow *pwindow, InterfacePrefs *iface_prefs, int x, int y)
838 : BC_GenericButton(x, y, _("Shell Commands"))
840 this->pwindow = pwindow;
841 this->iface_prefs = iface_prefs;
842 set_tooltip(_("Main Menu Shell Commands"));
845 int ShBtnPrefs::handle_event()
847 return iface_prefs->start_shbtn_dialog();
851 StillImageUseDuration::StillImageUseDuration(PreferencesWindow *pwindow, int value, int x, int y)
852 : BC_CheckBox(x, y, value, _("Import images with a duration of"))
854 this->pwindow = pwindow;
857 int StillImageUseDuration::handle_event()
859 pwindow->thread->edl->session->si_useduration = get_value();
863 StillImageDuration::StillImageDuration(PreferencesWindow *pwindow, int x, int y)
864 : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->si_duration)
866 this->pwindow = pwindow;
868 int StillImageDuration::handle_event()
870 pwindow->thread->edl->session->si_duration = atof(get_text());
875 HairlineItem::HairlineItem(KeyframeReticle *popup, int hairline)
876 : BC_MenuItem(popup->hairline_to_string(hairline))
879 this->hairline = hairline;
882 HairlineItem::~HairlineItem()
886 int HairlineItem::handle_event()
888 popup->set_text(get_text());
889 *(popup->output) = hairline;
894 KeyframeReticle::KeyframeReticle(int x, int y, int *output)
895 : BC_PopupMenu(x, y, 175, hairline_to_string(*output))
897 this->output = output;
900 KeyframeReticle::~KeyframeReticle()
904 const char *KeyframeReticle::hairline_to_string(int type)
907 case HAIRLINE_NEVER: return _("Never");
908 case HAIRLINE_DRAGGING: return _("Dragging");
909 case HAIRLINE_ALWAYS: return _("Always");
914 void KeyframeReticle::create_objects()
916 add_item(new HairlineItem(this, HAIRLINE_NEVER));
917 add_item(new HairlineItem(this, HAIRLINE_DRAGGING));
918 add_item(new HairlineItem(this, HAIRLINE_ALWAYS));