diff options
author | Sampo Savolainen <v2@iki.fi> | 2006-10-27 22:48:19 +0000 |
---|---|---|
committer | Sampo Savolainen <v2@iki.fi> | 2006-10-27 22:48:19 +0000 |
commit | 674e73ae77480ef851374dae79e7c5c023f04635 (patch) | |
tree | b77ee49f186601e5d3184474fcc56f826f67a83f /libs/ardour/sndfilesource.cc | |
parent | 1bd4c5b3a212460eed1773f6b049d18c89625565 (diff) |
Embedded files / embedding files now work.
git-svn-id: svn://localhost/ardour2/trunk@1032 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/sndfilesource.cc')
-rw-r--r-- | libs/ardour/sndfilesource.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index 1e408e12bc..df8eb3a32f 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -164,7 +164,7 @@ SndFileSource::SndFileSource (Session& s, string idstr, SampleFormat sfmt, Heade } void -SndFileSource::init (const string& idstr) +SndFileSource::init (string idstr) { string::size_type pos; string file; @@ -174,12 +174,20 @@ SndFileSource::init (const string& idstr) sf = 0; _broadcast_info = 0; + string tmp_name; + if ((pos = idstr.find_last_of (':')) == string::npos) { channel = 0; - _name = Glib::path_get_basename (idstr); + tmp_name = idstr; } else { channel = atoi (idstr.substr (pos+1).c_str()); - _name = Glib::path_get_basename (idstr.substr (0, pos)); + tmp_name = idstr.substr (0, pos); + } + + if (is_embedded()) { + _name = tmp_name; + } else { + _name = Glib::path_get_basename (tmp_name); } /* although libsndfile says we don't need to set this, |