aboutsummaryrefslogtreecommitdiff
path: root/xbmc/xbmc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/xbmc.cpp')
-rw-r--r--xbmc/xbmc.cpp90
1 files changed, 5 insertions, 85 deletions
diff --git a/xbmc/xbmc.cpp b/xbmc/xbmc.cpp
index a960c7eabd..df09677dbc 100644
--- a/xbmc/xbmc.cpp
+++ b/xbmc/xbmc.cpp
@@ -28,6 +28,7 @@
//
#include "system.h"
+#include "settings/AppParamParser.h"
#include "settings/AdvancedSettings.h"
#include "FileItem.h"
#include "Application.h"
@@ -58,7 +59,6 @@ int main(int argc, char* argv[])
#endif
CLog::SetLogLevel(g_advancedSettings.m_logLevel);
- CFileItemList playlist;
#ifdef _LINUX
#if defined(DEBUG)
struct rlimit rlim;
@@ -76,82 +76,11 @@ int main(int argc, char* argv[])
#endif
setlocale(LC_NUMERIC, "C");
g_advancedSettings.Initialize();
- 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");
+
+#ifndef _WIN32
+ CAppParamParser appParamParser;
+ appParamParser.Parse((const char **)argv, argc);
#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())
{
@@ -159,15 +88,6 @@ 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();