summaryrefslogtreecommitdiff
path: root/libs/evoral/src/SMF.cpp
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-04-20 15:44:20 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-04-20 15:44:20 -0400
commitd263cf7ded76d510addd90b036befd4bb7eea9d1 (patch)
tree25f8f711f6c2a259cc8ad5c9c0d18a2a89da116c /libs/evoral/src/SMF.cpp
parentced4378d0914bcfb926267772c45d1d23f3bed38 (diff)
remove _file_path member from Evoral::SMF
Diffstat (limited to 'libs/evoral/src/SMF.cpp')
-rw-r--r--libs/evoral/src/SMF.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp
index 0a5bf589f5..c4e06823a9 100644
--- a/libs/evoral/src/SMF.cpp
+++ b/libs/evoral/src/SMF.cpp
@@ -108,9 +108,7 @@ SMF::open(const std::string& path, int track) THROW_FILE_ERROR
smf_delete(_smf);
}
- _file_path = path;
-
- FILE* f = fopen(_file_path.c_str(), "r");
+ FILE* f = fopen(path.c_str(), "r");
if (f == 0) {
return -1;
} else if ((_smf = smf_load(f)) == 0) {
@@ -151,8 +149,6 @@ SMF::create(const std::string& path, int track, uint16_t ppqn) THROW_FILE_ERROR
smf_delete(_smf);
}
- _file_path = path;
-
_smf = smf_new();
if (_smf == NULL) {
@@ -180,7 +176,7 @@ SMF::create(const std::string& path, int track, uint16_t ppqn) THROW_FILE_ERROR
{
/* put a stub file on disk */
- FILE* f = fopen (_file_path.c_str(), "w+");
+ FILE* f = fopen (path.c_str(), "w+");
if (f == 0) {
return -1;
}
@@ -401,17 +397,17 @@ SMF::begin_write()
}
void
-SMF::end_write() THROW_FILE_ERROR
+SMF::end_write(string const & path) THROW_FILE_ERROR
{
Glib::Threads::Mutex::Lock lm (_smf_lock);
- FILE* f = fopen (_file_path.c_str(), "w+");
+ FILE* f = fopen (path.c_str(), "w+");
if (f == 0) {
- throw FileError (_file_path);
+ throw FileError (path);
}
if (smf_save(_smf, f) != 0) {
fclose(f);
- throw FileError (_file_path);
+ throw FileError (path);
}
fclose(f);
@@ -425,10 +421,4 @@ SMF::round_to_file_precision (double val) const
return round (val * div) / div;
}
-void
-SMF::set_path (const std::string& p)
-{
- _file_path = p;
-}
-
} // namespace Evoral