mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-30 10:27:44 +01:00
merge with master and fix 4 conflicts by hand
This commit is contained in:
commit
8c9749e42f
19 changed files with 137 additions and 29 deletions
|
|
@ -71,6 +71,28 @@ SMF::seek_to_track(int track)
|
|||
}
|
||||
}
|
||||
|
||||
/** Attempt to open the SMF file just to see if it is valid.
|
||||
*
|
||||
* \return true on success
|
||||
* false on failure
|
||||
*/
|
||||
bool
|
||||
SMF::test(const std::string& path)
|
||||
{
|
||||
PBD::StdioFileDescriptor d (path, "r");
|
||||
FILE* f = d.allocate ();
|
||||
if (f == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
smf_t* test_smf;
|
||||
if ((test_smf = smf_load (f)) == NULL) {
|
||||
return false;
|
||||
}
|
||||
smf_delete (test_smf);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Attempt to open the SMF file for reading and/or writing.
|
||||
*
|
||||
* \return 0 on success
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue