summaryrefslogtreecommitdiff
path: root/libs/ardour/file_source.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-03-02 17:05:16 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-03-02 17:05:16 +0000
commit5e431d1d5806e8f617b9bfa10c5c8766e0b1a4ce (patch)
tree2561e389524a2348eb2c0f8f9ed6462c3220a593 /libs/ardour/file_source.cc
parent488d54a341b2d4f6bb23f8801d293356f664a96a (diff)
remove entire "stub" file concept; open new audio and MIDI files on demand (at first write); could be a few gotchas with some corner case scenarios, but apparently works OK
git-svn-id: svn://localhost/ardour2/branches/3.0@9038 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/file_source.cc')
-rw-r--r--libs/ardour/file_source.cc48
1 files changed, 5 insertions, 43 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index bf68e2ec15..5522031d69 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -60,6 +60,7 @@ FileSource::FileSource (Session& session, DataType type, const string& path, con
, _file_is_new(true)
, _channel (0)
, _origin (origin)
+ , _open (false)
{
set_within_session_from_path (path);
@@ -99,11 +100,10 @@ FileSource::prevent_deletion ()
bool
FileSource::removable () const
{
- bool r = (_path.find (stub_dir_name) != string::npos) ||
- ((_flags & Removable)
- && ((_flags & RemoveAtDestroy) ||
- ((_flags & RemovableIfEmpty) && empty() == 0)));
-
+ bool r = ((_flags & Removable)
+ && ((_flags & RemoveAtDestroy) ||
+ ((_flags & RemovableIfEmpty) && empty() == 0)));
+
return r;
}
@@ -537,44 +537,6 @@ FileSource::set_within_session_from_path (const std::string& path)
_within_session = _session.path_is_within_session (path);
}
-bool
-FileSource::is_stub_path (const std::string& path)
-{
- return path.find (stub_dir_name) != string::npos;
-}
-
-bool
-FileSource::is_stub () const
-{
- return is_stub_path (_path);
-}
-
-int
-FileSource::unstubify ()
-{
- string::size_type pos = _path.find (stub_dir_name);
-
- if (pos == string::npos || (_flags & Destructive)) {
- return 0;
- }
-
- vector<string> v;
-
- v.push_back (Glib::path_get_dirname (Glib::path_get_dirname (_path)));
- v.push_back (Glib::path_get_basename(_path));
-
- string newpath = Glib::build_filename (v);
-
- if (::rename (_path.c_str(), newpath.c_str()) != 0) {
- error << string_compose (_("rename from %1 to %2 failed: %3)"), _path, newpath, strerror (errno)) << endmsg;
- return -1;
- }
-
- set_path (newpath);
-
- return 0;
-}
-
void
FileSource::set_path (const std::string& newpath)
{