diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-01 09:46:18 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-01 09:46:18 -0400 |
commit | 23e7cf10191270d70357ccf0ed9294f020c7b7ab (patch) | |
tree | ddc1fc4d1914fe3de3de79c194c5dd859915bd2a /libs/ardour/session_state.cc | |
parent | 4244ea65460b865f946551aace9b74191b26be4b (diff) | |
parent | b660bc8ae92d19aedf0165815432b77a0c6170c4 (diff) |
merge with master.
Manually resolved conflicts in import.cc and session.cc
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index cf0852f5a3..eaf9f08b25 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1850,41 +1850,6 @@ Session::get_sources_as_xml () return *node; } -string -Session::path_from_region_name (DataType type, string name, string identifier) -{ - char buf[PATH_MAX+1]; - uint32_t n; - SessionDirectory sdir(get_best_session_directory_for_new_source()); - std::string source_dir = ((type == DataType::AUDIO) - ? sdir.sound_path() : sdir.midi_path()); - - string ext = native_header_format_extension (config.get_native_file_header_format(), type); - - for (n = 0; n < 999999; ++n) { - if (identifier.length()) { - snprintf (buf, sizeof(buf), "%s%s%" PRIu32 "%s", name.c_str(), - identifier.c_str(), n, ext.c_str()); - } else { - snprintf (buf, sizeof(buf), "%s-%" PRIu32 "%s", name.c_str(), - n, ext.c_str()); - } - - std::string source_path = Glib::build_filename (source_dir, buf); - - if (!Glib::file_test (source_path, Glib::FILE_TEST_EXISTS)) { - return source_path; - } - } - - error << string_compose (_("cannot create new file from region name \"%1\" with ident = \"%2\": too many existing files with similar names"), - name, identifier) - << endmsg; - - return ""; -} - - int Session::load_sources (const XMLNode& node) { @@ -2121,7 +2086,7 @@ Session::refresh_disk_space () } string -Session::get_best_session_directory_for_new_source () +Session::get_best_session_directory_for_new_audio () { vector<space_and_path>::iterator i; string result = _session_dir->root_path(); |