*/
#include <cstdio>
-extern "C" {
-#include <libavformat/avio.h>
-}
#include <sndfile.h>
#include "file_group.h"
#include "exceptions.h"
using std::vector;
using std::cout;
+FileGroup::FileGroup ()
+ : _current_path (0)
+ , _current_file (0)
+{
+
+}
+
FileGroup::FileGroup (boost::filesystem::path p)
: _current_path (0)
, _current_file (0)
}
}
+void
+FileGroup::set_paths (vector<boost::filesystem::path> const & p)
+{
+ _paths = p;
+ ensure_open_path (0);
+ seek (0, SEEK_SET);
+}
/** Ensure that the given path index in the content is the _current_file */
void
int64_t
FileGroup::seek (int64_t pos, int whence) const
{
- int64_t const len = length ();
-
/* Convert pos to `full_pos', which is an offset from the start
of all the files.
*/
full_pos += pos;
break;
case SEEK_END:
- full_pos = len - pos;
+ full_pos = length() - pos;
break;
- case AVSEEK_SIZE:
- return len;
}
/* Seek to full_pos */