hard edges rework, add hard edge in gwdw, config.ac nv/cuda tweaks, message log warn...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / newpresets.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 "newpresets.h"
23
24
25
26
27 NewPresetsText::NewPresetsText(MWindow *mwindow,
28         NewWindow *new_gui,
29         SetFormatWindow *format_gui,
30         int x,
31         int y)
32  : BC_TextBox(x, y, 200, 1, window->get_preset_text())
33 {
34         this->mwindow = mwindow;
35         this->new_gui = new_gui;
36         this->format_gui = format_gui;
37 }
38
39 int NewPresetsText::handle_event()
40 {
41         return 1;
42 }
43
44
45
46
47
48 NewPresetsPulldown::NewPresetsPulldown(MWindow *mwindow, NewWindow *window, int x, int y)
49  : BC_ListBox(x,
50                 y,
51                 200,
52                 200,
53                 LISTBOX_TEXT,                   // Display text list or icons
54                 (ArrayList<BC_ListBoxItem*>*)&window->preset_items, // Each column has an ArrayList of BC_ListBoxItems.
55                 0,             // Titles for columns.  Set to 0 for no titles
56                 0,                // width of each column
57                 1,                      // Total columns.
58                 0,                    // Pixel of top of window.
59                 1)
60 {
61         this->mwindow = mwindow;
62         this->window = window;
63 }
64 int NewPresetsPulldown::handle_event()
65 {
66         NewPresetItem *preset = ((NewPresetItem*)get_selection(0, 0));
67         window->new_edl->copy_all(preset->edl);
68         window->update();
69         window->presets_text->update(preset->get_text());
70         return 1;
71 }
72
73 NewPresetItem::NewPresetItem(MWindow *mwindow, NewWindow *window, char *text)
74  : BC_ListBoxItem(text)
75 {
76         this->mwindow = mwindow;
77         this->window = window;
78         edl = new EDL;
79         edl->create_objects();
80         edl->copy_all(window->new_edl);
81 }
82
83 NewPresetItem::~NewPresetItem()
84 {
85         edl->Garbage::remove_user();
86 }
87
88