#include "pbd/filesystem.h"
using namespace AudioGrapher;
+using std::string;
namespace ARDOUR {
}
int
-ExportGraphBuilder::process (nframes_t /* frames */, bool last_cycle)
+ExportGraphBuilder::process (nframes_t frames, bool last_cycle)
{
+ assert(frames <= process_buffer_frames);
+
for (ChannelMap::iterator it = channels.begin(); it != channels.end(); ++it) {
- it->first->read (process_buffer, process_buffer_frames);
- ProcessContext<Sample> context(process_buffer, process_buffer_frames, 1);
+ it->first->read (process_buffer, frames);
+ ProcessContext<Sample> context(process_buffer, frames, 1);
if (last_cycle) { context.set_flag (ProcessContext<Sample>::EndOfInput); }
it->second->process (context);
}
{
unsigned channels = config.channel_config->get_n_chans();
int format = get_real_format (config);
- Glib::ustring filename = config.filename->get_path (config.format);
+ string filename = config.filename->get_path (config.format);
- writer.reset (new AudioGrapher::SndfileWriter<T> (filename, format, channels, config.format->sample_rate()));
+ writer.reset (new AudioGrapher::SndfileWriter<T> (filename, format, channels, config.format->sample_rate(), config.broadcast_info));
writer->FileWritten.connect_same_thread (copy_files_connection, boost::bind (&ExportGraphBuilder::Encoder::copy_files, this, _1));
}
int_converter->init (max_frames, config.format->dither_type(), data_width);
add_child (config);
} else {
+ int actual_data_width = 8 * sizeof(Sample);
float_converter = FloatConverterPtr (new SampleFormatConverter<Sample> (channels));
- float_converter->init (max_frames, config.format->dither_type(), data_width);
+ float_converter->init (max_frames, config.format->dither_type(), actual_data_width);
add_child (config);
}
}