4 * Copyright (C) 2008-2013 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
34 #include "amodule.inc"
35 #include "aplugin.inc"
40 #include "filexml.inc"
41 #include "floatautos.inc"
42 #include "maxchannels.h"
43 #include "meterhistory.h"
46 #include "samples.inc"
47 #include "sharedlocation.inc"
51 class AModuleResample : public Resample
54 AModuleResample(AModule *module);
57 // All positions are in source sample rate
58 int read_samples(Samples *buffer,
59 int64_t start, int64_t len, int direction);
62 // output for nested EDL if resampled
63 Samples *nested_output[MAX_CHANNELS];
64 // number of samples allocated
65 int nested_allocation;
68 class AModule : public Module
71 AModule(RenderEngine *renderengine,
72 CommonRender *commonrender,
73 PluginArray *plugin_array,
77 void create_objects();
80 int import_samples(AEdit *playable_edit,
81 int64_t start_project, int64_t edit_startproject, int64_t edit_startsource,
82 int direction, int sample_rate, Samples *buffer, int64_t fragment_len);
83 int render(Samples *buffer,
84 int64_t input_len, int64_t input_position, int direction,
85 int sample_rate, int use_nudge);
86 int read_samples(Samples *buffer,
87 int64_t start, int64_t len, int direction);
88 int get_buffer_size();
90 AttachmentPoint* new_attachment(Plugin *plugin);
95 // synchronization with tracks
96 FloatAutos* get_pan_automation(int channel); // get pan automation
97 FloatAutos* get_fade_automation(); // get the fade automation for this module
99 MeterHistory *meter_history;
101 // Temporary buffer for rendering transitions
102 Samples *transition_temp;
103 // Temporary buffer for rendering speed curve
106 // Pointer to an asset for the resampler
108 // Channel to import from the source
110 // File being read if source is a file.
113 // Temporary buffer for rendering a nested audio EDL.
114 // Sharing nested output between modules wouldn't work because if the
115 // segment was cut inside input_len, the shared channels would have to
116 // initialize their EDL's at different starting points and botch their
118 Samples *nested_output[MAX_CHANNELS];
119 // number of samples allocated
120 int nested_allocation;
121 // resampling for nested output
122 AModuleResample *resample;