* Loads a music file from a specified filename. * @param filename Filename of the music file. */
| 50 | * @param filename Filename of the music file. |
| 51 | */ |
| 52 | void Music::load(const std::string &filename) |
| 53 | { |
| 54 | #ifndef __NO_MUSIC |
| 55 | // SDL only takes UTF-8 filenames |
| 56 | // so here's an ugly hack to match this ugly reasoning |
| 57 | std::string utf8 = Language::wstrToUtf8(Language::fsToWstr(filename)); |
| 58 | |
| 59 | _music = Mix_LoadMUS(utf8.c_str()); |
| 60 | if (_music == 0) |
| 61 | { |
| 62 | throw Exception(Mix_GetError()); |
| 63 | } |
| 64 | #endif |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Loads a music file from a specified memory chunk. |