fix up colons in track names before they are used for JACK port names; catch most (not all) attempted renames and ask the user about colons
git-svn-id: svn://localhost/ardour2/branches/3.0@9928 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -1301,7 +1301,12 @@ IO::build_legal_port_name (DataType type)
|
||||
char buf1[name_size+1];
|
||||
char buf2[name_size+1];
|
||||
|
||||
snprintf (buf1, name_size+1, ("%.*s/%s"), limit, _name.val().c_str(), suffix.c_str());
|
||||
/* colons are illegal in port names, so fix that */
|
||||
|
||||
string nom = _name.val();
|
||||
replace_all (nom, ":", ";");
|
||||
|
||||
snprintf (buf1, name_size+1, ("%.*s/%s"), limit, nom.c_str(), suffix.c_str());
|
||||
|
||||
int port_number = find_port_hole (buf1);
|
||||
snprintf (buf2, name_size+1, "%s %d", buf1, port_number);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "ardour/file_source.h"
|
||||
#include "ardour/filter.h"
|
||||
#include "ardour/playlist.h"
|
||||
#include "ardour/playlist_source.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/region.h"
|
||||
#include "ardour/region_factory.h"
|
||||
@@ -1481,7 +1482,16 @@ Region::uses_source (boost::shared_ptr<const Source> source) const
|
||||
if (*i == source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boost::shared_ptr<PlaylistSource> ps = boost::dynamic_pointer_cast<PlaylistSource> (*i);
|
||||
|
||||
if (ps) {
|
||||
if (ps->playlist()->uses_source (source)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user