add haupauge-1657 dual usb capture support, add deinterlace to recordmonitor, asset...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / pluginprefs.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 "pluginprefs.h"
23 #include "preferences.h"
24 #include <string.h>
25
26
27 #include <libintl.h>
28 #define _(String) gettext(String)
29 #define gettext_noop(String) String
30 #define N_(String) gettext_noop (String)
31
32
33 PluginPrefs::PluginPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
34  : PreferencesDialog(mwindow, pwindow)
35 {
36 }
37
38 PluginPrefs::~PluginPrefs()
39 {
40         delete ipath;
41         delete ipathtext;
42         delete lpath;
43         delete lpathtext;
44 }
45
46 void PluginPrefs::create_objects()
47 {
48         char string[1024];
49         int xs5 = xS(5), xs10 = xS(10), xs20 = xS(20), xs30 = xS(30);
50         int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30);
51         int x = xs5, y = ys5;
52
53 //      add_border(get_resources()->get_bg_shadow1(),
54 //              get_resources()->get_bg_shadow2(),
55 //              get_resources()->get_bg_color(),
56 //              get_resources()->get_bg_light2(),
57 //              get_resources()->get_bg_light1());
58
59         add_subwindow(new BC_Title(x, y, _("Plugin Set"), LARGEFONT, BLACK));
60         y += ys35;
61         add_subwindow(new BC_Title(x, y, _("Look for global plugins here"), MEDIUMFONT, BLACK));
62         y += ys20;
63         add_subwindow(ipathtext = new PluginGlobalPathText(x, y,
64                         pwindow, pwindow->thread->preferences->global_plugin_dir));
65         add_subwindow(ipath = new BrowseButton(mwindow, this, ipathtext,
66                 xS(215), y, pwindow->thread->preferences->global_plugin_dir,
67                 _("Global Plugin Path"), _("Select the directory for plugins"),
68                 1));
69
70         y += 35;
71         add_subwindow(new BC_Title(x, y, _("Look for personal plugins here"), MEDIUMFONT, BLACK));
72         y += 20;
73         add_subwindow(lpathtext = new PluginLocalPathText(x, y,
74                         pwindow, pwindow->thread->preferences->local_plugin_dir));
75         add_subwindow(lpath = new BrowseButton(mwindow, this, lpathtext,
76                 xS(215), y, pwindow->thread->preferences->local_plugin_dir,
77                 _("Personal Plugin Path"), _("Select the directory for plugins"),
78                 1));
79
80 }
81
82
83
84
85 PluginGlobalPathText::PluginGlobalPathText(int x, int y, PreferencesWindow *pwindow, char *text)
86  : BC_TextBox(x, y, xS(200), 1, text)
87 {
88         this->pwindow = pwindow;
89 }
90
91 PluginGlobalPathText::~PluginGlobalPathText() {}
92
93 int PluginGlobalPathText::handle_event()
94 {
95         strcpy(pwindow->thread->preferences->global_plugin_dir, get_text());
96 }
97
98
99
100
101
102 PluginLocalPathText::PluginLocalPathText(int x, int y, PreferencesWindow *pwindow, char *text)
103  : BC_TextBox(x, y, xs(200), 1, text)
104 {
105         this->pwindow = pwindow;
106 }
107
108 PluginLocalPathText::~PluginLocalPathText() {}
109
110 int PluginLocalPathText::handle_event()
111 {
112         strcpy(pwindow->thread->preferences->local_plugin_dir, get_text());
113 }