Remove unused method..
[ardour.git] / libs / ardour / export_channel_configuration.cc
index a092af88c1d57a78f49892a9c3920aea209ab92d..4fe8c09cb6a1500f3178b501b8fcbf45aa91bccd 100644 (file)
 
 */
 
-#include <ardour/export_channel_configuration.h>
+#include "ardour/export_channel_configuration.h"
 
-#include <ardour/export_handler.h>
-#include <ardour/export_filename.h>
-#include <ardour/export_processor.h>
-#include <ardour/export_timespan.h>
+#include "ardour/export_handler.h"
+#include "ardour/export_filename.h"
+#include "ardour/export_processor.h"
+#include "ardour/export_timespan.h"
 
-#include <ardour/audio_port.h>
-#include <ardour/export_failed.h>
-#include <ardour/midi_port.h>
-#include <ardour/session.h>
-#include <ardour/audioengine.h>
+#include "ardour/audio_port.h"
+#include "ardour/export_failed.h"
+#include "ardour/midi_port.h"
+#include "ardour/session.h"
+#include "ardour/audioengine.h"
 
-#include <pbd/convert.h>
-#include <pbd/pthread_utils.h>
+#include "pbd/convert.h"
+#include "pbd/pthread_utils.h"
 
-namespace ARDOUR
-{
-
-/* ExportChannel */
+using namespace PBD;
 
-void
-ExportChannel::read_ports (float * data, nframes_t frames) const
+namespace ARDOUR
 {
-       memset (data, 0, frames * sizeof (float));
-
-       for (iterator it = begin(); it != end(); ++it) {
-               if (*it != 0) {
-                       Sample* port_buffer = (*it)->get_audio_buffer( frames, 0).data();
-                       
-                       for (uint32_t i = 0; i < frames; ++i) {
-                               data[i] += (float) port_buffer[i];
-                       }
-               }
-       }
-}
 
 /* ExportChannelConfiguration */
 
@@ -73,7 +57,6 @@ ExportChannelConfiguration::get_state ()
 {
        XMLNode * root = new XMLNode ("ExportChannelConfiguration");
        XMLNode * channel;
-       XMLNode * port_node;
        
        root->add_property ("split", get_split() ? "true" : "false");
        root->add_property ("channels", to_string (get_n_chans(), std::dec));
@@ -84,12 +67,7 @@ ExportChannelConfiguration::get_state ()
                if (!channel) { continue; }
                
                channel->add_property ("number", to_string (i, std::dec));
-               
-               for (ExportChannel::const_iterator p_it = (*c_it)->begin(); p_it != (*c_it)->end(); ++p_it) {
-                       if ((port_node = channel->add_child ("Port"))) {
-                               port_node->add_property ("name", (*p_it)->name());
-                       }
-               }
+               (*c_it)->get_state (channel);
                
                ++i;
        }
@@ -108,15 +86,8 @@ ExportChannelConfiguration::set_state (const XMLNode & root)
 
        XMLNodeList channels = root.children ("Channel");
        for (XMLNodeList::iterator it = channels.begin(); it != channels.end(); ++it) {
-               boost::shared_ptr<ExportChannel> channel (new ExportChannel ());
-       
-               XMLNodeList ports = (*it)->children ("Port");
-               for (XMLNodeList::iterator p_it = ports.begin(); p_it != ports.end(); ++p_it) {
-                       if ((prop = (*p_it)->property ("name"))) {
-                               channel->add_port (dynamic_cast<AudioPort *> (session.engine().get_port_by_name (prop->value())));
-                       }
-               }
-       
+               ExportChannelPtr channel (new PortExportChannel ());
+               channel->set_state (*it, session);
                register_channel (channel);
        }
 
@@ -124,9 +95,9 @@ ExportChannelConfiguration::set_state (const XMLNode & root)
 }
 
 bool
-ExportChannelConfiguration::all_channels_have_ports ()
+ExportChannelConfiguration::all_channels_have_ports () const
 {
-       for (ChannelList::iterator it = channels.begin(); it != channels.end(); ++it) {
+       for (ChannelList::const_iterator it = channels.begin(); it != channels.end(); ++it) {
                if ((*it)->empty ()) { return false; }
        }
        
@@ -182,7 +153,7 @@ ExportChannelConfiguration::write_file ()
                        
                        /* Get channel data */
                        
-                       frames_read = timespan->get_data (channel_buffer, frames, **it);
+                       frames_read = timespan->get_data (channel_buffer, frames, *it);
                        
                        /* Interleave into file buffer */
                        
@@ -205,8 +176,7 @@ ExportChannelConfiguration::write_file ()
 void *
 ExportChannelConfiguration::_write_files (void *arg)
 {
-
-       PBD::ThreadCreated (pthread_self(), "Export post-processing");
+       notify_gui_about_thread_creation (pthread_self(), "Export post-processing");
        
        // cc can be trated like 'this'
        WriterThread & cc (*((WriterThread *) arg));
@@ -238,7 +208,7 @@ ExportChannelConfiguration::register_with_timespan (TimespanPtr new_timespan)
        timespan = new_timespan;
        
        for (ChannelList::iterator it = channels.begin(); it != channels.end(); ++it) {
-               timespan->register_channel (**it);
+               timespan->register_channel (*it);
        }
 }