libgme / game-music-emu

Blargg's video game music emulation library, which allows audio applications to easily add playback support for the music of many classic video game consoles.
GNU Lesser General Public License v2.1
68 stars 12 forks source link

List all supported extensions #15

Closed Wohlstand closed 7 years ago

Wohlstand commented 7 years ago

Original report by Damian Yerrick (Bitbucket: pino_p, ).


I am developing a music player and want to list all types that my music player's Game_Music_Emu plug-in can play. I can iterate through types with gme_type_list(), but all I can retrieve about each gme_type_t through the C API are the name of the console it's associated with (gme_type_system()) and and whether the type supports multiple movements (gme_type_multitrack()). I'd like to be able to look up the most common extension associated with a track. I can go from extension to type (gme_identify_extension()), but not the other way around.

I reported this to the maintainer of another fork of GME https://github.com/kode54/Game_Music_Emu/issues/7

He plans to fix it by adding a function with the following signature:

const char *gme_type_extension(gme_type_t);
Wohlstand commented 7 years ago

Original comment by Michael Pyne (Bitbucket: mpyne, GitHub: mpyne).


Thanks for the report. I don't mind adding the same here.

Wohlstand commented 7 years ago

Original comment by Michael Pyne (Bitbucket: mpyne, GitHub: mpyne).


Add simple accessor for file extension from a gme_type_t.

Fixes Issue #13