diff options
author | phelin <phelin> | 2008-01-10 23:36:06 +0000 |
---|---|---|
committer | phelin <phelin> | 2008-01-10 23:36:06 +0000 |
commit | cdeaf873969d39c33faba6ef7ed86b8bfec5173c (patch) | |
tree | 07f960eb3a3aaec87ee6b82e326d7c44c55ba84f | |
parent | 3d2752b849a7cd8bee622b9e7c8aa9f476034002 (diff) | |
download | xineliboutput-cdeaf873969d39c33faba6ef7ed86b8bfec5173c.tar.gz xineliboutput-cdeaf873969d39c33faba6ef7ed86b8bfec5173c.tar.bz2 |
Add setup menu for Media player. Options for enabling or disabling metainfo types,
metainfo scanner and metainfo caching.
-rw-r--r-- | config.c | 5 | ||||
-rw-r--r-- | config.h | 5 | ||||
-rw-r--r-- | device.c | 12 | ||||
-rw-r--r-- | i18n.c | 116 | ||||
-rw-r--r-- | po/fi_FI.po | 18 | ||||
-rw-r--r-- | setup_menu.c | 89 | ||||
-rw-r--r-- | tools/playlist.c | 4 |
7 files changed, 238 insertions, 11 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: config.c,v 1.48 2007-09-30 21:11:11 phintuka Exp $ + * $Id: config.c,v 1.49 2008-01-10 23:36:06 phelin Exp $ * */ @@ -751,6 +751,9 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Media.BrowseImagesDir")) STRN0CPY(browse_images_dir, Value); else if (!strcasecmp(Name, "Media.CacheImplicitPlaylists")) cache_implicit_playlists = atoi(Value); else if (!strcasecmp(Name, "Media.EnableID3Scanner")) enable_id3_scanner = atoi(Value); + else if (!strcasecmp(Name, "Playlist.Tracknumber")) playlist_tracknumber = atoi(Value); + else if (!strcasecmp(Name, "Playlist.Artist")) playlist_artist = atoi(Value); + else if (!strcasecmp(Name, "Playlist.Album")) playlist_album = atoi(Value); else if (!strcasecmp(Name, "Audio.Equalizer")) sscanf(Value,"%d %d %d %d %d %d %d %d %d %d", @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: config.h,v 1.32 2007-09-30 21:11:11 phintuka Exp $ + * $Id: config.h,v 1.33 2008-01-10 23:36:06 phelin Exp $ * */ @@ -239,6 +239,9 @@ class config_t { int cache_implicit_playlists; // used in playlist.c int enable_id3_scanner; // used in playlist.c int subtitle_vpos; // used in media player. Not saved ! + int playlist_tracknumber; + int playlist_artist; + int playlist_album; // Audio visualization char audio_visualization[64]; @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.c,v 1.47 2008-01-06 13:01:12 phintuka Exp $ + * $Id: device.c,v 1.48 2008-01-10 23:36:06 phelin Exp $ * */ @@ -1660,7 +1660,15 @@ void cXinelibDevice::EnsureDvdSpuTrack(void) const char *cXinelibDevice::GetMetaInfo(eMetainfoType Type) { if(Type >= 0 && Type < mi_Count) - return m_MetaInfo[Type]; + if ( Type == 0 || Type > 3 || + (Type == 1 && xc.playlist_tracknumber == 1) || + (Type == 2 && xc.playlist_artist == 1) || + (Type == 3 && xc.playlist_album == 1)) { + return m_MetaInfo[Type]; + } + else { + return ""; + } LOGMSG("cXinelibDevice::GetMetaInfo: unknown metainfo type"); return ""; @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: i18n.c,v 1.28 2007-09-18 13:52:52 phintuka Exp $ + * $Id: i18n.c,v 1.29 2008-01-10 23:36:06 phelin Exp $ * * Translations provided by: * @@ -3376,6 +3376,120 @@ const tI18nPhrase Phrases[] = { "", // Russian "", // Croatian }, + { "Show the track number", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugu<EA>s + "", // Fran<E7>ais + "", // Norsk + "Näytä raidan numero", // Suomi + "", // Polski + "", // Espa<F1>ol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, + { "Show the name of the artist", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugu<EA>s + "", // Fran<E7>ais + "", // Norsk + "Näytä esittäjän nimi", // Suomi + "", // Polski + "", // Espa<F1>ol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, + { "Show the name of the album", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugu<EA>s + "", // Fran<E7>ais + "", // Norsk + "Näytä levyn nimi", // Suomi + "", // Polski + "", // Espa<F1>ol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, + { "Cache metainfo", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugu<EA>s + "", // Fran<E7>ais + "", // Norsk + "Tallenna metatieto", // Suomi + "", // Polski + "", // Espa<F1>ol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, + { "Scan for metainfo", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugu<EA>s + "", // Fran<E7>ais + "", // Norsk + "Tutki kappaleiden metatiedot", // Suomi + "", // Polski + "", // Espa<F1>ol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, + { "Playlist settings", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugu<EA>s + "", // Fran<E7>ais + "", // Norsk + "Soittolistan asetukset", // Suomi + "", // Polski + "", // Espa<F1>ol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, { NULL } }; diff --git a/po/fi_FI.po b/po/fi_FI.po index 065cc589..7e51837c 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -557,6 +557,24 @@ msgstr "RTSP-palvelin" msgid "RTSP clients can control VDR" msgstr "Anna RTSP-asiakkaiden ohjata VDR:ää" +msgid "Playlist settings" +msgstr "Soittolistan asetukset" + +msgid "Show the track number" +msgstr "Näytä raidan numero" + +msgid "Show the name of the artist" +msgstr "Näytä esittäjän nimi" + +msgid "Show the name of the album" +msgstr "Näytä levyn nimi" + +msgid "Scan for metainfo" +msgstr "Tutki kappaleiden metatiedot" + +msgid "Cache metainfo" +msgstr "Tallenna metatieto" + msgid "Grayscale" msgstr "Harmaasävy" diff --git a/setup_menu.c b/setup_menu.c index 417cba2a..0f6b9daa 100644 --- a/setup_menu.c +++ b/setup_menu.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: setup_menu.c,v 1.41 2007-09-30 21:11:10 phintuka Exp $ + * $Id: setup_menu.c,v 1.42 2008-01-10 23:36:06 phelin Exp $ * */ @@ -1509,6 +1509,87 @@ void cMenuSetupRemote::Store(void) Setup.Save(); } +//--- cMenuSetupMediaPlayer -------------------------------------------------------- + +class cMenuSetupMediaPlayer : public cMenuSetupPage +{ + private: + config_t newconfig; + + cOsdItem *media_ctrl_playlist_tracknumber; + cOsdItem *media_ctrl_playlist_artist; + cOsdItem *media_ctrl_playlist_album; + cOsdItem *media_ctrl_playlist_cache; + cOsdItem *media_ctrl_playlist_id3scanner; + + protected: + virtual void Store(void); + void Set(void); + + public: + cMenuSetupMediaPlayer(void); + + virtual eOSState ProcessKey(eKeys Key); +}; + +cMenuSetupMediaPlayer::cMenuSetupMediaPlayer(void) +{ + memcpy(&newconfig, &xc, sizeof(config_t)); + Set(); +} + +void cMenuSetupMediaPlayer::Set(void) +{ + SetPlugin(cPluginManager::GetPlugin(PLUGIN_NAME_I18N)); + int current = Current(); + Clear(); + + Add(NewTitle(tr("Playlist settings"))); + + Add(media_ctrl_playlist_tracknumber = + new cMenuEditBoolItem(tr("Show the track number"), + &newconfig.playlist_tracknumber)); + + Add(media_ctrl_playlist_artist = + new cMenuEditBoolItem(tr("Show the name of the artist"), + &newconfig.playlist_artist)); + + Add(media_ctrl_playlist_album = + new cMenuEditBoolItem(tr("Show the name of the album"), + &newconfig.playlist_album)); + + Add(media_ctrl_playlist_id3scanner = + new cMenuEditBoolItem(tr("Scan for metainfo"), + &newconfig.enable_id3_scanner)); + + Add(media_ctrl_playlist_cache = + new cMenuEditBoolItem(tr("Cache metainfo"), + &newconfig.cache_implicit_playlists)); + + + if(current<1) current=1; /* first item is not selectable */ + SetCurrent(Get(current)); + Display(); +} + +eOSState cMenuSetupMediaPlayer::ProcessKey(eKeys Key) +{ + eOSState state = cMenuSetupPage::ProcessKey(Key); + return state; +} + +void cMenuSetupMediaPlayer::Store(void) +{ + memcpy(&xc, &newconfig, sizeof(config_t)); + + SetupStore("Playlist.Tracknumber", xc.playlist_tracknumber); + SetupStore("Playlist.Album", xc.playlist_album); + SetupStore("Playlist.Artist", xc.playlist_artist); + SetupStore("Media.CacheImplicitPlaylists", xc.cache_implicit_playlists); + SetupStore("Media.EnableID3Scanner", xc.enable_id3_scanner); + Setup.Save(); +} + } // namespace @@ -1766,7 +1847,6 @@ eOSState cMenuTestImages::ProcessKey(eKeys Key) return state; } - //--- cMenuSetupXinelib ------------------------------------------------------ cMenuSetupXinelib::cMenuSetupXinelib(void) @@ -1785,6 +1865,7 @@ void cMenuSetupXinelib::Set(void) Add(new cOsdItem(hk(tr("Video")), osUser3)); Add(new cOsdItem(hk(tr("OSD")), osUser4)); //Add(new cOsdItem(hk(tr("Decoder")), osUser5)); + Add(new cOsdItem(hk(tr("Media Player")), osUser5)); Add(new cOsdItem(hk(tr("Local Frontend")), osUser6)); Add(new cOsdItem(hk(tr("Remote Clients")), osUser7)); Add(new cOsdItem(hk(tr("Test Images")), osUser8)); @@ -1805,8 +1886,8 @@ eOSState cMenuSetupXinelib::ProcessKey(eKeys Key) return AddSubMenu(new XinelibOutputSetupMenu::cMenuSetupVideo); case osUser4: return AddSubMenu(new XinelibOutputSetupMenu::cMenuSetupOSD); - //case osUser5: - // return AddSubMenu(new XinelibOutputSetupMenu::cMenuSetupDecoder); + case osUser5: + return AddSubMenu(new XinelibOutputSetupMenu::cMenuSetupMediaPlayer); case osUser6: return AddSubMenu(new XinelibOutputSetupMenu::cMenuSetupLocal); case osUser7: diff --git a/tools/playlist.c b/tools/playlist.c index b4880d6a..e1f7d0d2 100644 --- a/tools/playlist.c +++ b/tools/playlist.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: playlist.c,v 1.10 2008-01-10 23:33:51 phelin Exp $ + * $Id: playlist.c,v 1.11 2008-01-10 23:36:06 phelin Exp $ * */ @@ -477,7 +477,7 @@ static const char *strchrnext(const char *s, char c) bool cPlaylist::ReadCache(void) { - if(m_Origin == eImplicit && *m_Folder) { + if(xc.cache_implicit_playlists && m_Origin == eImplicit && *m_Folder) { cString Name = cString::sprintf("%s%s", *m_Folder, PLAYLIST_CACHE); FILE *f = fopen(Name, "r"); |