Use ardour/session_state_utils.h in Editor::redisplay_snapshots
[ardour.git] / gtk2_ardour / export_dialog.cc
index 27bc80a6bdad259fb6b9331271eee324ee71ec9f..2cf96fe02a8d1b20e53624f8ad4f400d43f1fd94 100644 (file)
@@ -32,6 +32,7 @@
 #include <gtkmm2ext/window_title.h>
 
 #include <ardour/export.h>
+#include <ardour/session_directory.h>
 #include <ardour/sndfile_helpers.h>
 #include <ardour/audio_track.h>
 #include <ardour/audioregion.h>
@@ -430,7 +431,7 @@ ExportDialog::connect_to_session (Session *s)
 void
 ExportDialog::set_state()
 {
-       XMLNode* node = session->instant_xml(X_("ExportDialog"), session->path());
+       XMLNode* node = session->instant_xml(X_("ExportDialog"));
        XMLProperty* prop;
 
        if (node) {
@@ -494,7 +495,7 @@ ExportDialog::set_state()
                        }
 
                        TreeModel::Children rows = master_selector.get_model()->children();
-                       for (uint32_t r = 0; r < session->master_out()->n_outputs().get(DataType::AUDIO); ++r) {
+                       for (uint32_t r = 0; r < session->master_out()->n_outputs().n_audio(); ++r) {
                                if (nchns == 2) {
                                        if (r % 2) {
                                                rows[r][exp_cols.right] = true;
@@ -581,7 +582,7 @@ ExportDialog::save_state()
        }
        node->add_child_nocopy(*tracks);
        
-       session->add_instant_xml(*node, session->path());
+       session->add_instant_xml(*node);
 }
 
 void
@@ -957,18 +958,14 @@ ExportDialog::start_export ()
        */
        
        if (file_entry.get_text().length() == 0) {
-               string dir = session->export_dir();
-               string::size_type last_slash;
-               
-               if ((last_slash = dir.find_last_of ('/')) != string::npos && last_slash != 0) {
-                       dir = dir.substr (0, last_slash+1);
-               }
+
+               sys::path export_file_path = session->session_directory().export_path();
 
                if (!wants_dir()) {
-                       dir = dir + "export.wav";
+                       export_file_path /= "export.wav";
                }
                
-               file_entry.set_text (dir);
+               file_entry.set_text (export_file_path.to_string());
        }
        
        progress_bar.set_fraction (0);
@@ -1092,13 +1089,13 @@ ExportDialog::fill_lists ()
                
                boost::shared_ptr<Route> route = (*ri);
                
-               if (route->hidden()) {
+               if (route->is_hidden()) {
                        continue;
                }
 
-               for (uint32_t i=0; i < route->n_outputs().get(DataType::AUDIO); ++i) {
+               for (uint32_t i=0; i < route->n_outputs().n_audio(); ++i) {
                        string name;
-                       if (route->n_outputs().get(DataType::AUDIO) == 1) {
+                       if (route->n_outputs().n_audio() == 1) {
                                name = route->name();
                        } else {
                                name = string_compose("%1: out-%2", route->name(), i+1);