~akirad/cinecutie/trunk

« back to all changes in this revision

Viewing changes to cinecutie/plugintoggles.C

  • Committer: Paolo Rampino
  • Date: 2010-02-17 19:46:21 UTC
  • Revision ID: git-v1:c39ff77ffa6ae08441c12e7d7f54e3897ddde7f1
Initial Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "mwindow.h"
 
23
#include "plugin.h"
 
24
#include "plugintoggles.h"
 
25
#include "theme.h"
 
26
 
 
27
 
 
28
 
 
29
PluginOn::PluginOn(MWindow *mwindow, int x, int y, Plugin *plugin)
 
30
 : BC_Toggle(x, 
 
31
                y, 
 
32
                mwindow->theme->get_image_set("plugin_on"),
 
33
                plugin->on)
 
34
{
 
35
        this->mwindow = mwindow;
 
36
        this->plugin = plugin;
 
37
        in_use = 1;
 
38
}
 
39
 
 
40
int PluginOn::calculate_w(MWindow *mwindow)
 
41
{
 
42
        return mwindow->theme->get_image_set("plugin_on")[0]->get_w();
 
43
}
 
44
 
 
45
void PluginOn::update(int x, int y, Plugin *plugin)
 
46
{
 
47
        BC_Toggle::set_value(plugin->on, 0);
 
48
        reposition_window(x, y);
 
49
        this->plugin = plugin;
 
50
        in_use = 1;
 
51
}
 
52
 
 
53
int PluginOn::handle_event()
 
54
{
 
55
        plugin->on = get_value();
 
56
        unlock_window();
 
57
        mwindow->restart_brender();
 
58
        mwindow->sync_parameters(CHANGE_EDL);
 
59
        lock_window("PluginOn::handle_event");
 
60
        return 1;
 
61
}
 
62
 
 
63
 
 
64
 
 
65
 
 
66
PluginShow::PluginShow(MWindow *mwindow, int x, int y, Plugin *plugin)
 
67
 : BC_Toggle(x, 
 
68
                y, 
 
69
                mwindow->theme->get_image_set("plugin_show"),
 
70
                plugin->show)
 
71
{
 
72
        this->mwindow = mwindow;
 
73
        this->plugin = plugin;
 
74
        in_use = 1;
 
75
}
 
76
 
 
77
int PluginShow::calculate_w(MWindow *mwindow)
 
78
{
 
79
        return mwindow->theme->get_image_set("plugin_show")[0]->get_w();
 
80
}
 
81
 
 
82
void PluginShow::update(int x, int y, Plugin *plugin)
 
83
{
 
84
        BC_Toggle::set_value(plugin->show, 0);
 
85
        reposition_window(x, y);
 
86
        this->plugin = plugin;
 
87
        in_use = 1;
 
88
}
 
89
 
 
90
int PluginShow::handle_event()
 
91
{
 
92
        unlock_window();
 
93
        if(get_value()) 
 
94
                mwindow->show_plugin(plugin);
 
95
        else
 
96
                mwindow->hide_plugin(plugin, 1);
 
97
        lock_window("PluginShow::handle_event");
 
98
        return 1;
 
99
}
 
100
 
 
101
 
 
102
 
 
103
 
 
104