back port 6576105 from cairocanvas as fix for data loss/file deletion
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 29 May 2014 20:28:57 +0000 (16:28 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 29 May 2014 20:28:57 +0000 (16:28 -0400)
gtk2_ardour/editor_audio_import.cc
libs/ardour/ardour/session.h
libs/ardour/import.cc
libs/ardour/session.cc

index a19a62b337290233fbd48da8c1b9aeed937b2b71..9364437b782cfb832da17f63aa70d9789c23ad5d 100644 (file)
@@ -611,7 +611,7 @@ Editor::embed_sndfiles (vector<string> paths, bool multifile,
 
                                boost::shared_ptr<Source> s;
 
-                               if ((s = _session->source_by_path_and_channel (path, n)) == 0) {
+                               if ((s = _session->audio_source_by_path_and_channel (path, n)) == 0) {
 
                                        source = boost::dynamic_pointer_cast<AudioFileSource> (
                                                SourceFactory::createExternal (DataType::AUDIO, *_session,
index 38185a71d63b391d1c460bf5f4a8a58735f37a62..168137ffc3c5ff0b9833ef8f0f47faf23f9ac53e 100644 (file)
@@ -584,8 +584,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        boost::shared_ptr<MidiSource> create_midi_source_by_stealing_name (boost::shared_ptr<Track>);
 
        boost::shared_ptr<Source> source_by_id (const PBD::ID&);
-       boost::shared_ptr<AudioFileSource> source_by_path_and_channel (const std::string&, uint16_t) const;
-       boost::shared_ptr<MidiSource> source_by_path (const std::string&) const;
+       boost::shared_ptr<AudioFileSource> audio_source_by_path_and_channel (const std::string&, uint16_t) const;
+       boost::shared_ptr<MidiSource> midi_source_by_path (const std::string&) const;
        uint32_t count_sources_by_origin (const std::string&);
 
        void add_playlist (boost::shared_ptr<Playlist>, bool unused = false);
index 047b46f55305d5ff68d3beda87e0623ce60abe7d..e63143e695046d6341ff21a87201d237ed4ac6b1 100644 (file)
@@ -201,7 +201,7 @@ map_existing_mono_sources (const vector<string>& new_paths, Session& /*sess*/,
        for (vector<string>::const_iterator i = new_paths.begin();
             i != new_paths.end(); ++i)
        {
-               boost::shared_ptr<Source> source = session->source_by_path_and_channel(*i, 0);
+               boost::shared_ptr<Source> source = session->audio_source_by_path_and_channel(*i, 0);
 
                if (source == 0) {
                        error << string_compose(_("Could not find a source for %1 even though we are updating this file!"), (*i)) << endl;
index 1de5730a95df501ef5e56d2e7ff8d5f007f5d700..1006c0f90bc66f445013235ffbcd7d723c8300f3 100644 (file)
@@ -3305,7 +3305,7 @@ Session::source_by_id (const PBD::ID& id)
 }
 
 boost::shared_ptr<AudioFileSource>
-Session::source_by_path_and_channel (const string& path, uint16_t chn) const
+Session::audio_source_by_path_and_channel (const string& path, uint16_t chn) const
 {
        /* Restricted to audio files because only audio sources have channel
           as a property.
@@ -3326,7 +3326,7 @@ Session::source_by_path_and_channel (const string& path, uint16_t chn) const
 }
 
 boost::shared_ptr<MidiSource>
-Session::source_by_path (const std::string& path) const
+Session::midi_source_by_path (const std::string& path) const
 {
        /* Restricted to MIDI files because audio sources require a channel
           for unique identification, in addition to a path.
@@ -3481,7 +3481,7 @@ Session::new_audio_source_name (const string& base, uint32_t nchan, uint32_t cha
 
                        string possible_path = Glib::build_filename (spath, buf);
 
-                       if (source_by_path (possible_path)) {
+                       if (audio_source_by_path_and_channel (possible_path, chan)) {
                                existing++;
                                break;
                        }
@@ -3547,7 +3547,7 @@ Session::new_midi_source_name (const string& owner_name)
                                existing++;
                        }
 
-                       if (source_by_path (possible_path)) {
+                       if (midi_source_by_path (possible_path)) {
                                existing++;
                        }
                }