::source_by_path() was written for MIDI files only. I fixed the call and renamed the two similar functions (one for audio and one for MIDI) to make it more clear.
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,
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);
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;
}
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.
}
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.
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;
}
existing++;
}
- if (source_by_path (possible_path)) {
+ if (midi_source_by_path (possible_path)) {
existing++;
}
}