4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 #include "arraylist.h"
26 #include "automation.h"
27 #include "autoconf.inc"
28 #include "bcwindowbase.inc"
32 #include "filexml.inc"
33 #include "floatautos.inc"
35 #include "maxchannels.h"
37 #include "panautos.inc"
45 class STrack : public Track
48 STrack(EDL *edl, Tracks *tracks);
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,
69 int identical(int64_t sample1, int64_t sample2);
75 class SEdit : public Edit
79 SEdit(EDL *edl, Edits *edits);
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);
86 int64_t get_source_end(int64_t default_);
87 char *get_text() { return text; }
90 class SEdits : public Edits {
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());
98 //int optimize() { return 0; }
102 class SAutomation : public Automation {
104 SAutomation(EDL *edl, Track *track) : Automation(edl, track) {}
106 void create_objects() { Automation::create_objects(); }
109 class SPatchGUI : public PatchGUI
112 SPatchGUI(MWindow *mwindow, PatchBay *patchbay, STrack *track, int x, int y) :
113 PatchGUI(mwindow, patchbay, track, x, y) { data_type = TRACK_SUBTITLE; }
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);