diff options
34 files changed, 233 insertions, 411 deletions
diff --git a/.gitignore b/.gitignore index 93d21756bd..cf8cbb292e 100644 --- a/.gitignore +++ b/.gitignore @@ -1194,33 +1194,3 @@ project/Win32BuildSetup/dependencies/libcdio-10.dll /xbmc/visualizations/XBMCProjectM/libprojectM/config.inp /xbmc/win32/git_rev.h - -/system/players/dvdplayer/libdts.dll -/system/players/dvdplayer/libfaad.dll -/system/players/paplayer/AC3Codec.dll -/xbmc/cores/dvdplayer/Codecs/libdts/vc++/Debug/vs2010/libdts.lib -/xbmc/cores/dvdplayer/Codecs/libfaad2/libfaad/DebugDLL/vs2010/libfaad2.lib -/xbmc/cores/dvdplayer/Codecs/libmad/msvc++/libmad.lib -/xbmc/cores/paplayer/AC3Codec/vc++/Debug/vs2010/AC3Codec.lib -/xbmc/cores/paplayer/ADPCMCodec/adpcm.lib -/xbmc/cores/paplayer/YMCodec/StSoundLibrary/Debug/vs2010/StSoundLibrary.lib -/xbmc/lib/cmyth/Win32/Debug/vs2010/libcmyth.lib -/xbmc/lib/cximage-6.0/Debug/vs2010/cximagecrtd.lib -/xbmc/lib/libPython/Python/PC/pythonnt_rc.h -/xbmc/lib/libexif/libexif.lib -/system/players/dvdplayer/libdts.dll -/system/players/dvdplayer/libfaad.dll -/system/players/paplayer/AC3Codec.dll -/xbmc/cores/dvdplayer/Codecs/libdts/vc++/Debug/vs2010/libdts.lib -/xbmc/cores/dvdplayer/Codecs/libfaad2/libfaad/DebugDLL/vs2010/libfaad2.lib -/xbmc/cores/dvdplayer/Codecs/libmad/msvc++/libmad.lib -/xbmc/cores/paplayer/AC3Codec/vc++/Debug/vs2010/AC3Codec.lib -/xbmc/cores/paplayer/ADPCMCodec/adpcm.lib -/xbmc/cores/paplayer/YMCodec/StSoundLibrary/Debug/vs2010/StSoundLibrary.lib -/xbmc/lib/cmyth/Win32/Debug/vs2010/libcmyth.lib -/xbmc/lib/cximage-6.0/Debug/vs2010/cximagecrtd.lib -/xbmc/lib/libPython/Python/PC/pythonnt_rc.h -/xbmc/lib/libexif/libexif.lib -/system/players/dvdplayer/libdts.dll -/system/players/dvdplayer/libfaad.dll -/system/players/paplayer/AC3Codec.dll
\ No newline at end of file diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index f74dd009be..6383f120cd 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -691,7 +691,6 @@ <ClCompile Include="..\..\xbmc\rendering\RenderSystem.cpp" /> <ClCompile Include="..\..\xbmc\SectionLoader.cpp" /> <ClCompile Include="..\..\xbmc\settings\AdvancedSettings.cpp" /> - <ClCompile Include="..\..\xbmc\settings\AppParamParser.cpp" /> <ClCompile Include="..\..\xbmc\settings\GUIDialogContentSettings.cpp" /> <ClCompile Include="..\..\xbmc\settings\GUIDialogLockSettings.cpp" /> <ClCompile Include="..\..\xbmc\settings\GUIDialogProfileSettings.cpp" /> @@ -1523,7 +1522,6 @@ <ClInclude Include="..\..\xbmc\rendering\RenderSystem.h" /> <ClInclude Include="..\..\xbmc\SectionLoader.h" /> <ClInclude Include="..\..\xbmc\settings\AdvancedSettings.h" /> - <ClInclude Include="..\..\xbmc\settings\AppParamParser.h" /> <ClInclude Include="..\..\xbmc\settings\GUIDialogContentSettings.h" /> <ClInclude Include="..\..\xbmc\settings\GUIDialogLockSettings.h" /> <ClInclude Include="..\..\xbmc\settings\GUIDialogProfileSettings.h" /> @@ -2043,5 +2041,5 @@ <UserProperties RESOURCE_FILE="XBMC_PC.rc" /> </VisualStudio> </ProjectExtensions> - <Import Project="$(SolutionDir)\$(ProjectFileName).targets.user" Condition="Exists('$(SolutionDir)\$(ProjectFileName).targets.user')" /> -</Project>
\ No newline at end of file + <Import Project="$(SolutionDir)\$(ProjectFileName).targets.user" Condition="Exists('$(SolutionDir)\$(ProjectFileName).targets.user')" /> +</Project> diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index a6629fc85d..ed1eb85114 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -855,6 +855,9 @@ <ClCompile Include="..\..\xbmc\FileSystem\VirtualDirectory.cpp"> <Filter>filesystem</Filter> </ClCompile> + <ClCompile Include="..\..\xbmc\FileSystem\VirtualPathDirectory.cpp"> + <Filter>filesystem</Filter> + </ClCompile> <ClCompile Include="..\..\xbmc\FileSystem\VTPDirectory.cpp"> <Filter>filesystem</Filter> </ClCompile> @@ -2451,8 +2454,6 @@ <ClCompile Include="..\..\xbmc\utils\JSONVariantWriter.cpp"> <Filter>utils</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\settings\AppParamParser.cpp"> - <Filter>settings</Filter> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\xbmc\win32\pch.h"> @@ -3178,6 +3179,9 @@ <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory.h"> <Filter>filesystem</Filter> </ClInclude> + <ClInclude Include="..\..\xbmc\FileSystem\VirtualPathDirectory.h"> + <Filter>filesystem</Filter> + </ClInclude> <ClInclude Include="..\..\xbmc\FileSystem\VTPDirectory.h"> <Filter>filesystem</Filter> </ClInclude> @@ -4909,8 +4913,6 @@ <ClInclude Include="..\..\xbmc\utils\JSONVariantWriter.h"> <Filter>utils</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\settings\AppParamParser.h"> - <Filter>settings</Filter> </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\..\xbmc\win32\XBMC.ico"> @@ -4927,4 +4929,4 @@ <Filter>win32</Filter> </CustomBuild> </ItemGroup> -</Project>
\ No newline at end of file +</Project> diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 7a46770fd9..c1edf30791 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -379,7 +379,8 @@ bool CApplication::OnEvent(XBMC_Event& newEvent) g_application.ProcessMouse(); break; case XBMC_VIDEORESIZE: - if (!g_application.m_bInitializing && !g_advancedSettings.IsInFullScreen()) + if (!g_application.m_bInitializing && + !g_advancedSettings.m_fullScreen) { g_Windowing.SetWindowResolution(newEvent.resize.w, newEvent.resize.h); g_graphicsContext.SetVideoResolution(RES_WINDOW, true); @@ -663,7 +664,7 @@ bool CApplication::Create() // update the window resolution g_Windowing.SetWindowResolution(g_guiSettings.GetInt("window.width"), g_guiSettings.GetInt("window.height")); - if (g_advancedSettings.StartFullScreen() && g_guiSettings.m_LookAndFeelResolution == RES_WINDOW) + if (g_advancedSettings.m_startFullScreen && g_guiSettings.m_LookAndFeelResolution == RES_WINDOW) g_guiSettings.m_LookAndFeelResolution = RES_DESKTOP; if (!g_graphicsContext.IsValidResolution(g_guiSettings.m_LookAndFeelResolution)) @@ -700,7 +701,7 @@ bool CApplication::Create() // set GUI res and force the clear of the screen g_graphicsContext.SetVideoResolution(g_guiSettings.m_LookAndFeelResolution); - if (g_advancedSettings.ShowSplash()) + if (g_advancedSettings.m_splashImage) { CStdString strUserSplash = "special://home/media/Splash.png"; if (CFile::Exists(strUserSplash)) @@ -1129,7 +1130,7 @@ bool CApplication::Initialize() FatalErrorHandler(true, true, true); } - if (g_advancedSettings.ShowSplash()) + if (g_advancedSettings.m_splashImage) SAFE_DELETE(m_splash); if (g_guiSettings.GetBool("masterlock.startuplock") && diff --git a/xbmc/Favourites.cpp b/xbmc/Favourites.cpp index 399d42647b..1527812266 100644 --- a/xbmc/Favourites.cpp +++ b/xbmc/Favourites.cpp @@ -170,7 +170,8 @@ bool CFavourites::TestParamify() CStdString CFavourites::GetExecutePath(const CFileItem *item, int contextWindow) { CStdString execute; - if (item->m_bIsFolder && (g_advancedSettings.ShowPlaylistAsFolders() || !(item->IsSmartPlayList() || item->IsPlayList()))) + if (item->m_bIsFolder && (g_advancedSettings.m_playlistAsFolders || + !(item->IsSmartPlayList() || item->IsPlayList()))) execute.Format("ActivateWindow(%i,%s)", contextWindow, Paramify(item->m_strPath)); else if (item->m_strPath.Left(9).Equals("script://")) execute.Format("RunScript(%s)", Paramify(item->m_strPath.Mid(9))); diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index 3d6fc12f84..2330c0ea35 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -607,7 +607,7 @@ bool CFileItem::IsFileFolder() const { return ( IsSmartPlayList() || - (IsPlayList() && g_advancedSettings.ShowPlaylistAsFolders()) || + (IsPlayList() && g_advancedSettings.m_playlistAsFolders) || IsZIP() || IsRAR() || IsRSS() || diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index b3361bd686..03d9c789c6 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -1824,7 +1824,7 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI else if (condition == SYSTEM_LOGGEDON) bReturn = !(g_windowManager.GetActiveWindow() == WINDOW_LOGIN_SCREEN); else if (condition == SYSTEM_SHOW_EXIT_BUTTON) - bReturn = g_advancedSettings.CanQuit(); + bReturn = g_advancedSettings.m_showExitButton; else if (condition == SYSTEM_HAS_LOGINSCREEN) bReturn = g_settings.UsingLoginScreen(); else if (condition == WEATHER_IS_FETCHED) diff --git a/xbmc/GUIViewState.cpp b/xbmc/GUIViewState.cpp index 8a7b6b3c0e..66c6593aa5 100644 --- a/xbmc/GUIViewState.cpp +++ b/xbmc/GUIViewState.cpp @@ -350,7 +350,7 @@ VECSOURCES& CGUIViewState::GetSources() void CGUIViewState::AddAddonsSource(const CStdString &content, const CStdString &label, const CStdString &thumb) { - if (!g_advancedSettings.CanUseVirtualShares()) + if (!g_advancedSettings.m_bVirtualShares) return; CFileItemList items; diff --git a/xbmc/TextureCache.cpp b/xbmc/TextureCache.cpp index 0392a40ccd..d0b7296da7 100644 --- a/xbmc/TextureCache.cpp +++ b/xbmc/TextureCache.cpp @@ -186,7 +186,7 @@ CStdString CTextureCache::CheckAndCacheImage(const CStdString &url, bool returnD CStdString ddsPath = URIUtils::ReplaceExtension(path, ".dds"); if (CFile::Exists(ddsPath)) return ddsPath; - if (g_advancedSettings.UseDDSFanArt()) + if (g_advancedSettings.m_useDDSFanart) AddJob(new CDDSJob(path)); } return path; @@ -240,7 +240,7 @@ CStdString CTextureCache::CheckAndCacheImage(const CStdString &url, bool returnD if (!hash.IsEmpty()) { AddCachedTexture(url, originalFile, hash); - if (g_advancedSettings.UseDDSFanArt()) + if (g_advancedSettings.m_useDDSFanart) AddJob(new CDDSJob(GetCachedPath(originalFile))); return GetCachedPath(originalFile); } @@ -328,7 +328,7 @@ void CTextureCache::OnJobComplete(unsigned int jobID, bool success, CJob *job) CCacheJob *cacheJob = (CCacheJob *)job; AddCachedTexture(cacheJob->m_url, cacheJob->m_original, cacheJob->m_hash); // TODO: call back to the UI indicating that it can update it's image... - if (g_advancedSettings.UseDDSFanArt()) + if (g_advancedSettings.m_useDDSFanart) AddJob(new CDDSJob(GetCachedPath(cacheJob->m_original))); } return CJobQueue::OnJobComplete(jobID, success, job); diff --git a/xbmc/cores/DummyVideoPlayer.cpp b/xbmc/cores/DummyVideoPlayer.cpp index a4799e4c21..e6f9a10435 100644 --- a/xbmc/cores/DummyVideoPlayer.cpp +++ b/xbmc/cores/DummyVideoPlayer.cpp @@ -143,7 +143,7 @@ bool CDummyVideoPlayer::CanSeek() void CDummyVideoPlayer::Seek(bool bPlus, bool bLargeStep) { - if (g_advancedSettings.CanVideoUseTimeSeeking() && GetTotalTime() > 2*g_advancedSettings.m_videoTimeSeekForwardBig) + if (g_advancedSettings.m_videoUseTimeSeeking && GetTotalTime() > 2*g_advancedSettings.m_videoTimeSeekForwardBig) { int seek = 0; if (bLargeStep) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp index f672fb317e..c8699aa491 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -359,7 +359,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) // the advancedsetting is for allowing the user to force outputting the // 44.1 kHz DTS wav file as PCM, so that an A/V receiver can decode // it (this is temporary until we handle 44.1 kHz passthrough properly) - if (trySPDIFonly || (iformat && strcmp(iformat->name, "wav") == 0 && !g_advancedSettings.DVDPlayerIgnoreDTSInWav())) + if (trySPDIFonly || (iformat && strcmp(iformat->name, "wav") == 0 && !g_advancedSettings.m_dvdplayerIgnoreDTSinWAV)) { // check for spdif and dts // This is used with wav files and audio CDs that may contain diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp index 7fd2d6eecd..3deae7794f 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -2241,7 +2241,7 @@ void CDVDPlayer::Seek(bool bPlus, bool bLargeStep) } __int64 seek; - if (g_advancedSettings.CanVideoUseTimeSeeking() && GetTotalTime() > 2*g_advancedSettings.m_videoTimeSeekForwardBig) + if (g_advancedSettings.m_videoUseTimeSeeking && GetTotalTime() > 2*g_advancedSettings.m_videoTimeSeekForwardBig) { if (bLargeStep) seek = bPlus ? g_advancedSettings.m_videoTimeSeekForwardBig : g_advancedSettings.m_videoTimeSeekBackwardBig; diff --git a/xbmc/cores/paplayer/PAPlayer.cpp b/xbmc/cores/paplayer/PAPlayer.cpp index bea0945a36..6f3fc9f1a0 100644 --- a/xbmc/cores/paplayer/PAPlayer.cpp +++ b/xbmc/cores/paplayer/PAPlayer.cpp @@ -837,7 +837,7 @@ bool PAPlayer::CanSeek() void PAPlayer::Seek(bool bPlus, bool bLargeStep) { __int64 seek; - if (g_advancedSettings.CanMusicUseTimeSeeking() && GetTotalTime() > 2*g_advancedSettings.m_musicTimeSeekForwardBig) + if (g_advancedSettings.m_musicUseTimeSeeking && GetTotalTime() > 2*g_advancedSettings.m_musicTimeSeekForwardBig) { if (bLargeStep) seek = bPlus ? g_advancedSettings.m_musicTimeSeekForwardBig : g_advancedSettings.m_musicTimeSeekBackwardBig; diff --git a/xbmc/filesystem/FactoryFileDirectory.cpp b/xbmc/filesystem/FactoryFileDirectory.cpp index c12e1fc2bb..765bf01241 100644 --- a/xbmc/filesystem/FactoryFileDirectory.cpp +++ b/xbmc/filesystem/FactoryFileDirectory.cpp @@ -199,7 +199,7 @@ IFileDirectory* CFactoryFileDirectory::Create(const CStdString& strPath, CFileIt IFileDirectory* pDir=new CSmartPlaylistDirectory; return pDir; // treat as directory } - if (g_advancedSettings.ShowPlaylistAsFolders() && CPlayListFactory::IsPlaylist(strPath)) + if (g_advancedSettings.m_playlistAsFolders && CPlayListFactory::IsPlaylist(strPath)) { // Playlist file // currently we only return the directory if it contains // more than one file. Reason is that .pls and .m3u may be used diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp index 792d08f39d..0cab11d27a 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp @@ -311,11 +311,15 @@ void CGraphicContext::SetVideoResolution(RESOLUTION res, bool forceUpdate) // If the user asked us to guess, go with desktop if (res == RES_AUTORES || !IsValidResolution(res)) + { res = RES_DESKTOP; + } // If we are switching to the same resolution and same window/full-screen, no need to do anything - if (!forceUpdate && res == lastRes && m_bFullScreenRoot == g_advancedSettings.IsInFullScreen()) + if (!forceUpdate && res == lastRes && m_bFullScreenRoot == g_advancedSettings.m_fullScreen) + { return; + } //only pause when switching monitor resolution/refreshrate, //not when switching between fullscreen and windowed or when resizing the window @@ -332,8 +336,16 @@ void CGraphicContext::SetVideoResolution(RESOLUTION res, bool forceUpdate) } } - g_advancedSettings.SetFullScreenState(res >= RES_DESKTOP); - m_bFullScreenRoot = res >= RES_DESKTOP; + if (res >= RES_DESKTOP) + { + g_advancedSettings.m_fullScreen = true; + m_bFullScreenRoot = true; + } + else + { + g_advancedSettings.m_fullScreen = false; + m_bFullScreenRoot = false; + } Lock(); @@ -345,7 +357,7 @@ void CGraphicContext::SetVideoResolution(RESOLUTION res, bool forceUpdate) //tell the videoreferenceclock that we're about to change the refreshrate g_VideoReferenceClock.RefreshChanged(); - if (g_advancedSettings.IsInFullScreen()) + if (g_advancedSettings.m_fullScreen) { #if defined (__APPLE__) || defined (_WIN32) bool blankOtherDisplays = g_guiSettings.GetBool("videoscreen.blankdisplays"); diff --git a/xbmc/interfaces/json-rpc/JSONRPC.cpp b/xbmc/interfaces/json-rpc/JSONRPC.cpp index 36d09c415f..1ddbc27eed 100644 --- a/xbmc/interfaces/json-rpc/JSONRPC.cpp +++ b/xbmc/interfaces/json-rpc/JSONRPC.cpp @@ -346,7 +346,7 @@ CStdString CJSONRPC::MethodCall(const CStdString &inputString, ITransportLayer * hasResponse = true; } - CStdString str = hasResponse ? CJSONVariantWriter::Write(outputroot, g_advancedSettings.OutputCompactJSON()) : ""; + CStdString str = hasResponse ? CJSONVariantWriter::Write(outputroot, g_advancedSettings.m_jsonOutputCompact) : ""; return str; } diff --git a/xbmc/music/GUIViewStateMusic.cpp b/xbmc/music/GUIViewStateMusic.cpp index 0b84617218..dfb6b088cb 100644 --- a/xbmc/music/GUIViewStateMusic.cpp +++ b/xbmc/music/GUIViewStateMusic.cpp @@ -553,7 +553,7 @@ void CGUIViewStateWindowMusicNav::SaveViewState() void CGUIViewStateWindowMusicNav::AddOnlineShares() { - if (!g_advancedSettings.CanUseVirtualShares()) return; + if (!g_advancedSettings.m_bVirtualShares) return; for (int i = 0; i < (int)g_settings.m_musicSources.size(); ++i) { CMediaSource share = g_settings.m_musicSources.at(i); diff --git a/xbmc/music/karaoke/GUIWindowKaraokeLyrics.cpp b/xbmc/music/karaoke/GUIWindowKaraokeLyrics.cpp index 6f782c6f3d..99db6b498d 100644 --- a/xbmc/music/karaoke/GUIWindowKaraokeLyrics.cpp +++ b/xbmc/music/karaoke/GUIWindowKaraokeLyrics.cpp @@ -145,7 +145,7 @@ void CGUIWindowKaraokeLyrics::newSong(CKaraokeLyrics * lyrics) m_Lyrics->GetVideoParameters( path, offset ); m_Background->StartVideo( path, offset ); } - else if ( m_Lyrics->HasBackground() && g_advancedSettings.KaraokeAlwaysEmptyOnCDGs() ) + else if ( m_Lyrics->HasBackground() && g_advancedSettings.m_karaokeAlwaysEmptyOnCdgs ) { m_Background->StartEmpty(); } diff --git a/xbmc/music/karaoke/karaokelyrics.cpp b/xbmc/music/karaoke/karaokelyrics.cpp index 8d2caf4b52..d9c42fd68b 100644 --- a/xbmc/music/karaoke/karaokelyrics.cpp +++ b/xbmc/music/karaoke/karaokelyrics.cpp @@ -46,7 +46,7 @@ CKaraokeLyrics::~CKaraokeLyrics() void CKaraokeLyrics::Shutdown() { // Update the song-specific delay in the database - if ( m_idSong && m_avOrigDelay != m_avDelay && g_advancedSettings.KaraokeKeepDelay() ) + if ( m_idSong && m_avOrigDelay != m_avDelay && g_advancedSettings.m_karaokeKeepDelay ) { // If the song is in karaoke db, get the delay CMusicDatabase musicdatabase; @@ -80,7 +80,7 @@ void CKaraokeLyrics::initData( const CStdString & songPath ) CMusicDatabase musicdatabase; // Get song-specific delay from the database - if ( g_advancedSettings.KaraokeKeepDelay() && musicdatabase.Open() ) + if ( g_advancedSettings.m_karaokeKeepDelay && musicdatabase.Open() ) { CSong song; if ( musicdatabase.GetSongByFileName( songPath, song) ) diff --git a/xbmc/music/karaoke/karaokelyricscdg.cpp b/xbmc/music/karaoke/karaokelyricscdg.cpp index 4cbdec8c66..4b499bc301 100644 --- a/xbmc/music/karaoke/karaokelyricscdg.cpp +++ b/xbmc/music/karaoke/karaokelyricscdg.cpp @@ -91,8 +91,8 @@ void CKaraokeLyricsCDG::setPixel( int x, int y, BYTE color ) if ( x < 0 || y < 0 || offset > CDG_FULL_HEIGHT * CDG_FULL_WIDTH ) { - CLog::Log( LOGERROR, "CDG renderer: set pixel (%d,%d) is out of boundary", x, y ); - return; + CLog::Log( LOGERROR, "CDG renderer: set pixel (%d,%d) is out of boundary", x, y ); + return; } m_cdgScreen[offset] = color; @@ -102,11 +102,18 @@ void CKaraokeLyricsCDG::setPixel( int x, int y, BYTE color ) bool CKaraokeLyricsCDG::InitGraphics() { // set the background to be completely transparent if we use visualisations, or completely solid if not - m_bgAlpha = g_advancedSettings.KaraokeAlwaysEmptyOnCDGs() ? 0xff000000 : 0; + if ( g_advancedSettings.m_karaokeAlwaysEmptyOnCdgs ) + m_bgAlpha = 0xff000000; + else + m_bgAlpha = 0; if (!m_pCdgTexture) { - m_pCdgTexture = new CTexture( CDG_FULL_WIDTH, CDG_FULL_HEIGHT, XB_FMT_A8R8G8B8 ); + m_pCdgTexture = new CTexture( CDG_FULL_WIDTH, CDG_FULL_HEIGHT, XB_FMT_A8R8G8B8 ); + } + + if ( !m_pCdgTexture ) + { CLog::Log(LOGERROR, "CDG renderer: failed to create texture" ); return false; } diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp index b8a45f3bd2..1f5805a57c 100644 --- a/xbmc/music/windows/GUIWindowMusicBase.cpp +++ b/xbmc/music/windows/GUIWindowMusicBase.cpp @@ -888,7 +888,8 @@ void CGUIWindowMusicBase::GetContextButtons(int itemNumber, CContextButtons &but buttons.Add(CONTEXT_BUTTON_QUEUE_ITEM, 13347); //queue // allow a folder to be ad-hoc queued and played by the default player - if (item->m_bIsFolder || (item->IsPlayList() && !g_advancedSettings.ShowPlaylistAsFolders())) + if (item->m_bIsFolder || (item->IsPlayList() && + !g_advancedSettings.m_playlistAsFolders)) { buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 208); // Play } diff --git a/xbmc/network/TCPServer.cpp b/xbmc/network/TCPServer.cpp index 9666e2542a..fdb0894624 100644 --- a/xbmc/network/TCPServer.cpp +++ b/xbmc/network/TCPServer.cpp @@ -161,7 +161,7 @@ int CTCPServer::GetCapabilities() void CTCPServer::Announce(EAnnouncementFlag flag, const char *sender, const char *message, const CVariant &data) { - std::string str = AnnouncementToJSON(flag, sender, message, data, g_advancedSettings.OutputCompactJSON()); + std::string str = AnnouncementToJSON(flag, sender, message, data, g_advancedSettings.m_jsonOutputCompact); for (unsigned int i = 0; i < m_connections.size(); i++) { diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp index 5329e239ff..ffc51262b1 100644 --- a/xbmc/rendering/dx/RenderSystemDX.cpp +++ b/xbmc/rendering/dx/RenderSystemDX.cpp @@ -97,7 +97,7 @@ bool CRenderSystemDX::InitRenderSystem() { m_bVSync = true; - m_useD3D9Ex = (g_advancedSettings.AllowD3D9Ex() && g_sysinfo.IsVistaOrHigher() && LoadD3D9Ex()); + m_useD3D9Ex = (g_advancedSettings.m_AllowD3D9Ex && g_sysinfo.IsVistaOrHigher() && LoadD3D9Ex()); m_pD3D = NULL; if (m_useD3D9Ex) @@ -114,7 +114,7 @@ bool CRenderSystemDX::InitRenderSystem() memset(&caps, 0, sizeof(caps)); m_pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT, m_devType, &caps); // Evaluate if the driver is WDDM - this detection method is not guaranteed 100% - if (!g_advancedSettings.ForceD3D9Ex() && (!(caps.Caps2 & D3DCAPS2_CANSHARERESOURCE) || !(caps.DevCaps2 & D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES))) + if (!g_advancedSettings.m_ForceD3D9Ex && (!(caps.Caps2 & D3DCAPS2_CANSHARERESOURCE) || !(caps.DevCaps2 & D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES))) { CLog::Log(LOGDEBUG, __FUNCTION__" - driver looks like XPDM or earlier, falling back to D3D9"); m_useD3D9Ex = false; @@ -450,7 +450,7 @@ bool CRenderSystemDX::CreateDevice() m_maxTextureSize = min(caps.MaxTextureWidth, caps.MaxTextureHeight); - if (g_advancedSettings.AllowDynamicTextures() && m_useD3D9Ex && (caps.Caps2 & D3DCAPS2_DYNAMICTEXTURES)) + if (g_advancedSettings.m_AllowDynamicTextures && m_useD3D9Ex && (caps.Caps2 & D3DCAPS2_DYNAMICTEXTURES)) { m_defaultD3DUsage = D3DUSAGE_DYNAMIC; m_defaultD3DPool = D3DPOOL_DEFAULT; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index d288d62c21..b888bcb2c3 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -237,6 +237,8 @@ void CAdvancedSettings::Initialize() //with ipv6. m_fullScreen = m_startFullScreen = false; + m_showExitButton = true; + m_splashImage = true; m_playlistRetries = 100; m_playlistTimeout = 20; // 20 seconds timeout @@ -247,7 +249,7 @@ void CAdvancedSettings::Initialize() m_AllowDynamicTextures = true; m_RestrictCapsMask = 0; m_sleepBeforeFlip = 0; - m_useVirtualShares = true; + m_bVirtualShares = true; //caused lots of jerks //#ifdef _WIN32 @@ -276,10 +278,6 @@ void CAdvancedSettings::Initialize() m_jsonTcpPort = 9090; m_enableMultimediaKeys = false; - - m_canQuit = true; - m_canWindowed = true; - m_showSplash = true; } bool CAdvancedSettings::Load() @@ -288,45 +286,37 @@ bool CAdvancedSettings::Load() // it should instead use the versions of GetString/Integer/Float that // don't take defaults in. Defaults are set in the constructor above Initialize(); // In case of profile switch. - CStdString advancedSettingsXML = g_settings.GetUserDataItem("advancedsettings.xml"); - ParseSettingsFile("special://xbmc/system/advancedsettings.xml"); - ParseSettingsFile(advancedSettingsXML); - for (unsigned int i = 0; i < m_settingsFiles.size(); i++) - ParseSettingsFile(m_settingsFiles[i]); - return true; -} - -void CAdvancedSettings::ParseSettingsFile(CStdString file) -{ + CStdString advancedSettingsXML; + advancedSettingsXML = g_settings.GetUserDataItem("advancedsettings.xml"); TiXmlDocument advancedXML; - if (!CFile::Exists(file)) - { - CLog::Log(LOGNOTICE, "No settings file to load to load (%s)", file.c_str()); - return; + if (!CFile::Exists(advancedSettingsXML)) + { // tell the user it doesn't exist + CLog::Log(LOGNOTICE, "No advancedsettings.xml to load (%s)", advancedSettingsXML.c_str()); + return false; } - if (!advancedXML.LoadFile(file)) + if (!advancedXML.LoadFile(advancedSettingsXML)) { - CLog::Log(LOGERROR, "Error loading %s, Line %d\n%s", file.c_str(), advancedXML.ErrorRow(), advancedXML.ErrorDesc()); - return; + CLog::Log(LOGERROR, "Error loading %s, Line %d\n%s", advancedSettingsXML.c_str(), advancedXML.ErrorRow(), advancedXML.ErrorDesc()); + return false; } TiXmlElement *pRootElement = advancedXML.RootElement(); if (!pRootElement || strcmpi(pRootElement->Value(),"advancedsettings") != 0) { - CLog::Log(LOGERROR, "Error loading %s, no <advancedsettings> node", file.c_str()); - return; + CLog::Log(LOGERROR, "Error loading %s, no <advancedsettings> node", advancedSettingsXML.c_str()); + return false; } // succeeded - tell the user it worked - CLog::Log(LOGNOTICE, "Loaded settings file from %s", file.c_str()); + CLog::Log(LOGNOTICE, "Loaded advancedsettings.xml from %s", advancedSettingsXML.c_str()); // Dump contents of AS.xml to debug log TiXmlPrinter printer; printer.SetLineBreak("\n"); printer.SetIndent(" "); advancedXML.Accept(&printer); - CLog::Log(LOGNOTICE, "Contents of %s are...\n%s", file.c_str(), printer.CStr()); + CLog::Log(LOGNOTICE, "Contents of %s are...\n%s", advancedSettingsXML.c_str(), printer.CStr()); TiXmlElement *pElement = pRootElement->FirstChildElement("audio"); if (pElement) @@ -646,9 +636,9 @@ void CAdvancedSettings::ParseSettingsFile(CStdString file) #ifdef HAS_SDL XMLUtils::GetBoolean(pRootElement, "fullscreen", m_startFullScreen); #endif - XMLUtils::GetBoolean(pRootElement, "showsplash", m_showSplash); - XMLUtils::GetBoolean(pRootElement, "canquit", m_canQuit); - XMLUtils::GetBoolean(pRootElement, "canwindowed", m_canWindowed); + XMLUtils::GetBoolean(pRootElement, "splash", m_splashImage); + XMLUtils::GetBoolean(pRootElement, "showexitbutton", m_showExitButton); + XMLUtils::GetInt(pRootElement, "songinfoduration", m_songInfoDuration, 0, INT_MAX); XMLUtils::GetInt(pRootElement, "busydialogdelay", m_busyDialogDelay, 0, 5000); XMLUtils::GetInt(pRootElement, "playlistretries", m_playlistRetries, -1, 5000); @@ -664,7 +654,7 @@ void CAdvancedSettings::ParseSettingsFile(CStdString file) XMLUtils::GetBoolean(pRootElement,"allowdynamictextures", m_AllowDynamicTextures); XMLUtils::GetUInt(pRootElement,"restrictcapsmask", m_RestrictCapsMask); XMLUtils::GetFloat(pRootElement,"sleepbeforeflip", m_sleepBeforeFlip, 0.0f, 1.0f); - XMLUtils::GetBoolean(pRootElement,"virtualshares", m_useVirtualShares); + XMLUtils::GetBoolean(pRootElement,"virtualshares", m_bVirtualShares); //Tuxbox pElement = pRootElement->FirstChildElement("tuxbox"); @@ -894,6 +884,8 @@ void CAdvancedSettings::ParseSettingsFile(CStdString file) // load in the GUISettings overrides: g_guiSettings.LoadXML(pRootElement, true); // true to hide the settings we read in + + return true; } void CAdvancedSettings::Clear() @@ -1015,7 +1007,3 @@ void CAdvancedSettings::GetCustomExtensions(TiXmlElement *pRootElement, CStdStri } } -void CAdvancedSettings::AddSettingsFile(CStdString filename) -{ - m_settingsFiles.push_back("special://xbmc/system/" + filename); -} diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h index 24a72b2255..fcfbba36e8 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -68,7 +68,7 @@ class CAdvancedSettings static CAdvancedSettings* getInstance(); void Initialize(); - void AddSettingsFile(CStdString filename); + bool Load(); void Clear(); @@ -81,16 +81,14 @@ class CAdvancedSettings float m_ac3Gain; CStdString m_audioDefaultPlayer; float m_audioPlayCountMinimumPercent; - bool DVDPlayerIgnoreDTSInWav() { return m_dvdplayerIgnoreDTSinWAV; }; + bool m_dvdplayerIgnoreDTSinWAV; float m_videoSubsDelayRange; float m_videoAudioDelayRange; int m_videoSmallStepBackSeconds; int m_videoSmallStepBackTries; int m_videoSmallStepBackDelay; - - bool CanVideoUseTimeSeeking() { return m_videoUseTimeSeeking; }; - + bool m_videoUseTimeSeeking; int m_videoTimeSeekForward; int m_videoTimeSeekBackward; int m_videoTimeSeekForwardBig; @@ -101,9 +99,7 @@ class CAdvancedSettings int m_videoPercentSeekBackwardBig; CStdString m_videoPPFFmpegDeint; CStdString m_videoPPFFmpegPostProc; - bool CanMusicUseTimeSeeking() { return m_musicUseTimeSeeking; }; - - + bool m_musicUseTimeSeeking; int m_musicTimeSeekForward; int m_musicTimeSeekBackward; int m_musicTimeSeekForwardBig; @@ -142,9 +138,9 @@ class CAdvancedSettings int m_lcdAddress2; int m_lcdAddress3; int m_lcdAddress4; + bool m_lcdHeartbeat; bool m_lcdDimOnScreenSave; int m_lcdScrolldelay; - bool m_lcdHeartbeat; CStdString m_lcdHostName; int m_autoDetectPingTime; @@ -177,12 +173,12 @@ class CAdvancedSettings int m_remoteDelay; ///< \brief number of remote messages to ignore before repeating float m_controllerDeadzone; - bool ShowPlaylistAsFolders() { return m_playlistAsFolders; }; + bool m_playlistAsFolders; bool m_detectAsUdf; int m_thumbSize; int m_fanartHeight; - bool UseDDSFanArt() { return m_useDDSFanart; }; + bool m_useDDSFanart; int m_sambaclienttimeout; CStdString m_sambadoscodepage; @@ -250,28 +246,30 @@ class CAdvancedSettings int m_curlretries; bool m_curlDisableIPV6; - - bool AlwaysOnTop() { return m_alwaysOnTop; }; /* makes xbmc to run always on top .. osx/win32 only .. */ + bool m_fullScreen; + bool m_startFullScreen; + bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */ + bool m_splashImage; + bool m_alwaysOnTop; /* makes xbmc to run always on top .. osx/win32 only .. */ int m_playlistRetries; int m_playlistTimeout; - bool UseGLRectangeHack() { return m_GLRectangleHack; }; + bool m_GLRectangleHack; int m_iSkipLoopFilter; float m_ForcedSwapTime; /* if nonzero, set's the explicit time in ms to allocate for buffer swap */ - bool AllowD3D9Ex() { return m_AllowD3D9Ex; }; - bool ForceD3D9Ex() { return m_ForceD3D9Ex; }; - bool AllowDynamicTextures() { return m_AllowDynamicTextures; }; + bool m_AllowD3D9Ex; + bool m_ForceD3D9Ex; + bool m_AllowDynamicTextures; unsigned int m_RestrictCapsMask; float m_sleepBeforeFlip; ///< if greather than zero, XBMC waits for raster to be this amount through the frame prior to calling the flip - - bool CanUseVirtualShares() { return m_useVirtualShares; }; + bool m_bVirtualShares; float m_karaokeSyncDelayCDG; // seems like different delay is needed for CDG and MP3s float m_karaokeSyncDelayLRC; bool m_karaokeChangeGenreForKaraokeSongs; - bool KaraokeKeepDelay() { return m_karaokeKeepDelay; }; // store user-changed song delay in the database + bool m_karaokeKeepDelay; // store user-changed song delay in the database int m_karaokeStartIndex; // auto-assign numbering start from this value - bool KaraokeAlwaysEmptyOnCDGs() { return m_karaokeAlwaysEmptyOnCdgs; }; // always have empty background on CDG files + bool m_karaokeAlwaysEmptyOnCdgs; // always have empty background on CDG files bool m_karaokeUseSongSpecificBackground; // use song-specific video or image if available instead of default CStdString m_karaokeDefaultBackgroundType; // empty string or "vis", "image" or "video" CStdString m_karaokeDefaultBackgroundFilePath; // only for "image" or "video" types above @@ -280,50 +278,18 @@ class CAdvancedSettings CStdString m_gpuTempCmd; int m_bgInfoLoaderMaxThreads; - bool MeasureRefreshRate() { return m_measureRefreshrate; }; //when true the videoreferenceclock will measure the refreshrate when direct3d is used - //otherwise it will use the windows refreshrate + bool m_measureRefreshrate; //when true the videoreferenceclock will measure the refreshrate when direct3d is used + //otherwise it will use the windows refreshrate DatabaseSettings m_databaseMusic; // advanced music database setup DatabaseSettings m_databaseVideo; // advanced video database setup unsigned int m_cacheMemBufferSize; - unsigned int m_jsonTcpPort; - bool IsInFullScreen() { return m_fullScreen; }; - void SetFullScreenState(bool isFullScreen) { m_fullScreen = isFullScreen; }; - bool StartFullScreen() { return m_startFullScreen; }; - void SetStartFullScreen(bool startFullScreen) { m_startFullScreen = startFullScreen; }; - bool OutputCompactJSON() { return m_jsonOutputCompact; }; - bool EnableMultimediaKeys() { return m_enableMultimediaKeys; }; - bool CanQuit() { return m_canQuit; }; - bool CanWindowed() { return m_canWindowed; }; - bool ShowSplash() { return m_showSplash; }; - private: - bool m_videoUseTimeSeeking; - bool m_musicUseTimeSeeking; - bool m_measureRefreshrate; - bool m_fullScreen; - bool m_startFullScreen; bool m_jsonOutputCompact; - bool m_enableMultimediaKeys; - bool m_canQuit; - bool m_canWindowed; - bool m_showSplash; - bool m_useVirtualShares; - bool m_alwaysOnTop; - bool m_GLRectangleHack; - bool m_AllowD3D9Ex; - bool m_ForceD3D9Ex; - bool m_AllowDynamicTextures; - bool m_playlistAsFolders; - bool m_useDDSFanart; - bool m_dvdplayerIgnoreDTSinWAV; - /* Karaoke Settings */ - bool m_karaokeAlwaysEmptyOnCdgs; - bool m_karaokeKeepDelay; + unsigned int m_jsonTcpPort; - std::vector<CStdString> m_settingsFiles; - void ParseSettingsFile(CStdString file); + bool m_enableMultimediaKeys; }; -XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);
\ No newline at end of file +XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings); diff --git a/xbmc/settings/AppParamParser.cpp b/xbmc/settings/AppParamParser.cpp deleted file mode 100644 index 3409a7af31..0000000000 --- a/xbmc/settings/AppParamParser.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "AppParamParser.h" -#include "AdvancedSettings.h" -#include "PlayListPlayer.h" -#include "FileItem.h" -#include "Application.h" -#include "log.h" -#include "utils/CharsetConverter.h" -#ifdef _WIN32 -#include "WIN32Util.h" -#endif -#ifdef HAS_LIRC -#include "input/linux/LIRC.h" -#endif - -CAppParamParser::CAppParamParser() -{ - m_testmode = false; -} - -#ifdef _WIN32 -void CAppParamParser::Parse(LPWSTR *szArglist, int nArgs) -{ - if (szArglist != NULL) - { - for (int i=0;i<nArgs;i++) - { - CStdString strArg; - g_charsetConverter.wToUTF8(szArglist[i], strArg); - ParseArg(strArg); - if (strArg.Equals("-d")) - { - if (++i < nArgs) - { - int iSleep = _wtoi(szArglist[i]); - if (iSleep > 0 && iSleep < 360) - Sleep(iSleep*1000); - else - --i; - } - } - } - LocalFree(szArglist); - } - PlayPlaylist(); -} -#else -void CAppParamParser::Parse(char* argv[], int nArgs) -{ - if (nArgs > 1) - { - for (int i = 1; i < nArgs; i++) - { - ParseArg(argv[i]); -#ifdef HAS_LIRC - if (strnicmp(argv[i], "-l", 2) == 0 || strnicmp(argv[i], "--lircdev", 9) == 0) - { - // check the next arg with the proper value. - int next=i+1; - if (next < nArgs) - { - if ((argv[next][0] != '-' ) && (argv[next][0] == '/' )) - { - g_RemoteControl.setDeviceName(argv[next]); - i++; - } - } - } - else if (strnicmp(argv[i], "-n", 2) == 0 || strnicmp(argv[i], "--nolirc", 8) == 0) - g_RemoteControl.setUsed(false); -#endif - } - } - PlayPlaylist(); -} -#endif - -void CAppParamParser::DisplayHelp() -{ - printf("Usage: xbmc [OPTION]... [FILE]...\n\n"); - printf("Arguments:\n"); - printf(" -fs\t\t\tRuns XBMC in full screen\n"); - printf(" --standalone\t\tXBMC runs in a stand alone environment without a window \n"); - printf("\t\t\tmanager and supporting applications. For example, that\n"); - printf("\t\t\tenables network settings.\n"); - printf(" -p or --portable\tXBMC will look for configurations in install folder instead of ~/.xbmc\n"); - printf(" --legacy-res\t\tEnables screen resolutions such as PAL, NTSC, etc.\n"); -#ifdef HAS_LIRC - printf(" -l or --lircdev\tLircDevice to use default is "LIRC_DEVICE" .\n"); - printf(" -n or --nolirc\tdo not use Lirc, i.e. no remote input.\n"); -#endif - printf(" --debug\t\tEnable debug logging\n"); - printf(" --test\t\tEnable test mode. [FILE] required.\n"); - printf(" --settings=<filename>\t\tLoads specified file after advancedsettings.xml replacing any settings specified\n"); - printf(" \t\t\t\tspecified file must exist in special://xbmc/system/\n"); - exit(0); -} - -void CAppParamParser::EnableDebugMode() -{ - g_advancedSettings.m_logLevel = LOG_LEVEL_DEBUG; - g_advancedSettings.m_logLevelHint = LOG_LEVEL_DEBUG; - CLog::SetLogLevel(g_advancedSettings.m_logLevel); -} - -void CAppParamParser::SetStartFullScreen() -{ - g_advancedSettings.SetStartFullScreen(true); -} - -void CAppParamParser::SetIsStandalone() -{ - g_application.SetStandAlone(true); -} - -void CAppParamParser::SetPortable() -{ - g_application.EnablePlatformDirectories(false); -} - -void CAppParamParser::ParseArg(CStdString arg) -{ - if (arg == "-fs" || arg == "--fullscreen") - SetStartFullScreen(); - else if (arg == "-h" || arg == "--help") - DisplayHelp(); - else if (arg == "--standalone") - SetIsStandalone(); - else if (arg == "-p" || arg == "--portable") - SetPortable(); - else if (arg == "--debug") - EnableDebugMode(); - else if (arg == "--legacy-res") - g_application.SetEnableLegacyRes(true); - else if (arg == "--test") - m_testmode = true; - else if (arg.substr(0, 11) == "--settings=") - { - g_advancedSettings.AddSettingsFile(arg.substr(11)); - } - else if (arg.length() != 0 && arg[0] != '-') - { - if (m_testmode) - g_application.SetEnableTestMode(true); - CFileItemPtr pItem(new CFileItem(arg)); - pItem->m_strPath = arg; - m_playlist.Add(pItem); - } -} - -void CAppParamParser::PlayPlaylist() -{ - if (m_playlist.Size() > 0) - { - g_playlistPlayer.Add(0, m_playlist); - g_playlistPlayer.SetCurrentPlaylist(0); - } - - ThreadMessage tMsg = {TMSG_PLAYLISTPLAYER_PLAY, (DWORD) -1}; - g_application.getApplicationMessenger().SendMessage(tMsg, false); -} diff --git a/xbmc/settings/AppParamParser.h b/xbmc/settings/AppParamParser.h deleted file mode 100644 index 02483efe95..0000000000 --- a/xbmc/settings/AppParamParser.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#ifdef _WIN32 -#include "WIN32Util.h" -#endif -#include "PlayListPlayer.h" -#include "FileItem.h" - -class CAppParamParser -{ - public: - CAppParamParser(); -#ifdef _WIN32 - void Parse(LPWSTR *szArglist, int nArgs); -#else - void Parse(char* argv[], int nArgs); -#endif - private: - bool m_testmode; - CFileItemList m_playlist; - void ParseArg(CStdString arg); - void DisplayHelp(); - void EnableDebugMode(); - void SetStartFullScreen(); - void SetIsStandalone(); - void SetPortable(); - void PlayPlaylist(); -};
\ No newline at end of file diff --git a/xbmc/settings/GUIWindowSettingsCategory.cpp b/xbmc/settings/GUIWindowSettingsCategory.cpp index 88e1dda697..c7f68366cf 100644 --- a/xbmc/settings/GUIWindowSettingsCategory.cpp +++ b/xbmc/settings/GUIWindowSettingsCategory.cpp @@ -2322,8 +2322,7 @@ DisplayMode CGUIWindowSettingsCategory::FillInScreens(CStdString strSetting, RES pControl->Clear(); CStdString strScreen; - if (g_advancedSettings.CanWindowed()) - pControl->AddLabel(g_localizeStrings.Get(242), -1); + pControl->AddLabel(g_localizeStrings.Get(242), -1); for (int idx = 0; idx < g_Windowing.GetNumScreens(); idx++) { diff --git a/xbmc/video/VideoReferenceClock.cpp b/xbmc/video/VideoReferenceClock.cpp index 0215093647..07fed65ed5 100644 --- a/xbmc/video/VideoReferenceClock.cpp +++ b/xbmc/video/VideoReferenceClock.cpp @@ -659,7 +659,7 @@ bool CVideoReferenceClock::SetupD3D() //forced update of windows refreshrate UpdateRefreshrate(true); - if (g_advancedSettings.MeasureRefreshRate()) + if (g_advancedSettings.m_measureRefreshrate) { //measure the refreshrate a couple times list<double> Measures; diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp index aefa29453c..d4dae281ad 100644 --- a/xbmc/video/windows/GUIWindowVideoBase.cpp +++ b/xbmc/video/windows/GUIWindowVideoBase.cpp @@ -1092,12 +1092,13 @@ void CGUIWindowVideoBase::GetContextButtons(int itemNumber, CContextButtons &but } // allow a folder to be ad-hoc queued and played by the default player - if (item->m_bIsFolder || (item->IsPlayList() && !g_advancedSettings.ShowPlaylistAsFolders())) + if (item->m_bIsFolder || (item->IsPlayList() && + !g_advancedSettings.m_playlistAsFolders)) { buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 208); } } - if (!item->m_bIsFolder && !(item->IsPlayList() && !g_advancedSettings.ShowPlaylistAsFolders())) + if (!item->m_bIsFolder && !(item->IsPlayList() && !g_advancedSettings.m_playlistAsFolders)) { // get players VECPLAYERCORES vecCores; if (item->IsVideoDb()) diff --git a/xbmc/win32/XBMC_PC.cpp b/xbmc/win32/XBMC_PC.cpp index dcf3134bb4..4e98e120cc 100644 --- a/xbmc/win32/XBMC_PC.cpp +++ b/xbmc/win32/XBMC_PC.cpp @@ -20,7 +20,6 @@ */ #include "settings/AdvancedSettings.h" -#include "settings/AppParamParser.h" #include "utils/log.h" #include "WIN32Util.h" #include "shellapi.h" @@ -152,10 +151,35 @@ INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR commandLine, INT ) setlocale(LC_NUMERIC, "C"); g_advancedSettings.Initialize(); szArglist = CommandLineToArgvW(strcl.c_str(), &nArgs); -#ifdef _WIN32 - CAppParamParser appParamParser = CAppParamParser(); - appParamParser.Parse(szArglist, nArgs); -#endif + if(szArglist != NULL) + { + for(int i=0;i<nArgs;i++) + { + CStdStringW strArgW(szArglist[i]); + if(strArgW.Equals(L"-fs")) + g_advancedSettings.m_startFullScreen = true; + else if(strArgW.Equals(L"-p") || strArgW.Equals(L"--portable")) + g_application.EnablePlatformDirectories(false); + else if(strArgW.Equals(L"-d")) + { + if(++i < nArgs) + { + int iSleep = _wtoi(szArglist[i]); + if(iSleep > 0 && iSleep < 360) + Sleep(iSleep*1000); + else + --i; + } + } + else if(strArgW.Equals(L"--debug")) + { + g_advancedSettings.m_logLevel = LOG_LEVEL_DEBUG; + g_advancedSettings.m_logLevelHint = LOG_LEVEL_DEBUG; + CLog::SetLogLevel(g_advancedSettings.m_logLevel); + } + } + LocalFree(szArglist); + } WSADATA wd; WSAStartup(MAKEWORD(2,2), &wd); diff --git a/xbmc/windowing/windows/WinEventsWin32.cpp b/xbmc/windowing/windows/WinEventsWin32.cpp index 6f8a4c6653..755c4bdb0c 100644 --- a/xbmc/windowing/windows/WinEventsWin32.cpp +++ b/xbmc/windowing/windows/WinEventsWin32.cpp @@ -202,7 +202,7 @@ void DIB_InitOSKeymap() // Only include the multimedia keys if they have been enabled in the // advanced settings - if (g_advancedSettings.EnableMultimediaKeys()) + if (g_advancedSettings.m_enableMultimediaKeys) { VK_keymap[VK_BROWSER_BACK] = XBMCK_BROWSER_BACK; VK_keymap[VK_BROWSER_FORWARD] = XBMCK_BROWSER_FORWARD; diff --git a/xbmc/windowing/windows/WinSystemWin32.cpp b/xbmc/windowing/windows/WinSystemWin32.cpp index 101e8edbc9..d4b3cac6c8 100644 --- a/xbmc/windowing/windows/WinSystemWin32.cpp +++ b/xbmc/windowing/windows/WinSystemWin32.cpp @@ -377,7 +377,7 @@ bool CWinSystemWin32::ResizeInternal(bool forceRefresh) else { dwStyle |= WS_OVERLAPPEDWINDOW; - windowAfter = g_advancedSettings.AlwaysOnTop() ? HWND_TOPMOST : HWND_NOTOPMOST; + windowAfter = g_advancedSettings.m_alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST; if(m_nTop <= 0 || m_nLeft <= 0) CenterWindow(); @@ -665,7 +665,7 @@ bool CWinSystemWin32::Show(bool raise) if (m_bFullScreen) windowAfter = HWND_TOP; else - windowAfter = g_advancedSettings.AlwaysOnTop() ? HWND_TOPMOST : HWND_NOTOPMOST; + windowAfter = g_advancedSettings.m_alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST; } SetWindowPos(m_hWnd, windowAfter, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW); diff --git a/xbmc/xbmc.cpp b/xbmc/xbmc.cpp index f0c6268d93..a960c7eabd 100644 --- a/xbmc/xbmc.cpp +++ b/xbmc/xbmc.cpp @@ -28,7 +28,6 @@ // #include "system.h" -#include "settings/AppParamParser.h" #include "settings/AdvancedSettings.h" #include "FileItem.h" #include "Application.h" @@ -59,6 +58,7 @@ int main(int argc, char* argv[]) #endif CLog::SetLogLevel(g_advancedSettings.m_logLevel); + CFileItemList playlist; #ifdef _LINUX #if defined(DEBUG) struct rlimit rlim; @@ -76,11 +76,82 @@ int main(int argc, char* argv[]) #endif setlocale(LC_NUMERIC, "C"); g_advancedSettings.Initialize(); - -#ifndef _WIN32 - CAppParamParser appParamParser = CAppParamParser(); - appParamParser.Parse(argv); + bool testmode = 0; + if (argc > 1) + { + for (int i = 1; i < argc; i++) + { + if (strnicmp(argv[i], "-fs", 3) == 0 || strnicmp(argv[i], "--fullscreen", 12) == 0) + { + g_advancedSettings.m_startFullScreen = true; + } + else if (strnicmp(argv[i], "-h", 2) == 0 || strnicmp(argv[i], "--help", 6) == 0) + { + printf("Usage: %s [OPTION]... [FILE]...\n\n", argv[0]); + printf("Arguments:\n"); + printf(" -fs\t\t\tRuns XBMC in full screen\n"); + printf(" --standalone\t\tXBMC runs in a stand alone environment without a window \n"); + printf("\t\t\tmanager and supporting applications. For example, that\n"); + printf("\t\t\tenables network settings.\n"); + printf(" -p or --portable\tXBMC will look for configurations in install folder instead of ~/.xbmc\n"); + printf(" --legacy-res\t\tEnables screen resolutions such as PAL, NTSC, etc.\n"); +#ifdef HAS_LIRC + printf(" -l or --lircdev\tLircDevice to use default is "LIRC_DEVICE" .\n"); + printf(" -n or --nolirc\tdo not use Lirc, aka no remote input.\n"); #endif + printf(" --debug\t\tEnable debug logging\n"); + printf(" --test\t\tEnable test mode. [FILE] required.\n"); + exit(0); + } + else if (strnicmp(argv[i], "--standalone", 12) == 0) + { + g_application.SetStandAlone(true); + } + else if (strnicmp(argv[i], "-p", 2) == 0 || strnicmp(argv[i], "--portable", 10) == 0) + { + g_application.EnablePlatformDirectories(false); + } + else if (strnicmp(argv[i], "--legacy-res", 12) == 0) + { + g_application.SetEnableLegacyRes(true); + } + else if (strnicmp(argv[i], "--test", 6) == 0) + { + testmode=1; + } +#ifdef HAS_LIRC + else if (strnicmp(argv[i], "-l", 2) == 0 || strnicmp(argv[i], "--lircdev", 9) == 0) + { + // check the next arg with the proper value. + int next=i+1; + if (next < argc) + { + if ((argv[next][0] != '-' ) && (argv[next][0] == '/' )) + { + g_RemoteControl.setDeviceName(argv[next]); + i++; + } + } + } + else if (strnicmp(argv[i], "-n", 2) == 0 || strnicmp(argv[i], "--nolirc", 8) == 0) + g_RemoteControl.setUsed(false); +#endif + else if (strnicmp(argv[i], "--debug", 7) == 0) + { + g_advancedSettings.m_logLevel = LOG_LEVEL_DEBUG; + g_advancedSettings.m_logLevelHint = LOG_LEVEL_DEBUG; + CLog::SetLogLevel(g_advancedSettings.m_logLevel); + } + else if (strlen(argv[i]) != 0 && argv[i][0] != '-') + { + CFileItemPtr pItem(new CFileItem(argv[i])); + pItem->m_strPath = argv[i]; + if (testmode) g_application.SetEnableTestMode(true); + playlist.Add(pItem); + } + } + } + g_application.Preflight(); if (!g_application.Create()) { @@ -88,6 +159,15 @@ int main(int argc, char* argv[]) return status; } + if (playlist.Size() > 0) + { + g_playlistPlayer.Add(0,playlist); + g_playlistPlayer.SetCurrentPlaylist(0); + } + + ThreadMessage tMsg = {TMSG_PLAYLISTPLAYER_PLAY, (DWORD) -1}; + g_application.getApplicationMessenger().SendMessage(tMsg, false); + try { status = g_application.Run(); |