add binfolder path relative filters, fix gbrp color model, vwdw timebar tweaks, title...
[goodguy/history.git] / cinelerra-5.1 / 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 ShowAssets::ShowAssets(MWindow *mwindow, const char *hotkey)
36  : BC_MenuItem(_("Show assets"), hotkey, hotkey[0])
37 {
38         this->mwindow = mwindow;
39         set_checked(mwindow->edl->session->show_assets);
40 }
41
42 int ShowAssets::handle_event()
43 {
44         set_checked(get_checked() ^ 1);
45         mwindow->edl->session->show_assets = get_checked();
46         mwindow->gui->update(1,
47                 1,
48                 0,
49                 0,
50                 1,
51                 0,
52                 0);
53         mwindow->gui->unlock_window();
54         mwindow->gwindow->gui->update_toggles(1);
55         mwindow->gui->lock_window("ShowAssets::handle_event");
56         return 1;
57 }
58
59
60
61
62 ShowTitles::ShowTitles(MWindow *mwindow, const char *hotkey)
63  : BC_MenuItem(_("Show titles"), hotkey, hotkey[0])
64 {
65         this->mwindow = mwindow;
66         set_checked(mwindow->edl->session->show_titles);
67 }
68
69 int ShowTitles::handle_event()
70 {
71         set_checked(get_checked() ^ 1);
72         mwindow->edl->session->show_titles = get_checked();
73         mwindow->gui->update(1,
74                 1,
75                 0,
76                 0,
77                 1,
78                 0,
79                 0);
80         mwindow->gui->unlock_window();
81         mwindow->gwindow->gui->update_toggles(1);
82         mwindow->gui->lock_window("ShowTitles::handle_event");
83         return 1;
84 }
85
86
87
88 ShowTransitions::ShowTransitions(MWindow *mwindow, const char *hotkey)
89  : BC_MenuItem(_("Show transitions"), hotkey, hotkey[0])
90 {
91         this->mwindow = mwindow;
92         set_checked(mwindow->edl->session->auto_conf->transitions);
93 }
94 int ShowTransitions::handle_event()
95 {
96         set_checked(get_checked() ^ 1);
97         mwindow->edl->session->auto_conf->transitions = get_checked();
98         mwindow->gui->draw_overlays(1);
99 //      mwindow->gui->mainmenu->draw_items();
100         mwindow->gui->unlock_window();
101         mwindow->gwindow->gui->update_toggles(1);
102         mwindow->gui->lock_window("ShowTransitions::handle_event");
103         return 1;
104 }
105
106
107
108
109
110 ShowAutomation::ShowAutomation(MWindow *mwindow,
111         const char *text,
112         const char *hotkey,
113         int subscript)
114  : BC_MenuItem(text, hotkey, hotkey[0])
115 {
116         this->mwindow = mwindow;
117         this->subscript = subscript;
118         set_checked(mwindow->edl->session->auto_conf->autos[subscript]);
119 }
120
121 int ShowAutomation::handle_event()
122 {
123         set_checked(get_checked() ? 0 : 1);
124         mwindow->edl->session->auto_conf->autos[subscript] = get_checked();
125         mwindow->gui->draw_overlays(1);
126 //      mwindow->gui->mainmenu->draw_items();
127         mwindow->gui->unlock_window();
128         mwindow->gwindow->gui->update_toggles(1);
129         mwindow->gui->lock_window("ShowAutomation::handle_event");
130         return 1;
131 }
132
133 void ShowAutomation::update_toggle()
134 {
135         set_checked(mwindow->edl->session->auto_conf->autos[subscript]);
136 }
137
138
139
140 PluginAutomation::PluginAutomation(MWindow *mwindow, const char *hotkey)
141  : BC_MenuItem(_("Plugin Keyframes"), hotkey, hotkey[0])
142 {
143         this->mwindow = mwindow;
144 }
145
146 int PluginAutomation::handle_event()
147 {
148         set_checked(!get_checked());
149         mwindow->edl->session->auto_conf->plugins = get_checked();
150         mwindow->gui->draw_overlays(1);
151         mwindow->gui->unlock_window();
152         mwindow->gwindow->gui->update_toggles(1);
153         mwindow->gui->lock_window("PluginAutomation::handle_event");
154         return 1;
155 }
156
157