port 7.2 mods: align_edits foreground plugin refresh_frame tweak, rework soundlevel...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / effectlist.C
1 /*
2  * CINELERRA
3  * Copyright (C) 2006 Pierre Dumuid
4  * Copyright (C) 1997-2012 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 "awindow.h"
23 #include "awindowgui.h"
24 #include "clip.h"
25 #include "cstrdup.h"
26 #include "effectlist.h"
27 #include "edl.h"
28 #include "guicast.h"
29 #include "language.h"
30 #include "localsession.h"
31 #include "mwindow.h"
32 #include "pluginserver.h"
33
34
35 EffectTipItem::EffectTipItem(AWindowGUI *gui)
36  : BC_MenuItem("","i",'i')
37 {
38         this->gui = gui;
39         update();
40 }
41 EffectTipItem::~EffectTipItem()
42 {
43 }
44
45
46 int EffectTipItem::handle_event()
47 {
48         int v = !gui->tip_info ? 1 : 0;
49         update(v);
50         return 1;
51 }
52
53 void EffectTipItem::update(int v)
54 {
55         if( v >= 0 ) gui->tip_info = v;
56         else v = gui->tip_info;
57         const char *text = v ?  _("Info off") : _("Info on");
58         set_text(text);
59 }
60
61
62 EffectListMenu::EffectListMenu(MWindow *mwindow, AWindowGUI *gui)
63  : BC_PopupMenu(0, 0, 0, "", 0)
64 {
65         this->mwindow = mwindow;
66         this->gui = gui;
67 }
68
69 EffectListMenu:: ~EffectListMenu()
70 {
71 }
72
73 void EffectListMenu::create_objects()
74 {
75         add_item(info = new EffectTipItem(gui));
76         add_item(format = new AWindowListFormat(mwindow, gui));
77         add_item(new AWindowListSort(mwindow, gui));
78 }
79
80 void EffectListMenu::update()
81 {
82         info->update();
83         format->update();
84 }
85