*
*/
+#include "network/Network.h"
#include "threads/SystemClock.h"
#include "system.h"
#include "Application.h"
#include "music/karaoke/GUIDialogKaraokeSongSelector.h"
#include "music/karaoke/GUIWindowKaraokeLyrics.h"
#endif
-#include "network/Network.h"
#include "network/Zeroconf.h"
#include "network/ZeroconfBrowser.h"
#ifndef _LINUX
#include "pictures/GUIDialogPictureInfo.h"
#include "addons/GUIDialogAddonSettings.h"
#include "addons/GUIDialogAddonInfo.h"
-#ifdef HAS_LINUX_NETWORK
-#include "network/GUIDialogAccessPoints.h"
-#endif
/* PVR related include Files */
#include "pvr/PVRManager.h"
, m_musicInfoScanner(new CMusicInfoScanner)
, m_seekHandler(new CSeekHandler)
{
+ m_network = NULL;
TiXmlBase::SetCondenseWhiteSpace(false);
m_iPlaySpeed = 1;
m_bInhibitIdleShutdown = false;
delete m_dpms;
delete m_seekHandler;
delete m_pInertialScrollingHandler;
+
+ if (m_network != NULL)
+ delete m_network;
}
bool CApplication::OnEvent(XBMC_Event& newEvent)
bool CApplication::Create()
{
+#if defined(HAS_LINUX_NETWORK)
+ m_network = new CNetworkLinux();
+#elif defined(HAS_WIN32_NETWORK)
+ m_network = new CNetworkWin32();
+#else
+ m_network = new CNetwork();
+#endif
+
Preflight();
g_settings.Initialize(); //Initialize default AdvancedSettings
CStdString executable = CUtil::ResolveExecutablePath();
CLog::Log(LOGNOTICE, "The executable running is: %s", executable.c_str());
- CLog::Log(LOGNOTICE, "Local hostname: %s", m_network.GetHostName().c_str());
+ CLog::Log(LOGNOTICE, "Local hostname: %s", m_network->GetHostName().c_str());
CLog::Log(LOGNOTICE, "Log File is located: %sxbmc.log", g_settings.m_logFolder.c_str());
CLog::Log(LOGNOTICE, "-----------------------------------------------------------------------");
bool CApplication::StartWebServer()
{
#ifdef HAS_WEB_SERVER
- if (g_guiSettings.GetBool("services.webserver") && m_network.IsAvailable())
+ if (g_guiSettings.GetBool("services.webserver") && m_network->IsAvailable())
{
int webPort = atoi(g_guiSettings.GetString("services.webserverport"));
CLog::Log(LOGNOTICE, "Webserver: Starting...");
{
bool ret = false;
#ifdef HAS_AIRPLAY
- if (g_guiSettings.GetBool("services.airplay") && m_network.IsAvailable())
+ if (g_guiSettings.GetBool("services.airplay") && m_network->IsAvailable())
{
int listenPort = g_advancedSettings.m_airPlayPort;
CStdString password = g_guiSettings.GetString("services.airplaypassword");
#endif
{
#ifdef HAS_AIRTUNES
- if (g_guiSettings.GetBool("services.airplay") && m_network.IsAvailable())
+ if (g_guiSettings.GetBool("services.airplay") && m_network->IsAvailable())
{
int listenPort = g_advancedSettings.m_airTunesPort;
CStdString password = g_guiSettings.GetString("services.airplaypassword");
void CApplication::StopServices()
{
- m_network.NetworkMessage(CNetwork::SERVICES_DOWN, 0);
+ m_network->NetworkMessage(CNetwork::SERVICES_DOWN, 0);
#if !defined(_WIN32) && defined(HAS_DVD_DRIVE)
CLog::Log(LOGNOTICE, "stop dvd detect media");
m_renderGUI = renderGUI;
}
-#if defined(HAS_LINUX_NETWORK)
-CNetworkLinux& CApplication::getNetwork()
-{
- return m_network;
-}
-#elif defined(HAS_WIN32_NETWORK)
-CNetworkWin32& CApplication::getNetwork()
-{
- return m_network;
-}
-#else
CNetwork& CApplication::getNetwork()
{
- return m_network;
+ return *m_network;
}
-
-#endif
#ifdef HAS_PERFORMANCE_SAMPLE
CPerformanceStats &CApplication::GetPerformanceStats()
{
#include "guilib/IMsgTargetCallback.h"
#include "guilib/Key.h"
#include "threads/Condition.h"
+#include "utils/GlobalsHandling.h"
#include <map>
#include "win32/WIN32Util.h"
#endif
#include "utils/Stopwatch.h"
-#include "network/Network.h"
#include "utils/CharsetConverter.h"
#ifdef HAS_PERFORMANCE_SAMPLE
#include "utils/PerformanceStats.h"
class CHTTPWebinterfaceAddonsHandler;
#endif
#endif
+
+class CNetwork;
+
namespace VIDEO
{
class CVideoInfoScanner;
static bool OnEvent(XBMC_Event& newEvent);
-#if defined(HAS_LINUX_NETWORK)
- CNetworkLinux& getNetwork();
-#elif defined(HAS_WIN32_NETWORK)
- CNetworkWin32& getNetwork();
-#else
CNetwork& getNetwork();
-#endif
#ifdef HAS_PERFORMANCE_SAMPLE
CPerformanceStats &GetPerformanceStats();
#endif
CSeekHandler *m_seekHandler;
CInertialScrollingHandler *m_pInertialScrollingHandler;
-#if defined(HAS_LINUX_NETWORK)
- CNetworkLinux m_network;
-#elif defined(HAS_WIN32_NETWORK)
- CNetworkWin32 m_network;
-#else
- CNetwork m_network;
-#endif
+ CNetwork *m_network;
#ifdef HAS_PERFORMANCE_SAMPLE
CPerformanceStats m_perfStats;
#endif
};
-extern CApplication g_application;
+XBMC_GLOBAL_REF(CApplication,g_application);
+#define g_application XBMC_GLOBAL_USE(CApplication)
*
*/
+#include "network/Network.h"
#include "system.h"
#include "GUIInfoManager.h"
#include "windows/GUIMediaWindow.h"
CLocalizeStrings g_localizeStrings;
CLocalizeStrings g_localizeStringsTemp;
- CGUIWindowManager g_windowManager;
XFILE::CDirectoryCache g_directoryCache;
CGUITextureManager g_TextureManager;
#endif
CAlarmClock g_alarmClock;
PLAYLIST::CPlayListPlayer g_playlistPlayer;
- CApplication g_application;
#ifdef TARGET_RASPBERRY_PI
CRBP g_RBP;
* <http://www.gnu.org/licenses/>.
*
*/
+#include "network/Network.h"
#include "threads/SystemClock.h"
#include "system.h"
#if defined(TARGET_DARWIN)
#if (defined HAVE_CONFIG_H) && (!defined WIN32)
#include "config.h"
#endif
+#include "network/Network.h"
#include "system.h"
#include "DirectoryFactory.h"
#include "HDDirectory.h"
#if (defined HAVE_CONFIG_H) && (!defined WIN32)
#include "config.h"
#endif
+#include "network/Network.h"
#include "system.h"
#include "FileFactory.h"
#include "HDFile.h"
#include "IWindowManagerCallback.h"
#include "IMsgTargetCallback.h"
#include "DirtyRegionTracker.h"
+#include "utils/GlobalsHandling.h"
class CGUIDialog;
\ingroup winman
\brief
*/
-extern CGUIWindowManager g_windowManager;
+XBMC_GLOBAL_REF(CGUIWindowManager,g_windowManager);
+#define g_windowManager XBMC_GLOBAL_USE(CGUIWindowManager)
#endif
*
*/
+#include "network/Network.h"
#include "system.h"
#include "utils/AlarmClock.h"
#include "utils/Screenshot.h"
#if (defined HAVE_CONFIG_H) && (!defined WIN32)
#include "config.h"
#endif
+#include "network/Network.h"
#include "ModuleXbmc.h"
*
*/
+#include "network/Network.h"
#include "threads/SystemClock.h"
#include "system.h"
#include "MusicDatabase.h"
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "network/Network.h"
#include "AirPlayServer.h"
#ifdef HAS_AIRPLAY
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "network/Network.h"
#if !defined(TARGET_WINDOWS)
#pragma GCC diagnostic ignored "-Wwrite-strings"
#endif
+#include "network/Network.h"
#include "UPnPRenderer.h"
#include "UPnP.h"
#include "UPnPInternal.h"
*
*/
+#include "network/Network.h"
#include "GUISettings.h"
#include <limits.h>
#include <float.h>
*
*/
+#include "network/Network.h"
#include "threads/SystemClock.h"
#include "RssReader.h"
#include "utils/HTMLUtil.h"
*
*/
+#include "network/Network.h"
#include "URIUtils.h"
#include "Application.h"
#include "FileItem.h"