Cleanup.
svn-id: r47843
This commit is contained in:
parent
9c1a42f9f5
commit
286786b6af
2 changed files with 7 additions and 1 deletions
|
@ -90,6 +90,8 @@ Config::DriverId Config::detect(OplType type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detect the first matching emulator
|
// Detect the first matching emulator
|
||||||
|
drv = -1;
|
||||||
|
|
||||||
for (int i = 1; _drivers[i].name; ++i) {
|
for (int i = 1; _drivers[i].name; ++i) {
|
||||||
if (_drivers[i].flags & flags) {
|
if (_drivers[i].flags & flags) {
|
||||||
drv = _drivers[i].id;
|
drv = _drivers[i].id;
|
||||||
|
@ -100,6 +102,10 @@ Config::DriverId Config::detect(OplType type) {
|
||||||
return drv;
|
return drv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OPL *Config::create(OplType type) {
|
||||||
|
return create(kAuto, type);
|
||||||
|
}
|
||||||
|
|
||||||
OPL *Config::create(DriverId driver, OplType type) {
|
OPL *Config::create(DriverId driver, OplType type) {
|
||||||
// On invalid driver selection, we try to do some fallback detection
|
// On invalid driver selection, we try to do some fallback detection
|
||||||
if (driver == -1) {
|
if (driver == -1) {
|
||||||
|
|
|
@ -85,7 +85,7 @@ public:
|
||||||
* Wrapper to easily init an OPL chip, without specifing an emulator.
|
* Wrapper to easily init an OPL chip, without specifing an emulator.
|
||||||
* By default it will try to initialize an OPL2 emulator, thus an AdLib card.
|
* By default it will try to initialize an OPL2 emulator, thus an AdLib card.
|
||||||
*/
|
*/
|
||||||
static OPL *create(OplType type = kOpl2) { return create(detect(type), type); }
|
static OPL *create(OplType type = kOpl2);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const EmulatorDescription _drivers[];
|
static const EmulatorDescription _drivers[];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue