*/
+/** @file libs/pbd/sndfile_manager.cc
+ * @brief A FileDescriptor for files opened using libsndfile.
+ */
+
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>
using namespace std;
using namespace PBD;
-/** @param n Filename.
- * @param w true to open writeable, otherwise false.
- * @param i SF_INFO for the file.
+/** @param file_name Filename.
+ * @param writeable true to open writeable, otherwise false.
+ * @param info SF_INFO for the file.
*/
-SndFileDescriptor::SndFileDescriptor (string const & n, bool w, SF_INFO* i)
- : FileDescriptor (n, w)
+SndFileDescriptor::SndFileDescriptor (string const & file_name, bool writeable, SF_INFO* info)
+ : FileDescriptor (file_name, writeable)
, _sndfile (0)
- , _info (i)
+ , _info (info)
{
manager()->add (this);
}
{
/* we must have a lock on the FileManager's mutex */
+ assert (_sndfile);
sf_close (_sndfile);
_sndfile = 0;
}
{
/* we must have a lock on the FileManager's mutex */
- _sndfile = sf_open (_name.c_str(), _writeable ? SFM_RDWR : SFM_READ, _info);
+ _sndfile = sf_open (_path.c_str(), _writeable ? SFM_RDWR : SFM_READ, _info);
return (_sndfile == 0);
}