mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-29 18:07:42 +01:00
Fix the horrible mess that was anything related to sources and paths.
Most significant changes: - Factor out FileSource from AudioFileSource, use for SMFSource too - Explicitly pass embedded rather than mysterious name mangling or whatever - Destroy a ton of duplicated or very-nearly-duplicated code - Clean up and document all that weird source stuff in session.cc git-svn-id: svn://localhost/ardour2/branches/3.0@4609 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4565b73a39
commit
022818b4a7
33 changed files with 983 additions and 1276 deletions
|
|
@ -80,8 +80,8 @@ SMF::open(const std::string& path, int track) THROW_FILE_ERROR
|
|||
smf_delete(_smf);
|
||||
}
|
||||
|
||||
_path = path;
|
||||
_smf = smf_load(_path.c_str());
|
||||
_file_path = path;
|
||||
_smf = smf_load(_file_path.c_str());
|
||||
if (_smf == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ SMF::create(const std::string& path, int track, uint16_t ppqn) THROW_FILE_ERROR
|
|||
smf_delete(_smf);
|
||||
}
|
||||
|
||||
_path = path;
|
||||
_file_path = path;
|
||||
|
||||
_smf = smf_new();
|
||||
if (smf_set_ppqn(_smf, ppqn) != 0) {
|
||||
|
|
@ -148,7 +148,7 @@ void
|
|||
SMF::close() THROW_FILE_ERROR
|
||||
{
|
||||
if (_smf) {
|
||||
if (smf_save(_smf, _path.c_str()) != 0) {
|
||||
if (smf_save(_smf, _file_path.c_str()) != 0) {
|
||||
throw FileError();
|
||||
}
|
||||
smf_delete(_smf);
|
||||
|
|
@ -258,7 +258,7 @@ SMF::begin_write()
|
|||
void
|
||||
SMF::end_write() THROW_FILE_ERROR
|
||||
{
|
||||
if (smf_save(_smf, _path.c_str()) != 0)
|
||||
if (smf_save(_smf, _file_path.c_str()) != 0)
|
||||
throw FileError();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue