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
24 #include "edlsession.h"
26 #include "gwindowgui.h"
30 #include "mwindowgui.h"
32 #include "trackcanvas.h"
35 ShowAssets::ShowAssets(MWindow *mwindow, const char *hotkey)
36 : BC_MenuItem(_("Show assets"), hotkey, hotkey[0])
38 this->mwindow = mwindow;
39 set_checked(mwindow->edl->session->show_assets);
42 int ShowAssets::handle_event()
44 set_checked(get_checked() ^ 1);
45 mwindow->edl->session->show_assets = get_checked();
46 mwindow->gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
47 mwindow->gui->unlock_window();
48 mwindow->gwindow->gui->update_toggles(1);
49 mwindow->gui->lock_window("ShowAssets::handle_event");
56 ShowTitles::ShowTitles(MWindow *mwindow, const char *hotkey)
57 : BC_MenuItem(_("Show titles"), hotkey, hotkey[0])
59 this->mwindow = mwindow;
60 set_checked(mwindow->edl->session->show_titles);
63 int ShowTitles::handle_event()
65 set_checked(get_checked() ^ 1);
66 mwindow->edl->session->show_titles = get_checked();
67 mwindow->gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
68 mwindow->gui->unlock_window();
69 mwindow->gwindow->gui->update_toggles(1);
70 mwindow->gui->lock_window("ShowTitles::handle_event");
76 ShowTransitions::ShowTransitions(MWindow *mwindow, const char *hotkey)
77 : BC_MenuItem(_("Show transitions"), hotkey, hotkey[0])
79 this->mwindow = mwindow;
80 set_checked(mwindow->edl->session->auto_conf->transitions);
82 int ShowTransitions::handle_event()
84 set_checked(get_checked() ^ 1);
85 mwindow->edl->session->auto_conf->transitions = get_checked();
86 mwindow->gui->draw_overlays(1);
87 // mwindow->gui->mainmenu->draw_items();
88 mwindow->gui->unlock_window();
89 mwindow->gwindow->gui->update_toggles(1);
90 mwindow->gui->lock_window("ShowTransitions::handle_event");
98 ShowAutomation::ShowAutomation(MWindow *mwindow,
102 : BC_MenuItem(text, hotkey, hotkey[strlen(hotkey)-1])
104 this->mwindow = mwindow;
105 this->subscript = subscript;
106 set_checked(mwindow->edl->session->auto_conf->autos[subscript]);
109 int ShowAutomation::handle_event()
111 set_checked(get_checked() ? 0 : 1);
112 mwindow->edl->session->auto_conf->autos[subscript] = get_checked();
113 mwindow->gui->draw_overlays(1);
114 // mwindow->gui->mainmenu->draw_items();
115 mwindow->gui->unlock_window();
116 mwindow->gwindow->gui->update_toggles(1);
117 mwindow->gui->lock_window("ShowAutomation::handle_event");
121 void ShowAutomation::update_toggle()
123 set_checked(mwindow->edl->session->auto_conf->autos[subscript]);
128 PluginAutomation::PluginAutomation(MWindow *mwindow, const char *hotkey)
129 : BC_MenuItem(_("Plugin Keyframes"), hotkey, hotkey[0])
131 this->mwindow = mwindow;
134 int PluginAutomation::handle_event()
136 set_checked(!get_checked());
137 mwindow->edl->session->auto_conf->plugins = get_checked();
138 mwindow->gui->draw_overlays(1);
139 mwindow->gui->unlock_window();
140 mwindow->gwindow->gui->update_toggles(1);
141 mwindow->gui->lock_window("PluginAutomation::handle_event");