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));
166 add_subwindow(new BC_Title(x, y + 5,
167 _("Index files go here:"), MEDIUMFONT, resources->text_default));
168 add_subwindow(ipathtext = new IndexPathText(x + 230, y,
170 pwindow->thread->preferences->index_directory));
171 add_subwindow(ipath = new BrowseButton(mwindow->theme, this, ipathtext,
172 x + 230 + ipathtext->get_w(), y,
173 pwindow->thread->preferences->index_directory,
175 _("Select the directory for index files"),
179 add_subwindow(new BC_Title(x, y + 5,
180 _("Size of index file:"),
182 resources->text_default));
183 sprintf(string, "%jd", pwindow->thread->preferences->index_size);
184 add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string));
185 add_subwindow(new ScanCommercials(pwindow, 350,y));
187 add_subwindow(new BC_Title(x, y + 5, _("Number of index files to keep:"), MEDIUMFONT, resources->text_default));
188 sprintf(string, "%ld", (long)pwindow->thread->preferences->index_count);
189 add_subwindow(icount = new IndexCount(x + 230, y, pwindow, string));
190 add_subwindow(deleteall = new DeleteAllIndexes(mwindow, pwindow, 350, y));
197 add_subwindow(new BC_Bar(5, y, get_w() - 10));
200 add_subwindow(new BC_Title(x, y, _("Editing"), LARGEFONT, resources->text_default));
204 add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:")));
205 x1 = x + title->get_w() + 10;
206 keyframe_reticle = new KeyframeReticle(x1, y, &pwindow->thread->preferences->keyframe_reticle);
207 add_subwindow(keyframe_reticle);
208 keyframe_reticle->create_objects();
210 int x2 = x + 400, y2 = y;
211 add_subwindow(thumbnails = new ViewThumbnails(x2, y1, pwindow));
212 AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y2);
213 add_subwindow(android_remote);
214 y2 += android_remote->get_h() + 10;
215 add_subwindow(title = new BC_Title(x2, y2, _("Port:")));
216 int x3 = x2 + title->get_w() + margin;
217 AndroidPort *android_port = new AndroidPort(pwindow, x3, y2);
218 add_subwindow(android_port);
219 y2 += title->get_h() + 10;
220 add_subwindow(title = new BC_Title(x2, y2, _("PIN:")));
221 AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y2);
222 add_subwindow(android_pin);
224 y2 += title->get_h() + 30;
225 ShBtnPrefs *shbtn_prefs = new ShBtnPrefs(pwindow, this, x2, y2);
226 add_subwindow(shbtn_prefs);
228 y2 += shbtn_prefs->get_h() + 30;
229 StillImageUseDuration *use_stduration = new StillImageUseDuration(pwindow,
230 pwindow->thread->edl->session->si_useduration, x2, y2);
231 add_subwindow(use_stduration);
233 BC_CheckBox::calculate_extents(this, &tw, &th, 0, 0);
235 y2 += use_stduration->get_h() + 3;
236 StillImageDuration *stduration = new StillImageDuration(pwindow, x2, y2);
237 add_subwindow(stduration);
238 x2 += stduration->get_w() + 10;
240 add_subwindow(new BC_Title(x2, y2, _("Seconds")));
243 add_subwindow(new BC_Title(x, y, _("Clicking on edit boundaries does what:")));
245 add_subwindow(new BC_Title(x, y, _("Button 1:")));
247 ViewBehaviourText *text;
248 add_subwindow(text = new ViewBehaviourText(80, y - 5,
249 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]),
251 &(pwindow->thread->edl->session->edit_handle_mode[0])));
252 text->create_objects();
254 add_subwindow(new BC_Title(x, y, _("Button 2:")));
255 add_subwindow(text = new ViewBehaviourText(80,
257 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[1]),
259 &(pwindow->thread->edl->session->edit_handle_mode[1])));
260 text->create_objects();
262 add_subwindow(new BC_Title(x, y, _("Button 3:")));
263 add_subwindow(text = new ViewBehaviourText(80,
265 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]),
267 &(pwindow->thread->edl->session->edit_handle_mode[2])));
268 text->create_objects();
272 add_subwindow(title = new BC_Title(x, y + 5, _("Min DB for meter:")));
273 x += title->get_w() + 10;
274 sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db);
275 add_subwindow(min_db = new MeterMinDB(pwindow, string, x, y));
277 x += min_db->get_w() + 10;
278 add_subwindow(title = new BC_Title(x, y + 5, _("Max DB:")));
279 x += title->get_w() + 10;
280 sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db);
281 add_subwindow(max_db = new MeterMaxDB(pwindow, string, x, y));
286 add_subwindow(new BC_Title(x, y, _("Theme:")));
288 add_subwindow(theme = new ViewTheme(x, y, pwindow));
289 theme->create_objects();
293 const char* InterfacePrefs::behavior_to_text(int mode)
298 return _(MOVE_ALL_EDITS_TITLE);
301 return _(MOVE_ONE_EDIT_TITLE);
304 return _(MOVE_NO_EDITS_TITLE);
306 case MOVE_EDITS_DISABLED:
307 return _(MOVE_EDITS_DISABLED_TITLE);
315 int InterfacePrefs::update(int new_value)
317 pwindow->thread->redraw_times = 1;
318 pwindow->thread->edl->session->time_format = new_value;
319 hms->update(new_value == TIME_HMS);
320 hmsf->update(new_value == TIME_HMSF);
321 samples->update(new_value == TIME_SAMPLES);
322 hex->update(new_value == TIME_SAMPLES_HEX);
323 frames->update(new_value == TIME_FRAMES);
324 feet->update(new_value == TIME_FEET_FRAMES);
325 seconds->update(new_value == TIME_SECONDS);
343 IndexPathText::IndexPathText(int x,
345 PreferencesWindow *pwindow,
347 : BC_TextBox(x, y, 240, 1, text)
349 this->pwindow = pwindow;
352 IndexPathText::~IndexPathText() {}
354 int IndexPathText::handle_event()
356 strcpy(pwindow->thread->preferences->index_directory, get_text());
363 IndexSize::IndexSize(int x,
365 PreferencesWindow *pwindow,
367 : BC_TextBox(x, y, 100, 1, text)
369 this->pwindow = pwindow;
372 int IndexSize::handle_event()
376 result = atol(get_text());
377 if(result < 64000) result = 64000;
378 //if(result < 500000) result = 500000;
379 pwindow->thread->preferences->index_size = result;
385 IndexCount::IndexCount(int x,
387 PreferencesWindow *pwindow,
389 : BC_TextBox(x, y, 100, 1, text)
391 this->pwindow = pwindow;
394 int IndexCount::handle_event()
398 result = atol(get_text());
399 if(result < 1) result = 1;
400 pwindow->thread->preferences->index_count = result;
418 TimeFormatHMS::TimeFormatHMS(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
419 : BC_Radial(x, y, value, TIME_HMS_TEXT)
420 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
422 int TimeFormatHMS::handle_event()
424 tfwindow->update(TIME_HMS);
428 TimeFormatHMSF::TimeFormatHMSF(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
429 : BC_Radial(x, y, value, TIME_HMSF_TEXT)
430 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
432 int TimeFormatHMSF::handle_event()
434 tfwindow->update(TIME_HMSF);
438 TimeFormatSamples::TimeFormatSamples(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
439 : BC_Radial(x, y, value, TIME_SAMPLES_TEXT)
440 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
442 int TimeFormatSamples::handle_event()
444 tfwindow->update(TIME_SAMPLES);
448 TimeFormatFrames::TimeFormatFrames(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
449 : BC_Radial(x, y, value, TIME_FRAMES_TEXT)
450 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
452 int TimeFormatFrames::handle_event()
454 tfwindow->update(TIME_FRAMES);
458 TimeFormatHex::TimeFormatHex(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
459 : BC_Radial(x, y, value, TIME_SAMPLES_HEX_TEXT)
460 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
462 int TimeFormatHex::handle_event()
464 tfwindow->update(TIME_SAMPLES_HEX);
468 TimeFormatSeconds::TimeFormatSeconds(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
469 : BC_Radial(x, y, value, TIME_SECONDS_TEXT)
471 this->pwindow = pwindow;
472 this->tfwindow = tfwindow;
475 int TimeFormatSeconds::handle_event()
477 tfwindow->update(TIME_SECONDS);
481 TimeFormatFeet::TimeFormatFeet(PreferencesWindow *pwindow, InterfacePrefs *tfwindow, int value, int x, int y)
482 : BC_Radial(x, y, value, TIME_FEET_FRAMES_TEXT)
483 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
485 int TimeFormatFeet::handle_event()
487 tfwindow->update(TIME_FEET_FRAMES);
491 TimeFormatFeetSetting::TimeFormatFeetSetting(PreferencesWindow *pwindow, int x, int y, char *string)
492 : BC_TextBox(x, y, 90, 1, string)
493 { this->pwindow = pwindow; }
495 int TimeFormatFeetSetting::handle_event()
497 pwindow->thread->edl->session->frames_per_foot = atof(get_text());
498 if(pwindow->thread->edl->session->frames_per_foot < 1) pwindow->thread->edl->session->frames_per_foot = 1;
505 ViewBehaviourText::ViewBehaviourText(int x,
508 PreferencesWindow *pwindow,
510 : BC_PopupMenu(x, y, 200, text)
512 this->output = output;
515 ViewBehaviourText::~ViewBehaviourText()
519 int ViewBehaviourText::handle_event()
524 void ViewBehaviourText::create_objects()
526 // Video4linux versions are automatically detected
527 add_item(new ViewBehaviourItem(this, _(MOVE_ALL_EDITS_TITLE), MOVE_ALL_EDITS));
528 add_item(new ViewBehaviourItem(this, _(MOVE_ONE_EDIT_TITLE), MOVE_ONE_EDIT));
529 add_item(new ViewBehaviourItem(this, _(MOVE_NO_EDITS_TITLE), MOVE_NO_EDITS));
530 add_item(new ViewBehaviourItem(this, _(MOVE_EDITS_DISABLED_TITLE), MOVE_EDITS_DISABLED));
534 ViewBehaviourItem::ViewBehaviourItem(ViewBehaviourText *popup, char *text, int behaviour)
538 this->behaviour = behaviour;
541 ViewBehaviourItem::~ViewBehaviourItem()
545 int ViewBehaviourItem::handle_event()
547 popup->set_text(get_text());
548 *(popup->output) = behaviour;
555 MeterMinDB::MeterMinDB(PreferencesWindow *pwindow, char *text, int x, int y)
556 : BC_TextBox(x, y, 50, 1, text)
558 this->pwindow = pwindow;
561 int MeterMinDB::handle_event()
563 pwindow->thread->redraw_meters = 1;
564 pwindow->thread->edl->session->min_meter_db = atol(get_text());
571 MeterMaxDB::MeterMaxDB(PreferencesWindow *pwindow, char *text, int x, int y)
572 : BC_TextBox(x, y, 50, 1, text)
574 this->pwindow = pwindow;
577 int MeterMaxDB::handle_event()
579 pwindow->thread->redraw_meters = 1;
580 pwindow->thread->edl->session->max_meter_db = atol(get_text());
588 MeterVUDB::MeterVUDB(PreferencesWindow *pwindow, char *text, int y)
589 : BC_Radial(145, y, pwindow->thread->edl->session->meter_format == METER_DB, text)
591 this->pwindow = pwindow;
594 int MeterVUDB::handle_event()
596 pwindow->thread->redraw_meters = 1;
597 // vu_int->update(0);
598 pwindow->thread->edl->session->meter_format = METER_DB;
602 MeterVUInt::MeterVUInt(PreferencesWindow *pwindow, char *text, int y)
603 : BC_Radial(205, y, pwindow->thread->edl->session->meter_format == METER_INT, text)
605 this->pwindow = pwindow;
608 int MeterVUInt::handle_event()
610 pwindow->thread->redraw_meters = 1;
612 pwindow->thread->edl->session->meter_format = METER_INT;
619 ViewTheme::ViewTheme(int x, int y, PreferencesWindow *pwindow)
620 : BC_PopupMenu(x, y, 200, pwindow->thread->preferences->theme, 1)
622 this->pwindow = pwindow;
624 ViewTheme::~ViewTheme()
628 void ViewTheme::create_objects()
630 ArrayList<PluginServer*> themes;
631 MWindow::search_plugindb(0,
638 for(int i = 0; i < themes.total; i++)
640 add_item(new ViewThemeItem(this, themes.values[i]->title));
644 int ViewTheme::handle_event()
653 ViewThemeItem::ViewThemeItem(ViewTheme *popup, char *text)
659 int ViewThemeItem::handle_event()
661 popup->set_text(get_text());
662 strcpy(popup->pwindow->thread->preferences->theme, get_text());
663 popup->handle_event();
667 ViewThumbnails::ViewThumbnails(int x,
669 PreferencesWindow *pwindow)
672 pwindow->thread->preferences->use_thumbnails, _("Use thumbnails in resource window"))
674 this->pwindow = pwindow;
677 int ViewThumbnails::handle_event()
679 pwindow->thread->preferences->use_thumbnails = get_value();
685 UseTipWindow::UseTipWindow(PreferencesWindow *pwindow, int x, int y)
688 pwindow->thread->preferences->use_tipwindow,
689 _("Show tip of the day"))
691 this->pwindow = pwindow;
693 int UseTipWindow::handle_event()
695 pwindow->thread->preferences->use_tipwindow = get_value();
700 UseWarnIndecies::UseWarnIndecies(PreferencesWindow *pwindow, int x, int y)
701 : BC_CheckBox(x, y, pwindow->thread->preferences->warn_indexes,
702 _("ffmpeg probe warns rebuild indexes"))
704 this->pwindow = pwindow;
707 int UseWarnIndecies::handle_event()
709 pwindow->thread->preferences->warn_indexes = get_value();
713 UseWarnVersion::UseWarnVersion(PreferencesWindow *pwindow, int x, int y)
714 : BC_CheckBox(x, y, pwindow->thread->preferences->warn_version,
715 _("EDL version warns if mismatched"))
717 this->pwindow = pwindow;
720 int UseWarnVersion::handle_event()
722 pwindow->thread->preferences->warn_version = get_value();
726 BD_WarnRoot::BD_WarnRoot(PreferencesWindow *pwindow, int x, int y)
727 : BC_CheckBox(x, y, pwindow->thread->preferences->bd_warn_root,
728 _("Create Bluray warns if not root"))
730 this->pwindow = pwindow;
733 int BD_WarnRoot::handle_event()
735 pwindow->thread->preferences->bd_warn_root = get_value();
739 PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y)
740 : BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup,
741 _("Popups activate on button up"))
743 this->pwindow = pwindow;
746 int PopupMenuBtnup::handle_event()
748 pwindow->thread->preferences->popupmenu_btnup = get_value();
752 ActivateFocusPolicy::ActivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
753 : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_ACTIVATE) != 0,
754 _("Click to activate text focus"))
756 this->pwindow = pwindow;
759 int ActivateFocusPolicy::handle_event()
762 pwindow->thread->preferences->textbox_focus_policy |= CLICK_ACTIVATE;
764 pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_ACTIVATE;
768 DeactivateFocusPolicy::DeactivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
769 : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_DEACTIVATE) != 0,
770 _("Click to deactivate text focus"))
772 this->pwindow = pwindow;
775 int DeactivateFocusPolicy::handle_event()
778 pwindow->thread->preferences->textbox_focus_policy |= CLICK_DEACTIVATE;
780 pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_DEACTIVATE;
786 ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y)
789 pwindow->thread->preferences->scan_commercials,
790 _("Scan for commercials during toc build"))
792 this->pwindow = pwindow;
794 int ScanCommercials::handle_event()
796 pwindow->thread->preferences->scan_commercials = get_value();
801 AndroidRemote::AndroidRemote(PreferencesWindow *pwindow, int x, int y)
803 pwindow->thread->preferences->android_remote,
804 _("Android Remote Control"))
806 this->pwindow = pwindow;
808 int AndroidRemote::handle_event()
810 pwindow->thread->preferences->android_remote = get_value();
814 AndroidPIN::AndroidPIN(PreferencesWindow *pwindow, int x, int y)
815 : BC_TextBox(x, y, 240, 1, pwindow->thread->preferences->android_pin)
817 this->pwindow = pwindow;
820 int AndroidPIN::handle_event()
822 char *txt = pwindow->thread->preferences->android_pin;
823 int len = sizeof(pwindow->thread->preferences->android_pin);
824 strncpy(txt, get_text(), len);
829 AndroidPort::AndroidPort(PreferencesWindow *pwindow, int x, int y)
830 : BC_TextBox(x, y, 72, 1, pwindow->thread->preferences->android_port)
832 this->pwindow = pwindow;
835 int AndroidPort::handle_event()
837 unsigned short port = atoi(get_text());
838 if( port < 1024 ) port = 1024;
839 pwindow->thread->preferences->android_port = port;
841 sprintf(str,"%u",port);
846 int InterfacePrefs::start_shbtn_dialog()
849 shbtn_dialog = new ShBtnEditDialog(pwindow);
850 shbtn_dialog->start();
854 ShBtnPrefs::ShBtnPrefs(PreferencesWindow *pwindow, InterfacePrefs *iface_prefs, int x, int y)
855 : BC_GenericButton(x, y, _("Shell Commands"))
857 this->pwindow = pwindow;
858 this->iface_prefs = iface_prefs;
859 set_tooltip(_("Main Menu Shell Commands"));
862 int ShBtnPrefs::handle_event()
864 return iface_prefs->start_shbtn_dialog();
868 StillImageUseDuration::StillImageUseDuration(PreferencesWindow *pwindow, int value, int x, int y)
869 : BC_CheckBox(x, y, value, _("Import images with a duration of"))
871 this->pwindow = pwindow;
874 int StillImageUseDuration::handle_event()
876 pwindow->thread->edl->session->si_useduration = get_value();
880 StillImageDuration::StillImageDuration(PreferencesWindow *pwindow, int x, int y)
881 : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->si_duration)
883 this->pwindow = pwindow;
885 int StillImageDuration::handle_event()
887 pwindow->thread->edl->session->si_duration = atof(get_text());
892 HairlineItem::HairlineItem(KeyframeReticle *popup, int hairline)
893 : BC_MenuItem(popup->hairline_to_string(hairline))
896 this->hairline = hairline;
899 HairlineItem::~HairlineItem()
903 int HairlineItem::handle_event()
905 popup->set_text(get_text());
906 *(popup->output) = hairline;
911 KeyframeReticle::KeyframeReticle(int x, int y, int *output)
912 : BC_PopupMenu(x, y, 175, hairline_to_string(*output))
914 this->output = output;
917 KeyframeReticle::~KeyframeReticle()
921 const char *KeyframeReticle::hairline_to_string(int type)
924 case HAIRLINE_NEVER: return _("Never");
925 case HAIRLINE_DRAGGING: return _("Dragging");
926 case HAIRLINE_ALWAYS: return _("Always");
931 void KeyframeReticle::create_objects()
933 add_item(new HairlineItem(this, HAIRLINE_NEVER));
934 add_item(new HairlineItem(this, HAIRLINE_DRAGGING));
935 add_item(new HairlineItem(this, HAIRLINE_ALWAYS));