Remove unused and uncompiled panner code.
[ardour.git] / gtk2_ardour / editor_export_audio.cc
index 1af4fc47647c08abd39883c157dfc3c0b3621483..7b77f190990963c393730d6644b128e3aa93f1b0 100644 (file)
 
 /* Note: public Editor methods are documented in public_editor.h */
 
-#define __STDC_FORMAT_MACROS 1
 #include <inttypes.h>
 #include <unistd.h>
 #include <climits>
 
 #include <gtkmm/messagedialog.h>
 
+#include "gtkmm2ext/choice.h"
+
 #include "export_dialog.h"
 #include "editor.h"
 #include "public_editor.h"
@@ -58,7 +59,15 @@ using namespace Gtk;
 void
 Editor::export_audio ()
 {
-       ExportDialog dialog (*this);
+       ExportDialog dialog (*this, _("Export"), X_("ExportProfile"));
+       dialog.set_session (_session);
+       dialog.run();
+}
+
+void
+Editor::stem_export ()
+{
+       StemExportDialog dialog (*this);
        dialog.set_session (_session);
        dialog.run();
 }
@@ -138,18 +147,30 @@ Editor::write_region_selection (RegionSelection& regions)
 void
 Editor::bounce_region_selection ()
 {
+       for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
+
+               RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (&(*i)->get_time_axis_view());
+               boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (rtv->route());
+
+               if (!track->bounceable()) {
+                       MessageDialog d (
+                               _("One or more of the selected regions' tracks cannot be bounced because it has more outputs than inputs.  "
+                                 "You can fix this by increasing the number of inputs on that track.")
+                               );
+                       d.set_title (_("Cannot bounce"));
+                       d.run ();
+                       return;
+               }
+       }
+
        for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
 
                boost::shared_ptr<Region> region ((*i)->region());
                RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&(*i)->get_time_axis_view());
-               Track* track = dynamic_cast<Track*>(rtv->route().get());
+               boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (rtv->route());
 
                InterThreadInfo itt;
 
-               itt.done = false;
-               itt.cancel = false;
-               itt.progress = 0.0f;
-
                boost::shared_ptr<Region> r = track->bounce_range (region->position(), region->position() + region->length(), itt);
                cerr << "Result of bounce of "
                     << region->name() << " len = " << region->length()
@@ -163,11 +184,11 @@ bool
 Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
 {
        boost::shared_ptr<AudioFileSource> fs;
-       const nframes64_t chunk_size = 4096;
-       nframes64_t to_read;
+       const framepos_t chunk_size = 4096;
+       framepos_t to_read;
        Sample buf[chunk_size];
        gain_t gain_buffer[chunk_size];
-       nframes64_t pos;
+       framepos_t pos;
        char s[PATH_MAX+1];
        uint32_t cnt;
        vector<boost::shared_ptr<AudioFileSource> > sources;
@@ -214,9 +235,9 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
 
                        try {
                                fs = boost::dynamic_pointer_cast<AudioFileSource> (
-                                               SourceFactory::createWritable (DataType::AUDIO, *_session,
-                                                               path, true,
-                                                               false, _session->frame_rate()));
+                                       SourceFactory::createWritable (DataType::AUDIO, *_session,
+                                                                      path, string(), true,
+                                                                      false, _session->frame_rate()));
                        }
 
                        catch (failed_constructor& err) {
@@ -235,7 +256,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
        pos = region->position();
 
        while (to_read) {
-               nframes64_t this_time;
+               framepos_t this_time;
 
                this_time = min (to_read, chunk_size);
 
@@ -313,11 +334,11 @@ bool
 Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list<AudioRange>& range)
 {
        boost::shared_ptr<AudioFileSource> fs;
-       const nframes64_t chunk_size = 4096;
-       nframes64_t nframes;
+       const framepos_t chunk_size = 4096;
+       framepos_t nframes;
        Sample buf[chunk_size];
        gain_t gain_buffer[chunk_size];
-       nframes64_t pos;
+       framepos_t pos;
        char s[PATH_MAX+1];
        uint32_t cnt;
        string path;
@@ -353,9 +374,9 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
 
                try {
                        fs = boost::dynamic_pointer_cast<AudioFileSource> (
-                                       SourceFactory::createWritable (DataType::AUDIO, *_session,
-                                                       path, true,
-                                                       false, _session->frame_rate()));
+                               SourceFactory::createWritable (DataType::AUDIO, *_session,
+                                                              path, string(), true,
+                                                              false, _session->frame_rate()));
                }
 
                catch (failed_constructor& err) {
@@ -373,7 +394,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
                pos = (*i).start;
 
                while (nframes) {
-                       nframes64_t this_time;
+                       framepos_t this_time;
 
                        this_time = min (nframes, chunk_size);
 
@@ -405,7 +426,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
 
                        while (nframes) {
 
-                               nframes64_t this_time = min (nframes, chunk_size);
+                               framepos_t this_time = min (nframes, chunk_size);
                                memset (buf, 0, sizeof (Sample) * this_time);
 
                                for (uint32_t n=0; n < channels; ++n) {