initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / viewmenu.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
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.
10  * 
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.
15  * 
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
19  * 
20  */
21
22 #include "autoconf.h"
23 #include "edl.h"
24 #include "edlsession.h"
25 #include "gwindow.h"
26 #include "gwindowgui.h"
27 #include "language.h"
28 #include "mainmenu.h"
29 #include "mwindow.h"
30 #include "mwindowgui.h"
31 #include "viewmenu.h"
32 #include "trackcanvas.h"
33
34
35
36
37
38 ShowAssets::ShowAssets(MWindow *mwindow, const char *hotkey)
39  : BC_MenuItem(_("Show assets"), hotkey, hotkey[0])
40 {
41         this->mwindow = mwindow; 
42         set_checked(mwindow->edl->session->show_assets); 
43 }
44
45 int ShowAssets::handle_event()
46 {
47         set_checked(get_checked() ^ 1);
48         mwindow->edl->session->show_assets = get_checked();
49         mwindow->gui->update(1,
50                 1,
51                 0,
52                 0,
53                 1, 
54                 0,
55                 0);
56         mwindow->gui->unlock_window();
57         mwindow->gwindow->gui->update_toggles(1);
58         mwindow->gui->lock_window("ShowAssets::handle_event");
59         return 1;
60 }
61
62
63
64
65 ShowTitles::ShowTitles(MWindow *mwindow, const char *hotkey)
66  : BC_MenuItem(_("Show titles"), hotkey, hotkey[0])
67 {
68         this->mwindow = mwindow; 
69         set_checked(mwindow->edl->session->show_titles); 
70 }
71
72 int ShowTitles::handle_event()
73 {
74         set_checked(get_checked() ^ 1);
75         mwindow->edl->session->show_titles = get_checked();
76         mwindow->gui->update(1,
77                 1,
78                 0,
79                 0,
80                 1, 
81                 0,
82                 0);
83         mwindow->gui->unlock_window();
84         mwindow->gwindow->gui->update_toggles(1);
85         mwindow->gui->lock_window("ShowTitles::handle_event");
86         return 1;
87 }
88
89
90
91 ShowTransitions::ShowTransitions(MWindow *mwindow, const char *hotkey)
92  : BC_MenuItem(_("Show transitions"), hotkey, hotkey[0])
93
94         this->mwindow = mwindow; 
95         set_checked(mwindow->edl->session->auto_conf->transitions); 
96 }
97 int ShowTransitions::handle_event()
98 {
99         set_checked(get_checked() ^ 1);
100         mwindow->edl->session->auto_conf->transitions = get_checked();
101         mwindow->gui->draw_overlays(1);
102 //      mwindow->gui->mainmenu->draw_items();
103         mwindow->gui->unlock_window();
104         mwindow->gwindow->gui->update_toggles(1);
105         mwindow->gui->lock_window("ShowTransitions::handle_event");
106         return 1;
107 }
108
109
110
111
112
113 ShowAutomation::ShowAutomation(MWindow *mwindow, 
114         const char *text,
115         const char *hotkey,
116         int subscript)
117  : BC_MenuItem(text, hotkey, hotkey[0])
118 {
119         this->mwindow = mwindow;
120         this->subscript = subscript;
121         set_checked(mwindow->edl->session->auto_conf->autos[subscript]); 
122 }
123
124 int ShowAutomation::handle_event()
125 {
126         set_checked(get_checked() ? 0 : 1);
127         mwindow->edl->session->auto_conf->autos[subscript] = get_checked();
128         mwindow->gui->draw_overlays(1);
129 //      mwindow->gui->mainmenu->draw_items();
130         mwindow->gui->unlock_window();
131         mwindow->gwindow->gui->update_toggles(1);
132         mwindow->gui->lock_window("ShowAutomation::handle_event");
133         return 1;
134 }
135
136 void ShowAutomation::update_toggle()
137 {
138         set_checked(mwindow->edl->session->auto_conf->autos[subscript]);
139 }
140
141
142
143 PluginAutomation::PluginAutomation(MWindow *mwindow, const char *hotkey)
144  : BC_MenuItem(_("Plugin keyframes"), hotkey, hotkey[0]) 
145
146         this->mwindow = mwindow; 
147 }
148
149 int PluginAutomation::handle_event()
150 {
151         set_checked(!get_checked());
152         mwindow->edl->session->auto_conf->plugins = get_checked();
153         mwindow->gui->draw_overlays(1);
154         mwindow->gui->unlock_window();
155         mwindow->gwindow->gui->update_toggles(1);
156         mwindow->gui->lock_window("PluginAutomation::handle_event");
157         return 1;
158 }
159
160