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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user