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 "appearanceprefs.h"
23 #include "deleteallindexes.h"
25 #include "edlsession.h"
27 #include "filesystem.h"
30 #include "preferences.h"
31 #include "preferencesthread.h"
32 #include "shbtnprefs.h"
36 AppearancePrefs::AppearancePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
37 : PreferencesDialog(mwindow, pwindow)
49 AppearancePrefs::~AppearancePrefs()
58 delete thumbnail_size;
62 void AppearancePrefs::create_objects()
64 int xs5 = xS(5), xs10 = xS(10), xs30 = xS(30);
65 int ys5 = yS(5), ys10 = yS(10), ys15 = yS(15);
66 int ys20 = yS(20), ys35 = yS(35);
67 BC_Resources *resources = BC_WindowBase::get_resources();
68 int margin = mwindow->theme->widget_border;
69 char string[BCTEXTLEN];
70 int x0 = mwindow->theme->preferencesoptions_x;
71 int y0 = mwindow->theme->preferencesoptions_y;
72 int x = x0, y = y0, x1 = x + xS(100);
74 add_subwindow(new BC_Title(x, y, _("Layout:"), LARGEFONT,
75 resources->text_default));
80 add_subwindow(new BC_Title(x, y, _("Theme:")));
81 add_subwindow(theme = new ViewTheme(x1, y, pwindow));
82 theme->create_objects();
83 y += theme->get_h() + ys5;
86 ViewPluginIcons *plugin_icons;
87 add_subwindow(new BC_Title(x, y, _("Plugin Icons:")));
88 add_subwindow(plugin_icons = new ViewPluginIcons(x1, y, pwindow));
89 plugin_icons->create_objects();
90 y += plugin_icons->get_h() + ys15;
93 int x2 = x1 + xS(160), y2 = y;
95 add_subwindow(new BC_Title(x1, y, _("View thumbnail size:")));
96 thumbnail_size = new ViewThumbnailSize(pwindow, this, x2, y);
97 thumbnail_size->create_objects();
98 y += thumbnail_size->get_h() + ys5;
99 add_subwindow(new BC_Title(x1, y, _("Vicon quality:")));
100 vicon_size = new ViewViconSize(pwindow, this, x2, y);
101 vicon_size->create_objects();
102 y += vicon_size->get_h() + ys5;
103 add_subwindow(new BC_Title(x1, y, _("Vicon color mode:")));
104 add_subwindow(vicon_color_mode = new ViewViconColorMode(pwindow, x2, y));
105 vicon_color_mode->create_objects();
106 y += vicon_color_mode->get_h() + ys5;
110 add_subwindow(new BC_Bar(xs5, y, get_w() - xs10));
113 add_subwindow(new BC_Title(x, y, _("Time Format:"), LARGEFONT,
114 resources->text_default));
116 add_subwindow(new BC_Title(x1, y, _("Flags:"), LARGEFONT,
117 resources->text_default));
119 y += get_text_height(LARGEFONT) + ys5;
123 add_subwindow(hms = new TimeFormatHMS(pwindow, this,
124 pwindow->thread->edl->session->time_format == TIME_HMS,
127 add_subwindow(hmsf = new TimeFormatHMSF(pwindow, this,
128 pwindow->thread->edl->session->time_format == TIME_HMSF,
131 add_subwindow(samples = new TimeFormatSamples(pwindow, this,
132 pwindow->thread->edl->session->time_format == TIME_SAMPLES,
135 add_subwindow(hex = new TimeFormatHex(pwindow, this,
136 pwindow->thread->edl->session->time_format == TIME_SAMPLES_HEX,
139 add_subwindow(frames = new TimeFormatFrames(pwindow, this,
140 pwindow->thread->edl->session->time_format == TIME_FRAMES,
143 add_subwindow(feet = new TimeFormatFeet(pwindow, this,
144 pwindow->thread->edl->session->time_format == TIME_FEET_FRAMES,
146 x += feet->get_w() + xS(15);
148 add_subwindow(title = new BC_Title(x, y, _("Frames per foot:")));
149 x += title->get_w() + margin;
150 sprintf(string, "%0.2f", pwindow->thread->edl->session->frames_per_foot);
151 add_subwindow(new TimeFormatFeetSetting(pwindow,
152 x, y - ys5, string));
155 add_subwindow(seconds = new TimeFormatSeconds(pwindow, this,
156 pwindow->thread->edl->session->time_format == TIME_SECONDS,
160 add_subwindow(new BC_Bar(xs5, y, get_w()/2 - xs30));
163 add_subwindow(new BC_Title(x, y, _("Color:"), LARGEFONT,
164 resources->text_default));
166 add_subwindow(title = new BC_Title(x, y, _("Highlighting Inversion color:")));
167 x += title->get_w() + margin;
168 char hex_color[BCSTRLEN];
169 sprintf(hex_color, "%06x", preferences->highlight_inverse);
170 add_subwindow(new HighlightInverseColor(pwindow, x, y, hex_color));
173 add_subwindow(title = new BC_Title(x, y, _("Composer BG Color:")));
174 int clr_color = pwindow->thread->edl->session->cwindow_clear_color;
175 int clr_alpha = pwindow->thread->edl->session->cwindow_clear_alpha;
176 add_subwindow(cwdw_bg_color = new Composer_BG_Color(pwindow,
177 x2, y, xS(80), yS(24), clr_color, clr_alpha));
178 draw_3d_border(x2-2,y-2, 80+4,24+4, 1);
179 cwdw_bg_color->create_objects();
183 add_subwindow(title = new BC_Title(x, y, _("YUV color space:")));
184 x += title->get_w() + margin;
185 add_subwindow(yuv_color_space = new YuvColorSpace(x, y, pwindow));
186 yuv_color_space->create_objects();
187 y += yuv_color_space->get_h() + ys5;
190 add_subwindow(title = new BC_Title(x, y, _("YUV color range:")));
191 x += title->get_w() + margin;
192 add_subwindow(yuv_color_range = new YuvColorRange(x, y, pwindow));
193 yuv_color_range->create_objects();
194 y += yuv_color_range->get_h() + ys5;
196 UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1);
197 add_subwindow(tip_win);
198 y1 += tip_win->get_h() + ys5;
199 AutocolorAssets *autocolor_assets = new AutocolorAssets(pwindow, x1, y1);
200 add_subwindow(autocolor_assets);
201 y1 += autocolor_assets->get_h() + ys5;
202 UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1);
203 add_subwindow(idx_win);
204 y1 += idx_win->get_h() + ys5;
205 UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1);
206 add_subwindow(ver_win);
207 y1 += ver_win->get_h() + ys5;
208 BD_WarnRoot *bdwr_win = new BD_WarnRoot(pwindow, x1, y1);
209 add_subwindow(bdwr_win);
210 y1 += bdwr_win->get_h() + ys5;
211 PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1);
212 add_subwindow(pop_win);
213 y1 += pop_win->get_h() + ys5;
214 GrabFocusPolicy *grab_input_focus = new GrabFocusPolicy(pwindow, x1, y1);
215 add_subwindow(grab_input_focus);
216 y1 += grab_input_focus->get_h() + ys5;
217 ActivateFocusPolicy *focus_activate = new ActivateFocusPolicy(pwindow, x1, y1);
218 add_subwindow(focus_activate);
219 y1 += focus_activate->get_h() + ys5;
220 DeactivateFocusPolicy *focus_deactivate = new DeactivateFocusPolicy(pwindow, x1, y1);
221 add_subwindow(focus_deactivate);
222 y1 += focus_deactivate->get_h() + ys5;
223 ForwardRenderDisplacement *displacement = new ForwardRenderDisplacement(pwindow, x1, y1);
224 add_subwindow(displacement);
225 y1 += displacement->get_h() + ys5;
226 add_subwindow(thumbnails = new ViewThumbnails(x1, y1, pwindow));
227 y1 += thumbnails->get_h() + ys5;
228 PerpetualSession *perpetual = new PerpetualSession(x1, y1, pwindow);
229 add_subwindow(perpetual);
230 y1 += perpetual->get_h() + ys5;
231 CtrlToggle *ctrl_toggle = new CtrlToggle(x1, y1, pwindow);
232 add_subwindow(ctrl_toggle);
233 y1 += ctrl_toggle->get_h() + ys5;
234 RectifyAudioToggle *rect_toggle = new RectifyAudioToggle(x1, y1, pwindow);
235 add_subwindow(rect_toggle);
236 y1 += rect_toggle->get_h() + ys5;
240 int AppearancePrefs::update(int new_value)
242 pwindow->thread->redraw_times = 1;
243 pwindow->thread->edl->session->time_format = new_value;
244 hms->update(new_value == TIME_HMS);
245 hmsf->update(new_value == TIME_HMSF);
246 samples->update(new_value == TIME_SAMPLES);
247 hex->update(new_value == TIME_SAMPLES_HEX);
248 frames->update(new_value == TIME_FRAMES);
249 feet->update(new_value == TIME_FEET_FRAMES);
250 seconds->update(new_value == TIME_SECONDS);
255 TimeFormatHMS::TimeFormatHMS(PreferencesWindow *pwindow, AppearancePrefs *tfwindow, int value, int x, int y)
256 : BC_Radial(x, y, value, TIME_HMS_TEXT)
257 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
259 int TimeFormatHMS::handle_event()
261 tfwindow->update(TIME_HMS);
265 TimeFormatHMSF::TimeFormatHMSF(PreferencesWindow *pwindow, AppearancePrefs *tfwindow, int value, int x, int y)
266 : BC_Radial(x, y, value, TIME_HMSF_TEXT)
267 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
269 int TimeFormatHMSF::handle_event()
271 tfwindow->update(TIME_HMSF);
275 TimeFormatSamples::TimeFormatSamples(PreferencesWindow *pwindow, AppearancePrefs *tfwindow, int value, int x, int y)
276 : BC_Radial(x, y, value, TIME_SAMPLES_TEXT)
277 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
279 int TimeFormatSamples::handle_event()
281 tfwindow->update(TIME_SAMPLES);
285 TimeFormatFrames::TimeFormatFrames(PreferencesWindow *pwindow, AppearancePrefs *tfwindow, int value, int x, int y)
286 : BC_Radial(x, y, value, TIME_FRAMES_TEXT)
287 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
289 int TimeFormatFrames::handle_event()
291 tfwindow->update(TIME_FRAMES);
295 TimeFormatHex::TimeFormatHex(PreferencesWindow *pwindow, AppearancePrefs *tfwindow, int value, int x, int y)
296 : BC_Radial(x, y, value, TIME_SAMPLES_HEX_TEXT)
297 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
299 int TimeFormatHex::handle_event()
301 tfwindow->update(TIME_SAMPLES_HEX);
305 TimeFormatSeconds::TimeFormatSeconds(PreferencesWindow *pwindow, AppearancePrefs *tfwindow, int value, int x, int y)
306 : BC_Radial(x, y, value, TIME_SECONDS_TEXT)
308 this->pwindow = pwindow;
309 this->tfwindow = tfwindow;
312 int TimeFormatSeconds::handle_event()
314 tfwindow->update(TIME_SECONDS);
318 TimeFormatFeet::TimeFormatFeet(PreferencesWindow *pwindow, AppearancePrefs *tfwindow, int value, int x, int y)
319 : BC_Radial(x, y, value, TIME_FEET_FRAMES_TEXT)
320 { this->pwindow = pwindow; this->tfwindow = tfwindow; }
322 int TimeFormatFeet::handle_event()
324 tfwindow->update(TIME_FEET_FRAMES);
328 TimeFormatFeetSetting::TimeFormatFeetSetting(PreferencesWindow *pwindow, int x, int y, char *string)
329 : BC_TextBox(x, y, xS(90), 1, string)
330 { this->pwindow = pwindow; }
332 int TimeFormatFeetSetting::handle_event()
334 pwindow->thread->edl->session->frames_per_foot = atof(get_text());
335 if(pwindow->thread->edl->session->frames_per_foot < 1) pwindow->thread->edl->session->frames_per_foot = 1;
340 ViewTheme::ViewTheme(int x, int y, PreferencesWindow *pwindow)
341 : BC_PopupMenu(x, y, xS(200), pwindow->thread->preferences->theme, 1)
343 this->pwindow = pwindow;
345 ViewTheme::~ViewTheme()
349 void ViewTheme::create_objects()
351 ArrayList<PluginServer*> themes;
352 MWindow::search_plugindb(0, 0, 0, 0, 1, themes);
354 for(int i = 0; i < themes.total; i++) {
355 add_item(new ViewThemeItem(this, themes.values[i]->title));
359 int ViewTheme::handle_event()
364 ViewThemeItem::ViewThemeItem(ViewTheme *popup, const char *text)
370 int ViewThemeItem::handle_event()
372 popup->set_text(get_text());
373 strcpy(popup->pwindow->thread->preferences->theme, get_text());
374 popup->handle_event();
379 ViewPluginIcons::ViewPluginIcons(int x, int y, PreferencesWindow *pwindow)
380 : BC_PopupMenu(x, y, xS(200), pwindow->thread->preferences->plugin_icons, 1)
382 this->pwindow = pwindow;
384 ViewPluginIcons::~ViewPluginIcons()
388 void ViewPluginIcons::create_objects()
390 add_item(new ViewPluginIconItem(this, DEFAULT_PICON));
392 const char *plugin_path = File::get_plugin_path();
393 char picon_path[BCTEXTLEN];
394 snprintf(picon_path,sizeof(picon_path)-1,"%s/picon", plugin_path);
395 if( fs.update(picon_path) ) return;
396 for( int i=0; i<fs.dir_list.total; ++i ) {
397 char *fs_path = fs.dir_list[i]->path;
398 if( !fs.is_dir(fs_path) ) continue;
399 char *cp = strrchr(fs_path,'/');
400 cp = !cp ? fs_path : cp+1;
401 if( !strcmp(cp,DEFAULT_PICON) ) continue;
402 add_item(new ViewPluginIconItem(this, cp));
406 int ViewPluginIcons::handle_event()
411 ViewPluginIconItem::ViewPluginIconItem(ViewPluginIcons *popup, const char *text)
417 int ViewPluginIconItem::handle_event()
419 popup->set_text(get_text());
420 strcpy(popup->pwindow->thread->preferences->plugin_icons, get_text());
421 popup->handle_event();
426 ViewThumbnails::ViewThumbnails(int x,
428 PreferencesWindow *pwindow)
431 pwindow->thread->preferences->use_thumbnails, _("Use thumbnails in resource window"))
433 this->pwindow = pwindow;
436 int ViewThumbnails::handle_event()
438 pwindow->thread->preferences->use_thumbnails = get_value();
443 ViewThumbnailSize::ViewThumbnailSize(PreferencesWindow *pwindow,
444 AppearancePrefs *aprefs, int x, int y)
445 : BC_TumbleTextBox(aprefs,
446 pwindow->thread->preferences->awindow_picon_h,
447 16, 512, x, y, xS(80))
450 this->pwindow = pwindow;
451 this->aprefs = aprefs;
454 int ViewThumbnailSize::handle_event()
456 int v = atoi(get_text());
458 pwindow->thread->preferences->awindow_picon_h = v;
462 ViewViconSize::ViewViconSize(PreferencesWindow *pwindow,
463 AppearancePrefs *aprefs, int x, int y)
464 : BC_TumbleTextBox(aprefs,
465 pwindow->thread->preferences->vicon_size,
466 16, 512, x, y, xS(80))
469 this->pwindow = pwindow;
470 this->aprefs = aprefs;
473 int ViewViconSize::handle_event()
475 int v = atoi(get_text());
477 pwindow->thread->preferences->vicon_size = v;
481 ViewViconColorMode::ViewViconColorMode(PreferencesWindow *pwindow, int x, int y)
482 : BC_PopupMenu(x, y, xS(100),
483 _(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]), 1)
485 this->pwindow = pwindow;
487 ViewViconColorMode::~ViewViconColorMode()
491 const char *ViewViconColorMode::vicon_color_modes[] = {
497 void ViewViconColorMode::create_objects()
499 for( int id=0,nid=sizeof(vicon_color_modes)/sizeof(vicon_color_modes[0]); id<nid; ++id )
500 add_item(new ViewViconColorModeItem(this, _(vicon_color_modes[id]), id));
504 int ViewViconColorMode::handle_event()
506 set_text(_(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]));
510 ViewViconColorModeItem::ViewViconColorModeItem(ViewViconColorMode *popup, const char *text, int id)
517 int ViewViconColorModeItem::handle_event()
519 popup->set_text(get_text());
520 popup->pwindow->thread->preferences->vicon_color_mode = id;
521 return popup->handle_event();
525 UseTipWindow::UseTipWindow(PreferencesWindow *pwindow, int x, int y)
528 pwindow->thread->preferences->use_tipwindow,
529 _("Show tip of the day"))
531 this->pwindow = pwindow;
533 int UseTipWindow::handle_event()
535 pwindow->thread->preferences->use_tipwindow = get_value();
540 UseWarnIndecies::UseWarnIndecies(PreferencesWindow *pwindow, int x, int y)
541 : BC_CheckBox(x, y, pwindow->thread->preferences->warn_indexes,
542 _("ffmpeg probe warns rebuild indexes"))
544 this->pwindow = pwindow;
547 int UseWarnIndecies::handle_event()
549 pwindow->thread->preferences->warn_indexes = get_value();
553 UseWarnVersion::UseWarnVersion(PreferencesWindow *pwindow, int x, int y)
554 : BC_CheckBox(x, y, pwindow->thread->preferences->warn_version,
555 _("EDL version warns if mismatched"))
557 this->pwindow = pwindow;
560 int UseWarnVersion::handle_event()
562 pwindow->thread->preferences->warn_version = get_value();
566 BD_WarnRoot::BD_WarnRoot(PreferencesWindow *pwindow, int x, int y)
567 : BC_CheckBox(x, y, pwindow->thread->preferences->bd_warn_root,
568 _("Create Bluray warns if not root"))
570 this->pwindow = pwindow;
573 int BD_WarnRoot::handle_event()
575 pwindow->thread->preferences->bd_warn_root = get_value();
579 PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y)
580 : BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup,
581 _("Popups activate on button up"))
583 this->pwindow = pwindow;
586 int PopupMenuBtnup::handle_event()
588 pwindow->thread->preferences->popupmenu_btnup = get_value();
592 GrabFocusPolicy::GrabFocusPolicy(PreferencesWindow *pwindow, int x, int y)
593 : BC_CheckBox(x, y, (pwindow->thread->preferences->grab_input_focus) != 0,
594 _("Set Input Focus when window entered"))
596 this->pwindow = pwindow;
599 int GrabFocusPolicy::handle_event()
601 pwindow->thread->preferences->grab_input_focus = get_value();
605 ActivateFocusPolicy::ActivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
606 : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_ACTIVATE) != 0,
607 _("Click to activate text focus"))
609 this->pwindow = pwindow;
612 int ActivateFocusPolicy::handle_event()
615 pwindow->thread->preferences->textbox_focus_policy |= CLICK_ACTIVATE;
617 pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_ACTIVATE;
621 DeactivateFocusPolicy::DeactivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
622 : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_DEACTIVATE) != 0,
623 _("Click to deactivate text focus"))
625 this->pwindow = pwindow;
628 int DeactivateFocusPolicy::handle_event()
631 pwindow->thread->preferences->textbox_focus_policy |= CLICK_DEACTIVATE;
633 pwindow->thread->preferences->textbox_focus_policy &= ~CLICK_DEACTIVATE;
637 ForwardRenderDisplacement::ForwardRenderDisplacement(PreferencesWindow *pwindow, int x, int y)
638 : BC_CheckBox(x, y, pwindow->thread->preferences->forward_render_displacement,
639 _("Always show next frame"))
641 this->pwindow = pwindow;
644 int ForwardRenderDisplacement::handle_event()
646 pwindow->thread->preferences->forward_render_displacement = get_value();
650 AutocolorAssets::AutocolorAssets(PreferencesWindow *pwindow, int x, int y)
651 : BC_CheckBox(x, y, pwindow->thread->preferences->autocolor_assets,
652 _("Autocolor assets"))
654 this->pwindow = pwindow;
657 int AutocolorAssets::handle_event()
659 pwindow->thread->preferences->autocolor_assets = get_value();
663 HighlightInverseColor::HighlightInverseColor(PreferencesWindow *pwindow, int x, int y, const char *hex)
664 : BC_TextBox(x, y, xS(80), 1, hex)
666 this->pwindow = pwindow;
669 int HighlightInverseColor::handle_event()
671 int inverse_color = strtoul(get_text(),0,16);
672 if( (inverse_color &= 0xffffff) == 0 ) {
673 inverse_color = 0xffffff;
674 char string[BCSTRLEN];
675 sprintf(string,"%06x", inverse_color);
678 pwindow->thread->preferences->highlight_inverse = inverse_color;
683 const char *YuvColorSpace::color_space[] = {
689 YuvColorSpace::YuvColorSpace(int x, int y, PreferencesWindow *pwindow)
690 : BC_PopupMenu(x, y, xS(100),
691 _(color_space[pwindow->thread->preferences->yuv_color_space]), 1)
693 this->pwindow = pwindow;
695 YuvColorSpace::~YuvColorSpace()
699 void YuvColorSpace::create_objects()
701 for( int id=0,nid=sizeof(color_space)/sizeof(color_space[0]); id<nid; ++id )
702 add_item(new YuvColorSpaceItem(this, _(color_space[id]), id));
706 int YuvColorSpace::handle_event()
708 set_text(_(color_space[pwindow->thread->preferences->yuv_color_space]));
712 YuvColorSpaceItem::YuvColorSpaceItem(YuvColorSpace *popup, const char *text, int id)
719 int YuvColorSpaceItem::handle_event()
721 popup->set_text(get_text());
722 popup->pwindow->thread->preferences->yuv_color_space = id;
723 return popup->handle_event();
727 const char *YuvColorRange::color_range[] = {
732 YuvColorRange::YuvColorRange(int x, int y, PreferencesWindow *pwindow)
733 : BC_PopupMenu(x, y, xS(100),
734 _(color_range[pwindow->thread->preferences->yuv_color_range]), 1)
736 this->pwindow = pwindow;
738 YuvColorRange::~YuvColorRange()
742 void YuvColorRange::create_objects()
744 for( int id=0,nid=sizeof(color_range)/sizeof(color_range[0]); id<nid; ++id )
745 add_item(new YuvColorRangeItem(this, _(color_range[id]), id));
749 int YuvColorRange::handle_event()
751 set_text(color_range[pwindow->thread->preferences->yuv_color_range]);
755 YuvColorRangeItem::YuvColorRangeItem(YuvColorRange *popup, const char *text, int id)
762 int YuvColorRangeItem::handle_event()
764 popup->set_text(get_text());
765 popup->pwindow->thread->preferences->yuv_color_range = id;
766 return popup->handle_event();
769 PerpetualSession::PerpetualSession(int x, int y, PreferencesWindow *pwindow)
771 pwindow->thread->preferences->perpetual_session, _("Perpetual session"))
773 this->pwindow = pwindow;
776 int PerpetualSession::handle_event()
778 pwindow->thread->preferences->perpetual_session = get_value();
782 CtrlToggle::CtrlToggle(int x, int y, PreferencesWindow *pwindow)
784 pwindow->thread->preferences->ctrl_toggle, _("Clears before toggle"))
786 this->pwindow = pwindow;
789 int CtrlToggle::handle_event()
791 pwindow->thread->preferences->ctrl_toggle = get_value();
795 RectifyAudioToggle::RectifyAudioToggle(int x, int y, PreferencesWindow *pwindow)
797 pwindow->thread->preferences->rectify_audio, _("Timeline Rectify Audio"))
799 this->pwindow = pwindow;
802 int RectifyAudioToggle::handle_event()
804 pwindow->thread->preferences->rectify_audio = get_value();
808 Composer_BG_Color::Composer_BG_Color(PreferencesWindow *pwindow,
809 int x, int y, int w, int h, int color, int alpha)
810 : ColorBoxButton(_("Composer BG color"), x, y, w, h, color, alpha, 1)
812 this->pwindow = pwindow;
815 Composer_BG_Color::~Composer_BG_Color()
819 void Composer_BG_Color::handle_done_event(int result)
822 pwindow->lock_window("Composer_BG_Color::handle_done_event");
823 update_gui(orig_color, orig_alpha);
824 pwindow->unlock_window();
825 handle_new_color(orig_color, orig_alpha);
829 int Composer_BG_Color::handle_new_color(int color, int alpha)
831 pwindow->thread->edl->session->cwindow_clear_color = color;
832 pwindow->thread->edl->session->cwindow_clear_alpha = alpha;