drag edithandle rework, lib x264/x265 update, dvb fixes, batchrender boot_defaults...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / strack.h
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 #ifndef STRACK_H
23 #define STRACK_H
24
25 #include "arraylist.h"
26 #include "automation.h"
27 #include "autoconf.inc"
28 #include "bcwindowbase.inc"
29 #include "edl.inc"
30 #include "edit.h"
31 #include "edits.h"
32 #include "filexml.inc"
33 #include "floatautos.inc"
34 #include "linklist.h"
35 #include "maxchannels.h"
36 #include "mwindow.h"
37 #include "panautos.inc"
38 #include "patchbay.h"
39 #include "patchgui.h"
40 #include "track.h"
41
42
43
44
45 class STrack : public Track
46 {
47 public:
48         STrack(EDL *edl, Tracks *tracks);
49         STrack() {};
50         ~STrack();
51
52         int load_defaults(BC_Hash *defaults);
53         void synchronize_params(Track *track);
54         int copy_settings(Track *track);
55         int save_header(FileXML *file);
56         int save_derived(FileXML *file);
57         int load_header(FileXML *file, uint32_t load_flags);
58         int load_derived(FileXML *file, uint32_t load_flags);
59         void create_objects();
60         void set_default_title();
61         int vertical_span(Theme *theme);
62         int64_t to_units(double position, int round);
63         double to_doubleunits(double position);
64         double from_units(int64_t position);
65         int get_dimensions(int pane_number,
66                 double &view_start,
67                 double &view_units,
68                 double &zoom_units);
69         int identical(int64_t sample1, int64_t sample2);
70         int64_t length();
71 };
72
73 class SEdits;
74
75 class SEdit : public Edit
76 {
77         char text[BCTEXTLEN];
78 public:
79         SEdit(EDL *edl, Edits *edits);
80         ~SEdit();
81
82         void copy_from(Edit *edit);
83         int load_properties_derived(FileXML *xml);
84         int copy_properties_derived(FileXML *xml, int64_t length_in_selection);
85         int dump_derived();
86         int64_t get_source_end(int64_t default_);
87         char *get_text() { return text; }
88 };
89
90 class SEdits : public Edits {
91 public:
92         SEdits(EDL *edl, Track *track) : Edits(edl, track) {}
93         Edit* create_edit() { return new SEdit(edl, this); }
94         Edit* append_new_edit() { return append(create_edit()); }
95         Edit* insert_edit_after(Edit* previous_edit) {
96                 return insert_after(previous_edit, create_edit());
97         }
98         //int optimize() { return 0; }
99 };
100
101
102 class SAutomation : public Automation {
103 public:
104         SAutomation(EDL *edl, Track *track) : Automation(edl, track) {}
105         ~SAutomation() {}
106         void create_objects() { Automation::create_objects(); }
107 };
108
109 class SPatchGUI : public PatchGUI
110 {
111 public:
112         SPatchGUI(MWindow *mwindow, PatchBay *patchbay, STrack *track, int x, int y) :
113                 PatchGUI(mwindow, patchbay, track, x, y) { data_type = TRACK_SUBTITLE; }
114         ~SPatchGUI() {}
115
116         void create_objects() { update(x, y); }
117         int reposition(int x, int y) { return PatchGUI::reposition(x, y); }
118         int update(int x, int y) {
119                 return track->vertical_span(mwindow->theme) + PatchGUI::update(x, y);
120         }
121 };
122
123 #endif