Fixes to bundle manager to make it vaguely usable.
[ardour.git] / libs / ardour / ardour / export_channel_configuration.h
index 8f2fcdbd28a139441d93b72b34245fc4288352a8..7223e2911070ad27c2925ad0d2746230667db52d 100644 (file)
 #ifndef __ardour_export_channel_configuration_h__
 #define __ardour_export_channel_configuration_h__
 
-#include <set>
 #include <list>
 
 #include <glibmm/ustring.h>
 #include <sigc++/signal.h>
 
+#include <ardour/export_channel.h>
 #include <ardour/export_status.h>
 #include <ardour/ardour.h>
 
+#include <pbd/xml++.h>
+
 using Glib::ustring;
 
 namespace ARDOUR
@@ -42,16 +44,7 @@ class ExportFormatSpecification;
 class ExportFilename;
 class ExportProcessor;
 class ExportTimespan;
-
-class ExportChannel : public std::set<AudioPort *>
-{
-  public:
-       ExportChannel ();
-       ~ExportChannel ();
-       
-       void add_port (AudioPort * port) { if (port) { insert (port); } }
-       void read_ports (float * data, nframes_t frames) const;
-};
+class Session;
 
 class ExportChannelConfiguration
 {
@@ -80,25 +73,25 @@ class ExportChannelConfiguration
 
   private:
        friend class ExportElementFactory;
-       ExportChannelConfiguration (ExportStatus & status);
+       ExportChannelConfiguration (Session & session);
        
   public:
-       ~ExportChannelConfiguration ();
+       XMLNode & get_state ();
+       int set_state (const XMLNode &);
        
-       typedef boost::shared_ptr<ExportChannel const> ChannelPtr;
-       typedef std::list<ChannelPtr> ChannelList;
+       typedef std::list<ExportChannelPtr> ChannelList;
        
-       ChannelList const & get_channels () { return channels; }
-       bool all_channels_have_ports ();
+       ChannelList const & get_channels () const { return channels; }
+       bool all_channels_have_ports () const;
        
        ustring name () const { return _name; }
        void set_name (ustring name) { _name = name; }
        void set_split (bool value) { split = value; }
        
-       bool get_split () { return split; }
-       uint32_t get_n_chans () { return channels.size(); }
+       bool get_split () const { return split; }
+       uint32_t get_n_chans () const { return channels.size(); }
        
-       void register_channel (ChannelPtr channel) { channels.push_back (channel); }
+       void register_channel (ExportChannelPtr channel) { channels.push_back (channel); }
        void register_file_config (FormatPtr format, FilenamePtr filename) { file_configs.push_back (FileConfig (format, filename)); }
        
        void clear_channels () { channels.clear (); }
@@ -114,6 +107,10 @@ class ExportChannelConfiguration
        
   private:
 
+       typedef boost::shared_ptr<ExportStatus> ExportStatusPtr;
+
+        Session & session;
+
        // processor has to be prepared before doing this.
        void write_file ();
        
@@ -121,7 +118,7 @@ class ExportChannelConfiguration
        static void *  _write_files (void *arg);
        WriterThread    writer_thread;
        ProcessorPtr    processor;
-       ExportStatus &  status;
+       ExportStatusPtr status;
 
        bool            files_written;