Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

const MidiDriverDescription & MidiDriver::findMusicDriver ( const Common::String str  )  [static, inherited]

Find the music driver matching the given driver name/description.

Definition at line 122 of file mididrv.cpp.

References Common::String::c_str(), Common::String::empty(), and MidiDriverDescription::name.

Referenced by MidiDriver::parseMusicDriver().

      if (str.empty())
            return s_musicDrivers[0];

      const char *s = str.c_str();
      int len = 0;
      const MidiDriverDescription *md = s_musicDrivers;

      // Scan for string end or a colon
      while (s[len] != 0 && s[len] != ':')

      while (md->name) {
            // Compare the string passed to us with the current table entry.
            // We ignore any characters following an (optional) colon ':'
            // contained in str.
            if (!scumm_strnicmp(md->name, s, len)) {
                  return *md;

      return s_musicDrivers[0];

Generated by  Doxygen 1.6.0   Back to index