75 lines
1.0 KiB
C++
75 lines
1.0 KiB
C++
/*
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*/
|
|
|
|
#include <string>
|
|
|
|
class Driver {
|
|
protected:
|
|
void (*on_eos)();
|
|
|
|
public:
|
|
Driver();
|
|
~Driver();
|
|
virtual void init(int *, char ***, void (*)()) = 0;
|
|
|
|
virtual void load(const std::string &) = 0;
|
|
virtual void play() = 0;
|
|
virtual void pause() = 0;
|
|
|
|
virtual void seek_to(long) = 0;
|
|
virtual long position() = 0;
|
|
virtual long duration() = 0;
|
|
};
|
|
|
|
|
|
#ifdef CONFIG_TEST
|
|
class TestDriver : public Driver
|
|
{
|
|
public:
|
|
bool playing;
|
|
long cur_pos;
|
|
long cur_duration;
|
|
std::string cur_file;
|
|
|
|
TestDriver();
|
|
~TestDriver();
|
|
void init(int *, char ***, void (*)());
|
|
|
|
void load(const std::string &);
|
|
void play();
|
|
void pause();
|
|
|
|
void seek_to(long);
|
|
long position();
|
|
long duration();
|
|
|
|
void eos();
|
|
};
|
|
#else /* CONFIG_TEST */
|
|
class GSTDriver : public Driver
|
|
{
|
|
public:
|
|
GSTDriver();
|
|
~GSTDriver();
|
|
void init(int *, char ***, void (*)());
|
|
|
|
void load(const std::string &);
|
|
void play();
|
|
void pause();
|
|
|
|
void seek_to(long);
|
|
long position();
|
|
long duration();
|
|
};
|
|
#endif /* CONFIG_TEST */
|
|
|
|
|
|
|
|
namespace driver
|
|
{
|
|
|
|
Driver *get_driver();
|
|
|
|
}
|