Re-work main right-click context menu to operate on the selection, and remove some...
[ardour.git] / gtk2_ardour / editor_export_audio.cc
index ce7de29aa1aa28e7d7f69977104ba198e2fc541c..d4f8cc3eb842a165f4239577577926d40b602735 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <unistd.h>
@@ -88,19 +87,20 @@ Editor::export_range (nframes_t start, nframes_t end)
        }
 }      
 
+/** Export the first selected region */
 void
 Editor::export_region ()
 {
-       if (clicked_regionview == 0) {
+       if (selection->regions.empty()) {
                return;
        }
 
-       ExportDialog* dialog = new ExportRegionDialog (*this, clicked_regionview->region());
+       boost::shared_ptr<Region> r = selection->regions.front()->region();
+       
+       ExportDialog* dialog = new ExportRegionDialog (*this, r);
                
        dialog->connect_to_session (session);
-       dialog->set_range (
-               clicked_regionview->region()->first_frame(), 
-               clicked_regionview->region()->last_frame());
+       dialog->set_range (r->first_frame(), r->last_frame());
        dialog->start_export();
 }
 
@@ -317,7 +317,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
        string path;
        vector<boost::shared_ptr<AudioFileSource> > sources;
 
-       uint32_t channels = count.get(DataType::AUDIO);
+       uint32_t channels = count.n_audio();
 
        for (uint32_t n=0; n < channels; ++n) {