From a8d6d18b227facafcdf4b769beec3d09ee788a17 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 22 Dec 2009 21:40:29 +0000 Subject: (svn r18608) -Change: add the concept of music sets --- src/base_media_base.h | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'src/base_media_base.h') diff --git a/src/base_media_base.h b/src/base_media_base.h index 1d52145b9..7567d1b81 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -14,6 +14,7 @@ #include "fileio_func.h" #include "core/smallmap_type.hpp" +#include "gfx_type.h" /* Forward declare these; can't do 'struct X' in functions as older GCCs barf on that */ struct IniFile; @@ -32,21 +33,25 @@ struct MD5File { uint8 hash[16]; ///< md5 sum of the file const char *missing_warning; ///< warning when this file is missing - ChecksumResult CheckMD5() const; + ChecksumResult CheckMD5(Subdirectory subdir) const; }; /** * Information about a single base set. * @tparam T the real class we're going to be * @tparam Tnum_files the number of files in the set + * @tparam Tsubdir the subdirectory where to find the files */ -template +template struct BaseSet { typedef SmallMap TranslatedStrings; /** Number of files in this set */ static const size_t NUM_FILES = Tnum_files; + /** The sub directory to search for the files */ + static const Subdirectory SUBDIR = Tsubdir; + /** Internal names of the files in this set. */ static const char * const *file_names; @@ -163,7 +168,7 @@ public: static uint FindSets() { BaseMedia fs; - return fs.Scan(GetExtension(), DATA_DIR); + return fs.Scan(GetExtension(), Tbase_set::SUBDIR); } /** @@ -226,7 +231,7 @@ enum GraphicsFileType { }; /** All data of a graphics set. */ -struct GraphicsSet : BaseSet { +struct GraphicsSet : BaseSet { PaletteType palette; ///< Palette of this graphics set bool FillSetDetails(struct IniFile *ini, const char *path); @@ -242,7 +247,7 @@ public: }; /** All data of a sounds set. */ -struct SoundsSet : BaseSet { +struct SoundsSet : BaseSet { }; /** All data/functions related with replacing the base sounds */ @@ -250,4 +255,29 @@ class BaseSounds : public BaseMedia { public: }; +/** Maximum number of songs in the 'class' playlists. */ +static const uint NUM_SONGS_CLASS = 10; +/** Number of classes for songs */ +static const uint NUM_SONG_CLASSES = 3; +/** Maximum number of songs in the full playlist; theme song + the classes */ +static const uint NUM_SONGS_AVAILABLE = 1 + NUM_SONG_CLASSES * NUM_SONGS_CLASS; + +/** Maximum number of songs in the (custom) playlist */ +static const uint NUM_SONGS_PLAYLIST = 32; + +/** All data of a music set. */ +struct MusicSet : BaseSet { + /** The name of the different songs. */ + char song_name[NUM_SONGS_AVAILABLE][32]; + byte track_nr[NUM_SONGS_AVAILABLE]; + byte num_available; + + bool FillSetDetails(struct IniFile *ini, const char *path); +}; + +/** All data/functions related with replacing the base music */ +class BaseMusic : public BaseMedia { +public: +}; + #endif /* BASE_MEDIA_BASE_H */ -- cgit v1.2.3-54-g00ecf