decoder/sidplay: Add "default_genre" option
Genres are not part of the SID format, so SID files are genreless. This "default_genre" option may be used to assign a default genre to all SID music, for example "SID", "C64", "Chiptune", etc.
This commit is contained in:
parent
d146bef740
commit
7363fe90bb
@ -485,6 +485,8 @@ C64 SID decoder based on `libsidplayfp <https://sourceforge.net/projects/sidplay
|
||||
- Location of your songlengths file, as distributed with the HVSC. The sidplay plugin checks this for matching MD5 fingerprints. See http://www.hvsc.c64.org/download/C64Music/DOCUMENTS/Songlengths.faq.
|
||||
* - **default_songlength SECONDS**
|
||||
- This is the default playing time in seconds for songs not in the songlength database, or in case you're not using a database. A value of 0 means play indefinitely.
|
||||
* - **default_genre GENRE**
|
||||
- Optional default genre for SID songs.
|
||||
* - **filter yes|no**
|
||||
- Turns the SID filter emulation on or off.
|
||||
* - **kernal**
|
||||
|
@ -68,6 +68,7 @@ static SidDatabase *songlength_database;
|
||||
|
||||
static bool all_files_are_containers;
|
||||
static unsigned default_songlength;
|
||||
static std::string default_genre;
|
||||
|
||||
static bool filter_setting;
|
||||
|
||||
@ -116,6 +117,8 @@ sidplay_init(const ConfigBlock &block)
|
||||
|
||||
default_songlength = block.GetPositiveValue("default_songlength", 0u);
|
||||
|
||||
default_genre = block.GetBlockValue("default_genre", "");
|
||||
|
||||
all_files_are_containers =
|
||||
block.GetBlockValue("all_files_are_containers", true);
|
||||
|
||||
@ -471,6 +474,10 @@ ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks,
|
||||
if (artist != nullptr)
|
||||
handler.OnTag(TAG_ARTIST, artist);
|
||||
|
||||
/* genre */
|
||||
if (!default_genre.empty())
|
||||
handler.OnTag(TAG_GENRE, default_genre.c_str());
|
||||
|
||||
/* date */
|
||||
const char *date = GetInfoString(info, 2);
|
||||
if (date != nullptr)
|
||||
|
Loading…
Reference in New Issue
Block a user