Talk:Music drivers redesign

From ScummVM :: Wiki
Revision as of 14:19, 23 May 2008 by Fingolfin (talk | contribs) (New page: Actually, a 3rd variant for the usage is this: musictype = MusicDriverManager->getMusicType(MusicTypePreferenceList(MDT_MT32, MDT_ADLIB, MDT_SPKR)); switch (musictype) { case MDT_ADLIB:...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Actually, a 3rd variant for the usage is this:

musictype = MusicDriverManager->getMusicType(MusicTypePreferenceList(MDT_MT32, MDT_ADLIB, MDT_SPKR));
switch (musictype) {
case MDT_ADLIB:
  ... // custom adlib handling code, e.g. instantiating an FMOPL instance
  break;
  ...
 default:
   // Default: just use a musicdriver of the appropriate type
   musicdriver = MusicDriverManager->createDriver(musictype);
}

This way, engines can still insert special code to handle certain music types, while still benefiting from the uniform instantiation code. Fingolfin 16:19, 23 May 2008 (CEST)