(svn r10471) -Codechange: implement driver probing priority so that 'preferred' drivers are loaded first
This commit is contained in:
@@ -7,8 +7,6 @@
|
||||
|
||||
class SoundDriver_Cocoa: public SoundDriver {
|
||||
public:
|
||||
/* virtual */ bool CanProbe() { return true; }
|
||||
|
||||
/* virtual */ const char *Start(const char * const *param);
|
||||
|
||||
/* virtual */ void Stop();
|
||||
@@ -16,6 +14,7 @@ public:
|
||||
|
||||
class FSoundDriver_Cocoa: public SoundDriverFactory<FSoundDriver_Cocoa> {
|
||||
public:
|
||||
static const int priority = 10;
|
||||
/* virtual */ const char *GetName() { return "cocoa"; }
|
||||
/* virtual */ const char *GetDescription() { return "Cocoa Sound Driver"; }
|
||||
/* virtual */ Driver *CreateInstance() { return new SoundDriver_Cocoa(); }
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
class SoundDriver_Null: public SoundDriver {
|
||||
public:
|
||||
/* virtual */ bool CanProbe() { return false; }
|
||||
|
||||
/* virtual */ const char *Start(const char * const *param) { return NULL; }
|
||||
|
||||
/* virtual */ void Stop() { }
|
||||
@@ -16,6 +14,7 @@ public:
|
||||
|
||||
class FSoundDriver_Null: public SoundDriverFactory<FSoundDriver_Null> {
|
||||
public:
|
||||
static const int priority = 0;
|
||||
/* virtual */ const char *GetName() { return "null"; }
|
||||
/* virtual */ const char *GetDescription() { return "Null Sound Driver"; }
|
||||
/* virtual */ Driver *CreateInstance() { return new SoundDriver_Null(); }
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
class SoundDriver_SDL: public SoundDriver {
|
||||
public:
|
||||
/* virtual */ bool CanProbe() { return true; }
|
||||
|
||||
/* virtual */ const char *Start(const char * const *param);
|
||||
|
||||
/* virtual */ void Stop();
|
||||
@@ -16,6 +14,7 @@ public:
|
||||
|
||||
class FSoundDriver_SDL: public SoundDriverFactory<FSoundDriver_SDL> {
|
||||
public:
|
||||
static const int priority = 5;
|
||||
/* virtual */ const char *GetName() { return "sdl"; }
|
||||
/* virtual */ const char *GetDescription() { return "SDL Sound Driver"; }
|
||||
/* virtual */ Driver *CreateInstance() { return new SoundDriver_SDL(); }
|
||||
|
||||
@@ -14,7 +14,7 @@ class SoundDriverFactoryBase: public DriverFactoryBase {
|
||||
template <class T>
|
||||
class SoundDriverFactory: public SoundDriverFactoryBase {
|
||||
public:
|
||||
SoundDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_SOUND); }
|
||||
SoundDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_SOUND, ((T *)this)->priority); }
|
||||
|
||||
/**
|
||||
* Get the long, human readable, name for the Driver-class.
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
class SoundDriver_Win32: public SoundDriver {
|
||||
public:
|
||||
/* virtual */ bool CanProbe() { return true; }
|
||||
|
||||
/* virtual */ const char *Start(const char * const *param);
|
||||
|
||||
/* virtual */ void Stop();
|
||||
@@ -16,6 +14,7 @@ public:
|
||||
|
||||
class FSoundDriver_Win32: public SoundDriverFactory<FSoundDriver_Win32> {
|
||||
public:
|
||||
static const int priority = 10;
|
||||
/* virtual */ const char *GetName() { return "win32"; }
|
||||
/* virtual */ const char *GetDescription() { return "Win32 WaveOut Driver"; }
|
||||
/* virtual */ Driver *CreateInstance() { return new SoundDriver_Win32(); }
|
||||
|
||||
Reference in New Issue
Block a user