confirm prefs update, fix bg_pixmap sz, plugin layout tweaks
[goodguy/cinelerra.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, 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");
50         return 1;
51 }
52
53
54
55
56 ShowTitles::ShowTitles(MWindow *mwindow, const char *hotkey)
57  : BC_MenuItem(_("Show titles"), hotkey, hotkey[0])
58 {
59         this->mwindow = mwindow;
60         set_checked(mwindow->edl->session->show_titles);
61 }
62
63 int ShowTitles::handle_event()
64 {
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");
71         return 1;
72 }
73
74
75
76 ShowTransitions::ShowTransitions(MWindow *mwindow, const char *hotkey)
77  : BC_MenuItem(_("Show transitions"), hotkey, hotkey[0])
78 {
79         this->mwindow = mwindow;
80         set_checked(mwindow->edl->session->auto_conf->transitions);
81 }
82 int ShowTransitions::handle_event()
83 {
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");
91         return 1;
92 }
93
94
95
96
97
98 ShowAutomation::ShowAutomation(MWindow *mwindow,
99         const char *text,
100         const char *hotkey,
101         int subscript)
102  : BC_MenuItem(text, hotkey, hotkey[strlen(hotkey)-1])
103 {
104         this->mwindow = mwindow;
105         this->subscript = subscript;
106         set_checked(mwindow->edl->session->auto_conf->autos[subscript]);
107 }
108
109 int ShowAutomation::handle_event()
110 {
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");
118         return 1;
119 }
120
121 void ShowAutomation::update_toggle()
122 {
123         set_checked(mwindow->edl->session->auto_conf->autos[subscript]);
124 }
125
126
127
128 PluginAutomation::PluginAutomation(MWindow *mwindow, const char *hotkey)
129  : BC_MenuItem(_("Plugin Keyframes"), hotkey, hotkey[0])
130 {
131         this->mwindow = mwindow;
132 }
133
134 int PluginAutomation::handle_event()
135 {
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");
142         return 1;
143 }
144
145