projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reformat.
[ardour.git]
/
libs
/
ardour
/
ardour
/
export_graph_builder.h
diff --git
a/libs/ardour/ardour/export_graph_builder.h
b/libs/ardour/ardour/export_graph_builder.h
index 1244afd64737b33062d07b3007eff95b678da712..55fa7133fcf2eec476375df22b6035f7b5324e24 100644
(file)
--- a/
libs/ardour/ardour/export_graph_builder.h
+++ b/
libs/ardour/ardour/export_graph_builder.h
@@
-26,8
+26,9
@@
#include "ardour/export_channel.h"
#include "ardour/export_format_base.h"
#include "ardour/export_channel.h"
#include "ardour/export_format_base.h"
-#include "audiographer/identity_vertex.h"
+#include "audiographer/
utils/
identity_vertex.h"
+#include <boost/ptr_container/ptr_list.hpp>
#include <glibmm/threadpool.h>
namespace AudioGrapher {
#include <glibmm/threadpool.h>
namespace AudioGrapher {
@@
-62,13
+63,16
@@
class ExportGraphBuilder
~ExportGraphBuilder ();
int process (nframes_t frames, bool last_cycle);
~ExportGraphBuilder ();
int process (nframes_t frames, bool last_cycle);
+ bool process_normalize (); // returns true when finished
void reset ();
void add_config (FileSpec const & config);
private:
void reset ();
void add_config (FileSpec const & config);
private:
- class Encoder : public sigc::trackable {
+ void add_split_config (FileSpec const & config);
+
+ class Encoder {
public:
template <typename T> boost::shared_ptr<AudioGrapher::Sink<T> > init (FileSpec const & new_config);
void add_child (FileSpec const & new_config);
public:
template <typename T> boost::shared_ptr<AudioGrapher::Sink<T> > init (FileSpec const & new_config);
void add_child (FileSpec const & new_config);
@@
-86,6
+90,7
@@
class ExportGraphBuilder
FileSpec config;
std::list<FilenamePtr> filenames;
FileSpec config;
std::list<FilenamePtr> filenames;
+ PBD::ScopedConnection copy_files_connection;
// Only one of these should be available at a time
FloatWriterPtr float_writer;
// Only one of these should be available at a time
FloatWriterPtr float_writer;
@@
-97,8
+102,8
@@
class ExportGraphBuilder
class SFC {
public:
// This constructor so that this can be constructed like a Normalizer
class SFC {
public:
// This constructor so that this can be constructed like a Normalizer
- SFC (ExportGraphBuilder &
) {}
- FloatSinkPtr
init (FileSpec const & new_config, nframes_t max_frames
);
+ SFC (ExportGraphBuilder &
, FileSpec const & new_config, nframes_t max_frames);
+ FloatSinkPtr
sink (
);
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
@@
-108,22
+113,25
@@
class ExportGraphBuilder
typedef boost::shared_ptr<AudioGrapher::SampleFormatConverter<short> > ShortConverterPtr;
FileSpec config;
typedef boost::shared_ptr<AudioGrapher::SampleFormatConverter<short> > ShortConverterPtr;
FileSpec config;
-
std::
list<Encoder> children;
+
boost::ptr_
list<Encoder> children;
int data_width;
// Only one of these should be available at a time
FloatConverterPtr float_converter;
int data_width;
// Only one of these should be available at a time
FloatConverterPtr float_converter;
- IntConverterPtr
int_converter;
+ IntConverterPtr int_converter;
ShortConverterPtr short_converter;
};
ShortConverterPtr short_converter;
};
- class Normalizer
: public sigc::trackable
{
+ class Normalizer {
public:
public:
- Normalizer (ExportGraphBuilder & parent
) : parent (parent) {}
- FloatSinkPtr
init (FileSpec const & new_config, nframes_t max_frames
);
+ Normalizer (ExportGraphBuilder & parent
, FileSpec const & new_config, nframes_t max_frames);
+ FloatSinkPtr
sink (
);
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
+ /// Returns true when finished
+ bool process ();
+
private:
typedef boost::shared_ptr<AudioGrapher::PeakReader> PeakReaderPtr;
typedef boost::shared_ptr<AudioGrapher::Normalizer> NormalizerPtr;
private:
typedef boost::shared_ptr<AudioGrapher::PeakReader> PeakReaderPtr;
typedef boost::shared_ptr<AudioGrapher::Normalizer> NormalizerPtr;
@@
-132,7
+140,6
@@
class ExportGraphBuilder
typedef boost::shared_ptr<AudioGrapher::AllocatingProcessContext<Sample> > BufferPtr;
void start_post_processing();
typedef boost::shared_ptr<AudioGrapher::AllocatingProcessContext<Sample> > BufferPtr;
void start_post_processing();
- void do_post_processing();
ExportGraphBuilder & parent;
ExportGraphBuilder & parent;
@@
-144,14
+151,16
@@
class ExportGraphBuilder
TmpFilePtr tmp_file;
NormalizerPtr normalizer;
ThreaderPtr threader;
TmpFilePtr tmp_file;
NormalizerPtr normalizer;
ThreaderPtr threader;
- std::list<SFC> children;
+ boost::ptr_list<SFC> children;
+
+ PBD::ScopedConnection post_processing_connection;
};
// sample rate converter
class SRC {
public:
};
// sample rate converter
class SRC {
public:
- SRC (ExportGraphBuilder & parent
) : parent (parent) {}
- FloatSinkPtr
init (FileSpec const & new_config, nframes_t max_frames
);
+ SRC (ExportGraphBuilder & parent
, FileSpec const & new_config, nframes_t max_frames);
+ FloatSinkPtr
sink (
);
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
@@
-159,12
+168,12
@@
class ExportGraphBuilder
typedef boost::shared_ptr<AudioGrapher::SampleRateConverter> SRConverterPtr;
template<typename T>
typedef boost::shared_ptr<AudioGrapher::SampleRateConverter> SRConverterPtr;
template<typename T>
- void add_child_to_list (FileSpec const & new_config,
std::
list<T> & list);
+ void add_child_to_list (FileSpec const & new_config,
boost::ptr_
list<T> & list);
ExportGraphBuilder & parent;
FileSpec config;
ExportGraphBuilder & parent;
FileSpec config;
-
std::list<SFC>
children;
-
std::
list<Normalizer> normalized_children;
+
boost::ptr_list<SFC>
children;
+
boost::ptr_
list<Normalizer> normalized_children;
SRConverterPtr converter;
nframes_t max_frames_out;
};
SRConverterPtr converter;
nframes_t max_frames_out;
};
@@
-172,8
+181,8
@@
class ExportGraphBuilder
// Silence trimmer + adder
class SilenceHandler {
public:
// Silence trimmer + adder
class SilenceHandler {
public:
- SilenceHandler (ExportGraphBuilder & parent
) : parent (parent) {}
- FloatSinkPtr
init (FileSpec const & new_config, nframes_t max_frames
);
+ SilenceHandler (ExportGraphBuilder & parent
, FileSpec const & new_config, nframes_t max_frames);
+ FloatSinkPtr
sink (
);
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
@@
-182,7
+191,7
@@
class ExportGraphBuilder
ExportGraphBuilder & parent;
FileSpec config;
ExportGraphBuilder & parent;
FileSpec config;
-
std::list<SRC>
children;
+
boost::ptr_list<SRC>
children;
SilenceTrimmerPtr silence_trimmer;
nframes_t max_frames_in;
};
SilenceTrimmerPtr silence_trimmer;
nframes_t max_frames_in;
};
@@
-190,8
+199,7
@@
class ExportGraphBuilder
// channel configuration
class ChannelConfig {
public:
// channel configuration
class ChannelConfig {
public:
- ChannelConfig (ExportGraphBuilder & parent) : parent (parent) {}
- void init (FileSpec const & new_config, ChannelMap & channel_map);
+ ChannelConfig (ExportGraphBuilder & parent, FileSpec const & new_config, ChannelMap & channel_map);
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
@@
-200,7
+208,7
@@
class ExportGraphBuilder
ExportGraphBuilder & parent;
FileSpec config;
ExportGraphBuilder & parent;
FileSpec config;
-
std::
list<SilenceHandler> children;
+
boost::ptr_
list<SilenceHandler> children;
InterleaverPtr interleaver;
nframes_t max_frames;
};
InterleaverPtr interleaver;
nframes_t max_frames;
};
@@
-208,7
+216,7
@@
class ExportGraphBuilder
Session const & session;
// Roots for export processor trees
Session const & session;
// Roots for export processor trees
- typedef
std::
list<ChannelConfig> ChannelConfigList;
+ typedef
boost::ptr_
list<ChannelConfig> ChannelConfigList;
ChannelConfigList channel_configs;
// The sources of all data, each channel is read only once
ChannelConfigList channel_configs;
// The sources of all data, each channel is read only once
@@
-217,6
+225,8
@@
class ExportGraphBuilder
Sample * process_buffer;
nframes_t process_buffer_frames;
Sample * process_buffer;
nframes_t process_buffer_frames;
+ std::list<Normalizer *> normalizers;
+
Glib::ThreadPool thread_pool;
};
Glib::ThreadPool thread_pool;
};