4 #include "apluginset.h"
8 #include "aautomation.h"
11 #include "edlsession.h"
17 #include "floatautos.h"
18 #include "localsession.h"
19 #include "mainsession.h"
22 #include "trackcanvas.h"
28 #define _(String) gettext(String)
29 #define gettext_noop(String) String
30 #define N_(String) gettext_noop (String)
33 ATrack::ATrack(EDL *edl, Tracks *tracks)
36 data_type = TRACK_AUDIO;
43 // Used by PlaybackEngine
44 void ATrack::synchronize_params(Track *track)
46 Track::synchronize_params(track);
48 ATrack *atrack = (ATrack*)track;
51 int ATrack::copy_settings(Track *track)
53 Track::copy_settings(track);
55 ATrack *atrack = (ATrack*)track;
60 int ATrack::save_header(FileXML *file)
62 file->tag.set_property("TYPE", "AUDIO");
66 int ATrack::save_derived(FileXML *file)
68 char string[BCTEXTLEN];
69 file->append_newline();
73 int ATrack::load_header(FileXML *file, uint32_t load_flags)
79 int ATrack::load_derived(FileXML *file, uint32_t load_flags)
84 int ATrack::create_objects()
86 Track::create_objects();
87 automation = new AAutomation(edl, this);
88 automation->create_objects();
89 edits = new AEdits(edl, this);
93 int ATrack::vertical_span(Theme *theme)
95 int track_h = Track::vertical_span(theme);
99 patch_h += theme->title_h + theme->play_h + theme->fade_h + theme->meter_h + theme->pan_h;
101 return MAX(track_h, patch_h);
104 PluginSet* ATrack::new_plugins()
106 return new APluginSet(edl, this);
109 int ATrack::load_defaults(Defaults *defaults)
111 Track::load_defaults(defaults);
115 void ATrack::set_default_title()
117 Track *current = ListItem<Track>::owner->first;
119 for(i = 0; current; current = NEXT)
121 if(current->data_type == TRACK_AUDIO) i++;
123 sprintf(title, _("Audio %d"), i);
126 int64_t ATrack::to_units(double position, int round)
129 return Units::round(position * edl->session->sample_rate);
131 return Units::to_int64(position * edl->session->sample_rate);
134 double ATrack::to_doubleunits(double position)
136 return position * edl->session->sample_rate;
139 double ATrack::from_units(int64_t position)
141 return (double)position / edl->session->sample_rate;
145 int ATrack::identical(int64_t sample1, int64_t sample2)
148 if(labs(sample1 - sample2) <= 1) return 1; else return 0;
174 int64_t ATrack::length()
176 return edits->length();
179 int ATrack::get_dimensions(double &view_start,
183 view_start = (double)edl->local_session->view_start * edl->session->sample_rate;
184 view_units = (double)0;
185 // view_units = (double)tracks->view_samples();
186 zoom_units = (double)edl->local_session->zoom_sample;
195 int ATrack::paste_derived(int64_t start, int64_t end, int64_t total_length, FileXML *xml, int ¤t_channel)
197 if(!strcmp(xml->tag.get_title(), "PANAUTOS"))
199 current_channel = xml->tag.get_property("CHANNEL", current_channel);
200 // pan_autos->paste(start, end, total_length, xml, "/PANAUTOS", mwindow->session->autos_follow_edits);