Improve help text and error-reporting for ardour-export
authorRobin Gareus <robin@gareus.org>
Sun, 6 Aug 2017 12:47:50 +0000 (14:47 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 6 Aug 2017 12:47:50 +0000 (14:47 +0200)
session_utils/common.cc
session_utils/export.cc

index 99ed10d32d35d0dd9f04585e394bb863d15f15e1..eb17cfdbeb21e0b4a76d04d1006a201945b04f29 100644 (file)
@@ -123,6 +123,12 @@ static Session * _load_session (string dir, string state)
        std::string v;
 
        std::string s = Glib::build_filename (dir, state + statefile_suffix);
+
+       if (!Glib::file_test (s, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR)) {
+               std::cerr << "Cannot read session '"<< s << "'\n";
+               return 0;
+       }
+
        if (Session::get_info_from_path (s, sr, sf, v) == 0) {
                if (engine->set_sample_rate (sr)) {
                        std::cerr << "Cannot set session's samplerate.\n";
index ce523306de1e98420abdb68a73121c4aa8041663..aaea10a9763dda7494bf847ea8d58299163c2232 100644 (file)
@@ -157,8 +157,11 @@ static void usage (int status) {
   -V, --version              print version information and exit\n\
 \n");
        printf ("\n\
-The session is exported as 16bit wav.\n\
-If the no output file is given, the session's export dir is used.\n\
+This tool exports the session-range of a given ardour-session to a 16bit wav,\n\
+using the master-bus outputs.\n\
+If the no output-file is given, the session's export dir is used.\n\
+\n\
+Note: the tool expects a session-name without .ardour file-name extension.\n\
 \n");
 
        printf ("Report bugs to <http://tracker.ardour.org/>\n"
@@ -228,7 +231,7 @@ int main (int argc, char* argv[])
                usage (EXIT_FAILURE);
        }
 
-       SessionUtils::init();
+       SessionUtils::init(false);
        Session* s = 0;
 
        s = SessionUtils::load_session (argv[optind], argv[optind+1]);