|
@@ -56,12 +56,16 @@ public:
|
|
|
DECLARE_POSTFIX_INCREMENT(Driver::Type)
|
|
|
|
|
|
|
|
|
/** Base for all driver factories. */
|
|
|
class DriverFactoryBase {
|
|
|
private:
|
|
|
friend class MusicDriver;
|
|
|
friend class SoundDriver;
|
|
|
friend class VideoDriver;
|
|
|
|
|
|
Driver::Type type; ///< The type of driver.
|
|
|
int priority; ///< The priority of this factory.
|
|
|
const char *name; ///< The name of the drivers of this factory.
|
|
|
const char *description; ///< The description of this driver.
|
|
|
|
|
|
typedef std::map<const char *, DriverFactoryBase *, StringCompare> Drivers; ///< Type for a map of drivers.
|
|
@@ -94,12 +98,14 @@ private:
|
|
|
static const char *GetDriverTypeName(Driver::Type type)
|
|
|
{
|
|
|
static const char * const driver_type_name[] = { "music", "sound", "video" };
|
|
|
return driver_type_name[type];
|
|
|
}
|
|
|
|
|
|
static bool SelectDriverImpl(const char *name, Driver::Type type);
|
|
|
|
|
|
protected:
|
|
|
DriverFactoryBase(Driver::Type type, int priority, const char *name, const char *description);
|
|
|
|
|
|
virtual ~DriverFactoryBase();
|
|
|
|
|
|
public:
|
|
@@ -111,13 +117,13 @@ public:
|
|
|
for (Driver::Type dt = Driver::DT_BEGIN; dt < Driver::DT_END; dt++) {
|
|
|
Driver *driver = *GetActiveDriver(dt);
|
|
|
if (driver != NULL) driver->Stop();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static Driver *SelectDriver(const char *name, Driver::Type type);
|
|
|
static void SelectDriver(const char *name, Driver::Type type);
|
|
|
static char *GetDriversInfo(char *p, const char *last);
|
|
|
|
|
|
/**
|
|
|
* Get a nice description of the driver-class.
|
|
|
* @return The description.
|
|
|
*/
|