Detect libsmf error and throw exceptions.

git-svn-id: svn://localhost/ardour2/branches/3.0@4532 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-02-11 17:59:33 +00:00
parent 13bcd43423
commit 33bbc5cd84
6 changed files with 30 additions and 19 deletions

View file

@ -57,7 +57,8 @@ SMF<Time>::~SMF()
*/
template<typename Time>
int
SMF<Time>::open(const std::string& path)
SMF<Time>::open(const std::string& path) THROW_FILE_ERROR
{
//cerr << "Opening SMF file " << path() << " writeable: " << writable() << endl;
_fd = fopen(path.c_str(), "r+");
@ -92,7 +93,7 @@ SMF<Time>::open(const std::string& path)
template<typename Time>
void
SMF<Time>::close()
SMF<Time>::close() THROW_FILE_ERROR
{
if (_fd) {
flush_header();
@ -311,7 +312,7 @@ SMF<Time>::begin_write(FrameTime start_frame)
template<typename Time>
void
SMF<Time>::end_write()
SMF<Time>::end_write() throw(typename StandardMIDIFile<Time>::FileError)
{
flush_header();
flush_footer();