std::string peak_path (std::string) const;
std::string peak_path_from_audio_path (std::string) const;
- bool audio_source_name_is_unique (const std::string& name, uint32_t chan);
+ bool audio_source_name_is_unique (const std::string& name);
std::string format_audio_source_name (const std::string& legalized_base, uint32_t nchan, uint32_t chan, bool destructive, bool take_required, uint32_t cnt, bool related_exists);
std::string new_audio_source_path_for_embedded (const std::string& existing_path);
std::string new_audio_source_path (const std::string&, uint32_t nchans, uint32_t chan, bool destructive, bool take_required);
return newpath;
}
+/** Return true if there are no audio file sources that use @param name as
+ * the filename component of their path.
+ *
+ * Return false otherwise.
+ *
+ * This method MUST ONLY be used to check in-session, mono files since it
+ * hard-codes the channel of the audio file source we are looking for as zero.
+ *
+ * If/when Ardour supports native files in non-mono formats, the logic here
+ * will need to be revisited.
+ */
bool
-Session::audio_source_name_is_unique (const string& name, uint32_t chan)
+Session::audio_source_name_is_unique (const string& name)
{
std::vector<string> sdirs = source_search_path (DataType::AUDIO);
vector<space_and_path>::iterator i;
string possible_path = Glib::build_filename (spath, name);
- if (audio_source_by_path_and_channel (possible_path, chan)) {
+ if (audio_source_by_path_and_channel (possible_path, 0)) {
existing++;
break;
}
possible_name = format_audio_source_name (legalized, nchan, chan, destructive, take_required, cnt, some_related_source_name_exists);
- if (audio_source_name_is_unique (possible_name, chan)) {
+ if (audio_source_name_is_unique (possible_name)) {
break;
}