[osx/mavericks] - ugly hacked fix for the mouse bug (mouse wasn't able t...
88ACB01D0DCF409E0083CFDF /* ASAPCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASAPCodec.h; sourceTree = "<group>"; };
88ACB01E0DCF409E0083CFDF /* DllASAP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllASAP.h; sourceTree = "<group>"; };
88ECB6580DE013C4003396A7 /* DiskArbitration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiskArbitration.framework; path = /System/Library/Frameworks/DiskArbitration.framework; sourceTree = "<absolute>"; };
- 8DD76F7E0486A8DE00D96B5E /* XBMC */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = XBMC; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8DD76F7E0486A8DE00D96B5E /* XBMC */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = XBMC; sourceTree = BUILT_PRODUCTS_DIR; };
AE84CB5915A5B8A600A3810E /* TagLibVFSStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagLibVFSStream.cpp; sourceTree = "<group>"; };
AE84CB5C15A5B8BA00A3810E /* TagLibVFSStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagLibVFSStream.h; sourceTree = "<group>"; };
AE89ACA41621DAB800E17DBC /* DVDDemuxBXA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDDemuxBXA.cpp; sourceTree = "<group>"; };
E49910D9174E4A6400741B6D /* IOSExternalTouchController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSExternalTouchController.mm; sourceTree = "<group>"; };
E49910DA174E4A6400741B6D /* IOSScreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSScreenManager.h; sourceTree = "<group>"; };
E49910DB174E4A6400741B6D /* IOSScreenManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSScreenManager.mm; sourceTree = "<group>"; };
- E49910E2174E549400741B6D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
- E49910E4174E54A100741B6D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
- E49910E6174E54B300741B6D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreMedia.framework; sourceTree = DEVELOPER_DIR; };
- E49910E8174E54C300741B6D /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreVideo.framework; sourceTree = DEVELOPER_DIR; };
- E49910EA174E54C900741B6D /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreAudio.framework; sourceTree = DEVELOPER_DIR; };
- E49910EC174E54D200741B6D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; };
- E49910EE174E54E400741B6D /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/ImageIO.framework; sourceTree = DEVELOPER_DIR; };
- E49910F0174E54EC00741B6D /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
- E49910F2174E54FB00741B6D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };
- E49910F4174E550200741B6D /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; };
+ E49910E2174E549400741B6D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ E49910E4174E54A100741B6D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
+ E49910E6174E54B300741B6D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
+ E49910E8174E54C300741B6D /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; };
+ E49910EA174E54C900741B6D /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
+ E49910EC174E54D200741B6D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
+ E49910EE174E54E400741B6D /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
+ E49910F0174E54EC00741B6D /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+ E49910F2174E54FB00741B6D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
+ E49910F4174E550200741B6D /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
E4991334174E5E5C00741B6D /* GenericTouchActionHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GenericTouchActionHandler.cpp; sourceTree = "<group>"; };
E4991335174E5E5C00741B6D /* GenericTouchActionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericTouchActionHandler.h; sourceTree = "<group>"; };
E4991340174E5E5C00741B6D /* ITouchActionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ITouchActionHandler.h; sourceTree = "<group>"; };
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
- "\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks\"",
);
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = 4.2;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
- "\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks\"",
);
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
- "\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks\"",
"\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
- "\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks\"",
"\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
<setting id="pvrmenu.searchicons" type="action" label="19167" help="36217">
<level>1</level>
<dependencies>
- <dependency type="enable" setting="pvrmanager.enabled">true</dependency>
+ <dependency type="enable">
+ <and>
+ <condition setting="pvrmanager.enabled" operator="is">true</condition>
+ <condition setting="pvrmenu.iconpath" operator="!is"></condition>
+ </and>
+ </dependency>
</dependencies>
</setting>
</group>
/**
* This struct represents a pre-introduction of the std::type_index for RTTI
- * which will only availalbe in C++11.
+ * which is only availalbe in C++11.
*/
namespace XbmcCommons
inline bool
operator<(const type_index& __rhs) const
- { return _M_target->before(*__rhs._M_target); }
+ { return _M_target->before(*__rhs._M_target) != 0; }
inline bool
operator<=(const type_index& __rhs) const
inline bool
operator>(const type_index& __rhs) const
- { return __rhs._M_target->before(*_M_target); }
+ { return __rhs._M_target->before(*_M_target) != 0; }
inline bool
operator>=(const type_index& __rhs) const
* on the object. It will prevent the deallocation during
* the time it's held.
*/
- bool isDeallocating() { TRACE; return m_isDeallocating; }
+ bool isDeallocating() { XBMC_TRACE; return m_isDeallocating; }
static short getNumAddonClasses();
return cDefault;
}
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
static XbmcThreads::ThreadLocal<TraceGuard> tlParent;
static char** getSpacesArray(int size)
#pragma once
-//#define ENABLE_TRACE_API
+//#define ENABLE_XBMC_TRACE_API
#include "threads/SingleLock.h"
~InvertSingleLockGuard() { lock.Enter(); }
};
-// class WaitForNotify
-// {
-// std::vector<HANDLE> thoseWaiting;
-// CCriticalSection csection; // Ha!
-// CCriticalSection atomicWait;
-// public:
-// void wait();
-// void notify();
-// void notifyAll();
-// };
-
#define LOCKGUI XBMCAddonUtils::GuiLock __gl
/*
*/
const char *getDefaultImage(char* cControlType, char* cTextureType, char* cDefault);
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
class TraceGuard
{
const char* function;
#endif
}
-#ifdef ENABLE_TRACE_API
-#define TRACE XBMCAddonUtils::TraceGuard _tg(__PRETTY_FUNCTION__)
+#ifdef ENABLE_XBMC_TRACE_API
+#define XBMC_TRACE XBMCAddonUtils::TraceGuard _tg(__PRETTY_FUNCTION__)
#else
-#define TRACE
+#define XBMC_TRACE
#endif
inline operator const T1& () const throw (WrongTypeException) { return former(); }
inline operator T2& () throw (WrongTypeException) { return later(); }
inline operator const T2& () const throw (WrongTypeException) { return later(); }
-
- static inline Alternative<T1,T2>& nullItem() { return *(Alternative<T1,T2>*)NULL; }
- static inline bool isNullReference(const Alternative<T1,T2>& ref) { return (&ref) == NULL; }
};
}
virtual ~CallbackFunction() { deallocating(); }
- virtual void executeCallback() { TRACE; ((*obj).*(meth))(); }
+ virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(); }
};
/**
virtual ~CallbackFunction() { deallocating(); }
- virtual void executeCallback() { TRACE; ((*obj).*(meth))(param); }
+ virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(param); }
};
/**
virtual ~CallbackFunction() { deallocating(); }
- virtual void executeCallback() { TRACE; ((*obj).*(meth))(param); }
+ virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(param); }
};
virtual ~CallbackFunction() { deallocating(); }
- virtual void executeCallback() { TRACE; ((*obj).*(meth))(param1,param2); }
+ virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(param1,param2); }
};
virtual ~CallbackFunction() { deallocating(); }
- virtual void executeCallback() { TRACE; ((*obj).*(meth))(param1,param2,param3); }
+ virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(param1,param2,param3); }
};
}
AddonClass::Ref<Callback> cb;
RetardedAsynchCallbackHandler* handler;
AsynchCallbackMessage(Callback* _cb, RetardedAsynchCallbackHandler* _handler) :
- cb(_cb), handler(_handler) { TRACE; }
+ cb(_cb), handler(_handler) { XBMC_TRACE; }
};
//********************************************************************
void RetardedAsynchCallbackHandler::invokeCallback(Callback* cb)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(critSection);
g_callQueue.push_back(new AsynchCallbackMessage(cb,this));
}
RetardedAsynchCallbackHandler::~RetardedAsynchCallbackHandler()
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(critSection);
// find any messages that might be there because of me ... and remove them
void RetardedAsynchCallbackHandler::makePendingCalls()
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(critSection);
CallbackQueue::iterator iter = g_callQueue.begin();
while (iter != g_callQueue.end())
// we need to grab the object lock to see if the object of the call
// is deallocating. holding this lock should prevent it from
// deallocating durring the execution of this call.
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
CLog::Log(LOGDEBUG,"%sNEWADDON executing callback 0x%lx",_tg.getSpaces(),(long)(p->cb.get()));
#endif
CSingleLock lock2(*(p->cb->getObject()));
void RetardedAsynchCallbackHandler::clearPendingCalls(void* userData)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(critSection);
CallbackQueue::iterator iter = g_callQueue.begin();
while (iter != g_callQueue.end())
if(p->handler->shouldRemoveCallback(p->cb->getObject(),userData))
{
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
CLog::Log(LOGDEBUG,"%sNEWADDON removing callback 0x%lx for PyThreadState 0x%lx from queue", _tg.getSpaces(),(long)(p->cb.get()) ,(long)userData);
#endif
iter = g_callQueue.erase(iter);
void ControlList::addItem(const Alternative<String, const XBMCAddon::xbmcgui::ListItem* > & item, bool sendMessage)
{
- TRACE;
+ XBMC_TRACE;
if (item.which() == first)
internAddListItem(ListItem::fromString(item.former()),sendMessage);
void ControlList::addItems(const std::vector<Alternative<String, const XBMCAddon::xbmcgui::ListItem* > > & items)
{
- TRACE;
+ XBMC_TRACE;
for (std::vector<Alternative<String, const XBMCAddon::xbmcgui::ListItem* > >::const_iterator iter = items.begin(); iter != items.end(); ++iter)
addItem(*iter,false);
return value;
}
- DialogProgress::~DialogProgress() { TRACE; deallocating(); }
+ DialogProgress::~DialogProgress() { XBMC_TRACE; deallocating(); }
void DialogProgress::deallocating()
{
- TRACE;
+ XBMC_TRACE;
if (dlg)
{
return dlg->IsCanceled();
}
- DialogProgressBG::~DialogProgressBG() { TRACE; deallocating(); }
+ DialogProgressBG::~DialogProgressBG() { XBMC_TRACE; deallocating(); }
void DialogProgressBG::deallocating()
{
- TRACE;
+ XBMC_TRACE;
if (dlg)
{
void LanguageHook::SetLanguageHook(LanguageHook* languageHook)
{
- TRACE;
+ XBMC_TRACE;
languageHook->Acquire();
addonLanguageHookTls.set(languageHook);
}
void shutdown()
{
- TRACE;
+ XBMC_TRACE;
ThreadMessage tMsg = {TMSG_SHUTDOWN};
CApplicationMessenger::Get().SendMessage(tMsg);
}
void restart()
{
- TRACE;
+ XBMC_TRACE;
ThreadMessage tMsg = {TMSG_RESTART};
CApplicationMessenger::Get().SendMessage(tMsg);
}
void executescript(const char* script)
{
- TRACE;
+ XBMC_TRACE;
if (! script)
return;
void executebuiltin(const char* function, bool wait /* = false*/)
{
- TRACE;
+ XBMC_TRACE;
if (! function)
return;
CApplicationMessenger::Get().ExecBuiltIn(function,wait);
String executehttpapi(const char* httpcommand)
{
- TRACE;
+ XBMC_TRACE;
THROW_UNIMP("executehttpapi");
}
String executeJSONRPC(const char* jsonrpccommand)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dg;
#ifdef HAS_JSONRPC
String ret;
void sleep(long timemillis)
{
- TRACE;
+ XBMC_TRACE;
XbmcThreads::EndTime endTime(timemillis);
while (!endTime.IsTimePast())
String getLocalizedString(int id)
{
- TRACE;
+ XBMC_TRACE;
String label;
if (id >= 30000 && id <= 30999)
label = g_localizeStringsTemp.Get(id);
String getSkinDir()
{
- TRACE;
+ XBMC_TRACE;
return CSettings::Get().GetString("lookandfeel.skin");
}
String getLanguage(int format /* = CLangCodeExpander::ENGLISH_NAME */, bool region /*= false*/)
{
- TRACE;
+ XBMC_TRACE;
CStdString lang = CSettings::Get().GetString("locale.language");
switch (format)
String getIPAddress()
{
- TRACE;
+ XBMC_TRACE;
char cTitleIP[32];
sprintf(cTitleIP, "127.0.0.1");
CNetworkInterface* iface = g_application.getNetwork().GetFirstConnectedInterface();
long getDVDState()
{
- TRACE;
+ XBMC_TRACE;
return g_mediaManager.GetDriveStatus();
}
long getFreeMem()
{
- TRACE;
+ XBMC_TRACE;
MEMORYSTATUSEX stat;
stat.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&stat);
String getInfoLabel(const char* cLine)
{
- TRACE;
+ XBMC_TRACE;
if (!cLine)
{
String ret;
String getInfoImage(const char * infotag)
{
- TRACE;
+ XBMC_TRACE;
if (!infotag)
{
String ret;
void playSFX(const char* filename)
{
- TRACE;
+ XBMC_TRACE;
if (!filename)
return;
void enableNavSounds(bool yesNo)
{
- TRACE;
+ XBMC_TRACE;
g_audioManager.Enable(yesNo);
}
bool getCondVisibility(const char *condition)
{
- TRACE;
+ XBMC_TRACE;
if (!condition)
return false;
int getGlobalIdleTime()
{
- TRACE;
+ XBMC_TRACE;
return g_application.GlobalIdleTime();
}
String getCacheThumbName(const String& path)
{
- TRACE;
+ XBMC_TRACE;
Crc32 crc;
crc.ComputeFromLowerCase(path);
CStdString strPath;
String makeLegalFilename(const String& filename, bool fatX)
{
- TRACE;
+ XBMC_TRACE;
return CUtil::MakeLegalPath(filename);
}
String translatePath(const String& path)
{
- TRACE;
+ XBMC_TRACE;
return CSpecialProtocol::TranslatePath(path);
}
Tuple<String,String> getCleanMovieTitle(const String& path, bool usefoldername)
{
- TRACE;
+ XBMC_TRACE;
CFileItem item(path, false);
CStdString strName = item.GetMovieName(usefoldername);
String validatePath(const String& path)
{
- TRACE;
+ XBMC_TRACE;
return CUtil::ValidatePath(path, true);
}
String getRegion(const char* id)
{
- TRACE;
+ XBMC_TRACE;
CStdString result;
if (strcmpi(id, "datelong") == 0)
// TODO: Add a mediaType enum
String getSupportedMedia(const char* mediaType)
{
- TRACE;
+ XBMC_TRACE;
String result;
if (strcmpi(mediaType, "video") == 0)
result = g_advancedSettings.m_videoExtensions;
bool skinHasImage(const char* image)
{
- TRACE;
+ XBMC_TRACE;
return g_TextureManager.HasTexture(image);
}
bool startServer(int iTyp, bool bStart, bool bWait)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dg;
return g_application.StartServer((CApplication::ESERVERS)iTyp, bStart != 0, bWait != 0);
}
Monitor();
#ifndef SWIG
- inline void OnSettingsChanged() { TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onSettingsChanged)); }
- inline void OnScreensaverActivated() { TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onScreensaverActivated)); }
- inline void OnScreensaverDeactivated() { TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onScreensaverDeactivated)); }
- inline void OnDatabaseUpdated(const String &database) { TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onDatabaseUpdated,database)); }
- inline void OnDatabaseScanStarted(const String &database) { TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onDatabaseScanStarted,database)); }
- inline void OnAbortRequested() { TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onAbortRequested)); }
- inline void OnNotification(const String &sender, const String &method, const String &data) { TRACE; invokeCallback(new CallbackFunction<Monitor,const String,const String,const String>(this,&Monitor::onNotification,sender,method,data)); }
+ inline void OnSettingsChanged() { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onSettingsChanged)); }
+ inline void OnScreensaverActivated() { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onScreensaverActivated)); }
+ inline void OnScreensaverDeactivated() { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onScreensaverDeactivated)); }
+ inline void OnDatabaseUpdated(const String &database) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onDatabaseUpdated,database)); }
+ inline void OnDatabaseScanStarted(const String &database) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onDatabaseScanStarted,database)); }
+ inline void OnAbortRequested() { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onAbortRequested)); }
+ inline void OnNotification(const String &sender, const String &method, const String &data) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String,const String,const String>(this,&Monitor::onNotification,sender,method,data)); }
inline const String& GetId() { return Id; }
#endif
* \n
* Will be called when addon settings are changed\n
*/
- virtual void onSettingsChanged() { TRACE; }
+ virtual void onSettingsChanged() { XBMC_TRACE; }
/**
* onScreensaverActivated() -- onScreensaverActivated method.\n
* \n
* Will be called when screensaver kicks in\n
*/
- virtual void onScreensaverActivated() { TRACE; }
+ virtual void onScreensaverActivated() { XBMC_TRACE; }
/**
* onScreensaverDeactivated() -- onScreensaverDeactivated method.\n
* \n
* Will be called when screensaver goes off\n
*/
- virtual void onScreensaverDeactivated() { TRACE; }
+ virtual void onScreensaverDeactivated() { XBMC_TRACE; }
/**
* onDatabaseUpdated(database) -- onDatabaseUpdated method.\n
* \n
* Will be called when database gets updated and return video or music to indicate which DB has been changed\n
*/
- virtual void onDatabaseUpdated(const String database) { TRACE; }
+ virtual void onDatabaseUpdated(const String database) { XBMC_TRACE; }
/**
* onDatabaseScanStarted(database) -- onDatabaseScanStarted method.\n
*\n
* Will be called when database update starts and return video or music to indicate which DB is being updated\n
*/
- virtual void onDatabaseScanStarted(const String database) { TRACE; }
+ virtual void onDatabaseScanStarted(const String database) { XBMC_TRACE; }
/**
* onAbortRequested() -- onAbortRequested method.\n
* \n
* Will be called when XBMC requests Abort\n
*/
- virtual void onAbortRequested() { TRACE; }
+ virtual void onAbortRequested() { XBMC_TRACE; }
/**
* onNotification(sender, method, data) -- onNotification method.\n
*\n
* Will be called when XBMC receives or sends a notification\n
*/
- virtual void onNotification(const String sender, const String method, const String data) { TRACE; }
+ virtual void onNotification(const String sender, const String method, const String data) { XBMC_TRACE; }
virtual ~Monitor();
};
{
namespace xbmc
{
+ PlayParameter Player::defaultPlayParameter;
+
Player::Player(int _playerCore)
{
iPlayList = PLAYLIST_MUSIC;
void Player::play(const Alternative<String, const PlayList* > & item,
const XBMCAddon::xbmcgui::ListItem* listitem, bool windowed, int startpos)
{
- TRACE;
+ XBMC_TRACE;
- if (Alternative<String, const PlayList*>::isNullReference(item))
+ if (&item == &defaultPlayParameter)
playCurrent(windowed);
else if (item.which() == XBMCAddon::first)
playStream(item.former(), listitem, windowed);
void Player::playStream(const String& item, const xbmcgui::ListItem* plistitem, bool windowed)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dc(languageHook);
if (!item.empty())
{
void Player::playCurrent(bool windowed)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dc(languageHook);
// set fullscreen or windowed
CMediaSettings::Get().SetVideoStartWindowed(windowed);
void Player::playPlaylist(const PlayList* playlist, bool windowed, int startpos)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dc(languageHook);
if (playlist != NULL)
{
void Player::stop()
{
- TRACE;
+ XBMC_TRACE;
CApplicationMessenger::Get().MediaStop();
}
void Player::pause()
{
- TRACE;
+ XBMC_TRACE;
CApplicationMessenger::Get().MediaPause();
}
void Player::playnext()
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dc(languageHook);
// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;
void Player::playprevious()
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dc(languageHook);
// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;
void Player::playselected(int selected)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dc(languageHook);
// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;
void Player::OnPlayBackStarted()
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackStarted));
}
void Player::OnPlayBackEnded()
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackEnded));
}
void Player::OnPlayBackStopped()
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackStopped));
}
void Player::OnPlayBackPaused()
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackPaused));
}
void Player::OnPlayBackResumed()
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackResumed));
}
void Player::OnQueueNextItem()
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player>(this,&Player::onQueueNextItem));
}
void Player::OnPlayBackSpeedChanged(int speed)
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player,int>(this,&Player::onPlayBackSpeedChanged,speed));
}
void Player::OnPlayBackSeek(int time, int seekOffset)
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player,int,int>(this,&Player::onPlayBackSeek,time,seekOffset));
}
void Player::OnPlayBackSeekChapter(int chapter)
{
- TRACE;
+ XBMC_TRACE;
invokeCallback(new CallbackFunction<Player,int>(this,&Player::onPlayBackSeekChapter,chapter));
}
void Player::onPlayBackStarted()
{
- TRACE;
+ XBMC_TRACE;
}
void Player::onPlayBackEnded()
{
- TRACE;
+ XBMC_TRACE;
}
void Player::onPlayBackStopped()
{
- TRACE;
+ XBMC_TRACE;
}
void Player::onPlayBackPaused()
{
- TRACE;
+ XBMC_TRACE;
}
void Player::onPlayBackResumed()
{
- TRACE;
+ XBMC_TRACE;
}
void Player::onQueueNextItem()
{
- TRACE;
+ XBMC_TRACE;
}
void Player::onPlayBackSpeedChanged(int speed)
{
- TRACE;
+ XBMC_TRACE;
}
void Player::onPlayBackSeek(int time, int seekOffset)
{
- TRACE;
+ XBMC_TRACE;
}
void Player::onPlayBackSeekChapter(int chapter)
{
- TRACE;
+ XBMC_TRACE;
}
bool Player::isPlaying()
{
- TRACE;
+ XBMC_TRACE;
return g_application.m_pPlayer->IsPlaying();
}
bool Player::isPlayingAudio()
{
- TRACE;
+ XBMC_TRACE;
return g_application.m_pPlayer->IsPlayingAudio();
}
bool Player::isPlayingVideo()
{
- TRACE;
+ XBMC_TRACE;
return g_application.m_pPlayer->IsPlayingVideo();
}
String Player::getPlayingFile() throw (PlayerException)
{
- TRACE;
+ XBMC_TRACE;
if (!g_application.m_pPlayer->IsPlaying())
throw PlayerException("XBMC is not playing any file");
InfoTagVideo* Player::getVideoInfoTag() throw (PlayerException)
{
- TRACE;
+ XBMC_TRACE;
if (!g_application.m_pPlayer->IsPlayingVideo())
throw PlayerException("XBMC is not playing any videofile");
InfoTagMusic* Player::getMusicInfoTag() throw (PlayerException)
{
- TRACE;
+ XBMC_TRACE;
if (g_application.m_pPlayer->IsPlayingVideo() || !g_application.m_pPlayer->IsPlayingAudio())
throw PlayerException("XBMC is not playing any music file");
double Player::getTotalTime() throw (PlayerException)
{
- TRACE;
+ XBMC_TRACE;
if (!g_application.m_pPlayer->IsPlaying())
throw PlayerException("XBMC is not playing any media file");
double Player::getTime() throw (PlayerException)
{
- TRACE;
+ XBMC_TRACE;
if (!g_application.m_pPlayer->IsPlaying())
throw PlayerException("XBMC is not playing any media file");
void Player::seekTime(double pTime) throw (PlayerException)
{
- TRACE;
+ XBMC_TRACE;
if (!g_application.m_pPlayer->IsPlaying())
throw PlayerException("XBMC is not playing any media file");
void Player::setSubtitles(const char* cLine)
{
- TRACE;
+ XBMC_TRACE;
if (g_application.m_pPlayer->HasPlayer())
{
int nStream = g_application.m_pPlayer->AddSubtitle(cLine);
void Player::showSubtitles(bool bVisible)
{
- TRACE;
+ XBMC_TRACE;
if (g_application.m_pPlayer->HasPlayer())
{
CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn = bVisible != 0;
String Player::getSubtitles()
{
- TRACE;
+ XBMC_TRACE;
if (g_application.m_pPlayer->HasPlayer())
{
SPlayerSubtitleStreamInfo info;
void Player::disableSubtitles()
{
- TRACE;
+ XBMC_TRACE;
CLog::Log(LOGWARNING,"'xbmc.Player().disableSubtitles()' is deprecated and will be removed in future releases, please use 'xbmc.Player().showSubtitles(false)' instead");
if (g_application.m_pPlayer->HasPlayer())
{
void playCurrent(bool windowed = false);
public:
+#ifndef SWIG
+ static PlayParameter defaultPlayParameter;
+#endif
+
// Construct a Player proxying the given generated binding. The
// construction of a Player needs to identify whether or not any
// callbacks will be executed asynchronously or not.
* - listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})\n
* - xbmc.Player().play(url, listitem, windowed)\n
*/
- void play(const PlayParameter& item = PlayParameter::nullItem(),
+ void play(const PlayParameter& item = Player::defaultPlayParameter,
const XBMCAddon::xbmcgui::ListItem* listitem = NULL, bool windowed = false, int startpos = -1);
/**
public:
inline ProxyExistingWindowInterceptor(CGUIWindow* window) :
- cguiwindow(window) { TRACE; }
+ cguiwindow(window) { XBMC_TRACE; }
virtual CGUIWindow* get();
};
- CGUIWindow* ProxyExistingWindowInterceptor::get() { TRACE; return cguiwindow; }
+ CGUIWindow* ProxyExistingWindowInterceptor::get() { XBMC_TRACE; return cguiwindow; }
Window::Window() throw (WindowException):
isDisposed(false), window(NULL), iWindowId(-1),
iOldWindowId(0), iCurrentControlId(3000), bModal(false), m_actionEvent(true),
canPulse(true), existingWindow(false), destroyAfterDeInit(false)
{
- TRACE;
+ XBMC_TRACE;
}
/**
iOldWindowId(0), iCurrentControlId(3000), bModal(false), m_actionEvent(true),
canPulse(false), existingWindow(true), destroyAfterDeInit(false)
{
- TRACE;
+ XBMC_TRACE;
SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
if (existingWindowId == -1)
Window::~Window()
{
- TRACE;
+ XBMC_TRACE;
deallocating();
}
void Window::dispose()
{
- TRACE;
+ XBMC_TRACE;
// this is called from non-scripting-language callstacks. Don't use the delayed call guard.
CSingleLock lock(g_graphicsContext);
void Window::setWindow(InterceptorBase* _window)
{
- TRACE;
+ XBMC_TRACE;
window = _window;
iWindowId = _window->get()->GetID();
int Window::getNextAvailalbeWindowId() throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
// window id's 13000 - 13100 are reserved for python
// get first window id that is not in use
int id = WINDOW_PYTHON_START;
void Window::popActiveWindowId()
{
- TRACE;
+ XBMC_TRACE;
if (iOldWindowId != iWindowId &&
iWindowId != ACTIVE_WINDOW)
iOldWindowId = ACTIVE_WINDOW;
*/
Control* Window::GetControlById(int iControlId, CCriticalSection* gc) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
// find in window vector first!!!
// this saves us from creating a complete new control
void Window::PulseActionEvent()
{
- TRACE;
+ XBMC_TRACE;
if (canPulse)
m_actionEvent.Set();
}
bool Window::WaitForActionEvent(unsigned int milliseconds)
{
- TRACE;
+ XBMC_TRACE;
// DO NOT MAKE THIS A DELAYED CALL!!!!
bool ret = languageHook == NULL ? m_actionEvent.WaitMSec(milliseconds) : languageHook->WaitForEvent(m_actionEvent,milliseconds);
if (ret)
bool Window::OnAction(const CAction &action)
{
- TRACE;
+ XBMC_TRACE;
// do the base class window first, and the call to python after this
bool ret = ref(window)->OnAction(action);
void Window::onAction(Action* action)
{
- TRACE;
+ XBMC_TRACE;
// default onAction behavior
if(action->id == ACTION_PREVIOUS_MENU || action->id == ACTION_NAV_BACK)
close();
bool Window::OnMessage(CGUIMessage& message)
{
- TRACE;
+ XBMC_TRACE;
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_DEINIT:
return ref(window)->OnMessage(message);
}
- void Window::onControl(Control* action) { TRACE; /* do nothing by default */ }
- void Window::onClick(int controlId) { TRACE; /* do nothing by default */ }
- void Window::onDoubleClick(int controlId) { TRACE; /* do nothing by default */ }
- void Window::onFocus(int controlId) { TRACE; /* do nothing by default */ }
- void Window::onInit() { TRACE; /* do nothing by default */ }
+ void Window::onControl(Control* action) { XBMC_TRACE; /* do nothing by default */ }
+ void Window::onClick(int controlId) { XBMC_TRACE; /* do nothing by default */ }
+ void Window::onDoubleClick(int controlId) { XBMC_TRACE; /* do nothing by default */ }
+ void Window::onFocus(int controlId) { XBMC_TRACE; /* do nothing by default */ }
+ void Window::onInit() { XBMC_TRACE; /* do nothing by default */ }
void Window::show()
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dcguard(languageHook);
popActiveWindowId();
void Window::setFocus(Control* pControl) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
if(pControl == NULL)
throw WindowException("Object should be of type Control");
void Window::setFocusId(int iControlId)
{
- TRACE;
+ XBMC_TRACE;
CGUIMessage msg = CGUIMessage(GUI_MSG_SETFOCUS,iWindowId,iControlId);
g_windowManager.SendThreadMessage(msg, iWindowId);
}
Control* Window::getFocus() throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
int iControlId = ref(window)->GetFocusedControlID();
long Window::getFocusId() throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
int iControlId = ref(window)->GetFocusedControlID();
if(iControlId == -1)
void Window::removeControl(Control* pControl) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dg(languageHook);
doRemoveControl(pControl,&g_graphicsContext,true);
}
void Window::doRemoveControl(Control* pControl, CCriticalSection* gcontext, bool wait) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
// type checking, object should be of type Control
if(pControl == NULL)
throw WindowException("Object should be of type Control");
void Window::removeControls(std::vector<Control*> pControls) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dg(languageHook);
int count = 1; int size = pControls.size();
for (std::vector<Control*>::iterator iter = pControls.begin(); iter != pControls.end(); count++, iter++)
long Window::getHeight()
{
- TRACE;
+ XBMC_TRACE;
return g_graphicsContext.GetHeight();
}
long Window::getWidth()
{
- TRACE;
+ XBMC_TRACE;
return g_graphicsContext.GetWidth();
}
long Window::getResolution()
{
- TRACE;
+ XBMC_TRACE;
return (long)g_graphicsContext.GetVideoResolution();
}
void Window::setCoordinateResolution(long res) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
if (res < RES_HDTV_1080i || res > RES_AUTORES)
throw WindowException("Invalid resolution.");
void Window::setProperty(const char* key, const String& value)
{
- TRACE;
+ XBMC_TRACE;
SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
CStdString lowerKey = key;
String Window::getProperty(const char* key)
{
- TRACE;
+ XBMC_TRACE;
SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
CStdString lowerKey = key;
std::string value = ref(window)->GetProperty(lowerKey.ToLower()).asString();
void Window::clearProperty(const char* key)
{
- TRACE;
+ XBMC_TRACE;
if (!key) return;
SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
void Window::clearProperties()
{
- TRACE;
+ XBMC_TRACE;
SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
ref(window)->ClearProperties();
}
void Window::close()
{
- TRACE;
+ XBMC_TRACE;
bModal = false;
if (!existingWindow)
void Window::doModal()
{
- TRACE;
+ XBMC_TRACE;
if (!existingWindow)
{
bModal = true;
void Window::addControl(Control* pControl) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dg(languageHook);
doAddControl(pControl,&g_graphicsContext,true);
}
void Window::doAddControl(Control* pControl, CCriticalSection* gcontext, bool wait) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
if(pControl == NULL)
throw WindowException("NULL Control passed to WindowBase::addControl");
void Window::addControls(std::vector<Control*> pControls) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
int count = 1; int size = pControls.size();
for (std::vector<Control*>::iterator iter = pControls.begin(); iter != pControls.end(); count++, iter++)
Control* Window::getControl(int iControlId) throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
DelayedCallGuard dg(languageHook);
return GetControlById(iControlId,&g_graphicsContext);
}
void Action::setFromCAction(const CAction& action)
{
- TRACE;
+ XBMC_TRACE;
id = action.GetID();
buttonCode = action.GetButtonCode();
fAmount1 = action.GetAmount(0);
/**
* getId() -- Returns the action's current id as a long or 0 if no action is mapped in the xml's.
*/
- long getId() { TRACE; return id; }
+ long getId() { XBMC_TRACE; return id; }
/**
* getButtonCode() -- Returns the button code for this action.
*/
- long getButtonCode() { TRACE; return buttonCode; }
+ long getButtonCode() { XBMC_TRACE; return buttonCode; }
/**
* getAmount1() -- Returns the first amount of force applied to the thumbstick n.
*/
- float getAmount1() { TRACE; return fAmount1; }
+ float getAmount1() { XBMC_TRACE; return fAmount1; }
/**
* getAmount2() -- Returns the second amount of force applied to the thumbstick n.
*/
- float getAmount2() { TRACE; return fAmount2; }
+ float getAmount2() { XBMC_TRACE; return fAmount2; }
};
//============================================================================
SWIGHIDDENVIRTUAL bool OnBack(int actionId);
SWIGHIDDENVIRTUAL void OnDeinitWindow(int nextWindowID);
- SWIGHIDDENVIRTUAL bool IsDialogRunning() const { TRACE; return false; };
- SWIGHIDDENVIRTUAL bool IsDialog() const { TRACE; return false; };
- SWIGHIDDENVIRTUAL bool IsModalDialog() const { TRACE; return false; };
- SWIGHIDDENVIRTUAL bool IsMediaWindow() const { TRACE; return false; };
+ SWIGHIDDENVIRTUAL bool IsDialogRunning() const { XBMC_TRACE; return false; };
+ SWIGHIDDENVIRTUAL bool IsDialog() const { XBMC_TRACE; return false; };
+ SWIGHIDDENVIRTUAL bool IsModalDialog() const { XBMC_TRACE; return false; };
+ SWIGHIDDENVIRTUAL bool IsMediaWindow() const { XBMC_TRACE; return false; };
SWIGHIDDENVIRTUAL void dispose();
// This is called from the InterceptorBase destructor to prevent further
bool WindowDialog::OnMessage(CGUIMessage& message)
{
-#ifdef ENABLE_TRACE_API
- TRACE;
+#ifdef ENABLE_XBMC_TRACE_API
+ XBMC_TRACE;
CLog::Log(LOGDEBUG,"%sNEWADDON WindowDialog::OnMessage Message %d", _tg.getSpaces(),message.GetMessage());
#endif
bool WindowDialog::OnAction(const CAction &action)
{
- TRACE;
+ XBMC_TRACE;
return WindowDialogMixin::OnAction(action) ? true : Window::OnAction(action);
}
SWIGHIDDENVIRTUAL void OnDeinitWindow(int nextWindowID);
SWIGHIDDENVIRTUAL bool IsDialogRunning() const { return WindowDialogMixin::IsDialogRunning(); }
- SWIGHIDDENVIRTUAL bool IsModalDialog() const { TRACE; return true; };
- SWIGHIDDENVIRTUAL bool IsDialog() const { TRACE; return true; };
+ SWIGHIDDENVIRTUAL bool IsModalDialog() const { XBMC_TRACE; return true; };
+ SWIGHIDDENVIRTUAL bool IsDialog() const { XBMC_TRACE; return true; };
- SWIGHIDDENVIRTUAL inline void show() { TRACE; WindowDialogMixin::show(); }
- SWIGHIDDENVIRTUAL inline void close() { TRACE; WindowDialogMixin::close(); }
+ SWIGHIDDENVIRTUAL inline void show() { XBMC_TRACE; WindowDialogMixin::show(); }
+ SWIGHIDDENVIRTUAL inline void close() { XBMC_TRACE; WindowDialogMixin::close(); }
#endif
};
}
{
void WindowDialogMixin::show()
{
- TRACE;
+ XBMC_TRACE;
ThreadMessage tMsg = {TMSG_GUI_PYTHON_DIALOG, HACK_CUSTOM_ACTION_OPENING, 0u};
tMsg.lpVoid = w->window->get();
CApplicationMessenger::Get().SendMessage(tMsg, true);
void WindowDialogMixin::close()
{
- TRACE;
+ XBMC_TRACE;
w->bModal = false;
w->PulseActionEvent();
w->iOldWindowId = 0;
}
- bool WindowDialogMixin::IsDialogRunning() const { TRACE; return w->window->isActive(); }
+ bool WindowDialogMixin::IsDialogRunning() const { XBMC_TRACE; return w->window->isActive(); }
bool WindowDialogMixin::OnAction(const CAction &action)
{
- TRACE;
+ XBMC_TRACE;
switch (action.GetID())
{
case HACK_CUSTOM_ACTION_OPENING:
Window* _window, int windowid) : P(windowid, "")
{
((classname = "Interceptor<") += specializedName) += ">";
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
XBMCAddonUtils::TraceGuard tg;
CLog::Log(LOGDEBUG, "%sNEWADDON constructing %s 0x%lx", tg.getSpaces(),classname.c_str(), (long)(((void*)this)));
#endif
const char* xmlfile) : P(windowid, xmlfile)
{
((classname = "Interceptor<") += specializedName) += ">";
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
XBMCAddonUtils::TraceGuard tg;
CLog::Log(LOGDEBUG, "%sNEWADDON constructing %s 0x%lx", tg.getSpaces(),classname.c_str(), (long)(((void*)this)));
#endif
virtual ~Interceptor()
{
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
XBMCAddonUtils::TraceGuard tg;
CLog::Log(LOGDEBUG, "%sNEWADDON LIFECYCLE destroying %s 0x%lx", tg.getSpaces(),classname.c_str(), (long)(((void*)this)));
#endif
}
virtual bool OnMessage(CGUIMessage& message)
- { TRACE; return up() ? P::OnMessage(message) : checkedb(OnMessage(message)); }
+ { XBMC_TRACE; return up() ? P::OnMessage(message) : checkedb(OnMessage(message)); }
virtual bool OnAction(const CAction &action)
- { TRACE; return up() ? P::OnAction(action) : checkedb(OnAction(action)); }
+ { XBMC_TRACE; return up() ? P::OnAction(action) : checkedb(OnAction(action)); }
// NOTE!!: This ALWAYS skips up to the CGUIWindow instance.
virtual bool OnBack(int actionId)
- { TRACE; return up() ? CGUIWindow::OnBack(actionId) : checkedb(OnBack(actionId)); }
+ { XBMC_TRACE; return up() ? CGUIWindow::OnBack(actionId) : checkedb(OnBack(actionId)); }
virtual void OnDeinitWindow(int nextWindowID)
- { TRACE; if(up()) P::OnDeinitWindow(nextWindowID); else checkedv(OnDeinitWindow(nextWindowID)); }
+ { XBMC_TRACE; if(up()) P::OnDeinitWindow(nextWindowID); else checkedv(OnDeinitWindow(nextWindowID)); }
- virtual bool IsModalDialog() const { TRACE; return checkedb(IsModalDialog()); };
+ virtual bool IsModalDialog() const { XBMC_TRACE; return checkedb(IsModalDialog()); };
- virtual bool IsDialogRunning() const { TRACE; return checkedb(IsDialogRunning()); };
- virtual bool IsDialog() const { TRACE; return checkedb(IsDialog()); };
- virtual bool IsMediaWindow() const { TRACE; return checkedb(IsMediaWindow());; };
+ virtual bool IsDialogRunning() const { XBMC_TRACE; return checkedb(IsDialogRunning()); };
+ virtual bool IsDialog() const { XBMC_TRACE; return checkedb(IsDialog()); };
+ virtual bool IsMediaWindow() const { XBMC_TRACE; return checkedb(IsMediaWindow());; };
- virtual void setActive(bool active) { TRACE; P::m_active = active; }
- virtual bool isActive() { TRACE; return P::m_active; }
+ virtual void setActive(bool active) { XBMC_TRACE; P::m_active = active; }
+ virtual bool isActive() { XBMC_TRACE; return P::m_active; }
};
template <class P /* extends CGUIWindow*/> class InterceptorDialog :
{ }
virtual void AllocResources(bool forceLoad = false)
- { TRACE; if(up()) CGUIMediaWindow::AllocResources(forceLoad); else checkedv(AllocResources(forceLoad)); }
+ { XBMC_TRACE; if(up()) CGUIMediaWindow::AllocResources(forceLoad); else checkedv(AllocResources(forceLoad)); }
virtual void FreeResources(bool forceUnLoad = false)
- { TRACE; if(up()) CGUIMediaWindow::FreeResources(forceUnLoad); else checkedv(FreeResources(forceUnLoad)); }
- virtual bool OnClick(int iItem) { TRACE; return up() ? CGUIMediaWindow::OnClick(iItem) : checkedb(OnClick(iItem)); }
+ { XBMC_TRACE; if(up()) CGUIMediaWindow::FreeResources(forceUnLoad); else checkedv(FreeResources(forceUnLoad)); }
+ virtual bool OnClick(int iItem) { XBMC_TRACE; return up() ? CGUIMediaWindow::OnClick(iItem) : checkedb(OnClick(iItem)); }
virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
- { TRACE; if(up()) CGUIMediaWindow::Process(currentTime,dirtyregions); else checkedv(Process(currentTime,dirtyregions)); }
+ { XBMC_TRACE; if(up()) CGUIMediaWindow::Process(currentTime,dirtyregions); else checkedv(Process(currentTime,dirtyregions)); }
// this is a hack to SKIP the CGUIMediaWindow
virtual bool OnAction(const CAction &action)
- { TRACE; return up() ? CGUIWindow::OnAction(action) : checkedb(OnAction(action)); }
+ { XBMC_TRACE; return up() ? CGUIWindow::OnAction(action) : checkedb(OnAction(action)); }
protected:
// CGUIWindow
virtual bool LoadXML(const CStdString &strPath, const CStdString &strPathLower)
- { TRACE; return up() ? CGUIMediaWindow::LoadXML(strPath,strPathLower) : xwin->LoadXML(strPath,strPathLower); }
+ { XBMC_TRACE; return up() ? CGUIMediaWindow::LoadXML(strPath,strPathLower) : xwin->LoadXML(strPath,strPathLower); }
// CGUIMediaWindow
virtual void GetContextButtons(int itemNumber, CContextButtons &buttons)
- { TRACE; if (up()) CGUIMediaWindow::GetContextButtons(itemNumber,buttons); else xwin->GetContextButtons(itemNumber,buttons); }
+ { XBMC_TRACE; if (up()) CGUIMediaWindow::GetContextButtons(itemNumber,buttons); else xwin->GetContextButtons(itemNumber,buttons); }
virtual bool Update(const CStdString &strPath)
- { TRACE; return up() ? CGUIMediaWindow::Update(strPath) : xwin->Update(strPath); }
- virtual void SetupShares() { TRACE; if(up()) CGUIMediaWindow::SetupShares(); else checkedv(SetupShares()); }
+ { XBMC_TRACE; return up() ? CGUIMediaWindow::Update(strPath) : xwin->Update(strPath); }
+ virtual void SetupShares() { XBMC_TRACE; if(up()) CGUIMediaWindow::SetupShares(); else checkedv(SetupShares()); }
friend class WindowXML;
friend class WindowXMLDialog;
};
- WindowXML::~WindowXML() { TRACE; deallocating(); }
+ WindowXML::~WindowXML() { XBMC_TRACE; deallocating(); }
WindowXML::WindowXML(const String& xmlFilename,
const String& scriptPath,
const String& defaultSkin,
const String& defaultRes) throw(WindowException)
{
- TRACE;
+ XBMC_TRACE;
RESOLUTION_INFO res;
CStdString strSkinPath = g_SkinInfo->GetSkinPath(xmlFilename, &res);
int WindowXML::lockingGetNextAvailalbeWindowId() throw (WindowException)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(g_graphicsContext);
return getNextAvailalbeWindowId();
}
void WindowXML::addItem(const Alternative<String, const ListItem*>& item, int position)
{
- TRACE;
+ XBMC_TRACE;
// item could be deleted if the reference count is 0.
// so I MAY need to check prior to using a Ref just in
// case this object is managed by Python. I'm not sure
void WindowXML::removeItem(int position)
{
- TRACE;
+ XBMC_TRACE;
// Tells the window to remove the item at the specified position from the FileItem vector
LOCKGUI;
A(m_vecItems)->Remove(position);
int WindowXML::getCurrentListPosition()
{
- TRACE;
+ XBMC_TRACE;
LOCKGUI;
int listPos = A(m_viewControl).GetSelectedItem();
return listPos;
void WindowXML::setCurrentListPosition(int position)
{
- TRACE;
+ XBMC_TRACE;
LOCKGUI;
A(m_viewControl).SetSelectedItem(position);
}
int WindowXML::getListSize()
{
- TRACE;
+ XBMC_TRACE;
return A(m_vecItems)->Size();
}
void WindowXML::clearList()
{
- TRACE;
+ XBMC_TRACE;
A(ClearFileItems());
A(m_viewControl).SetItems(*(A(m_vecItems)));
void WindowXML::setProperty(const String& key, const String& value)
{
- TRACE;
+ XBMC_TRACE;
A(m_vecItems)->SetProperty(key, value);
}
bool WindowXML::OnAction(const CAction &action)
{
- TRACE;
+ XBMC_TRACE;
// do the base class window first, and the call to python after this
bool ret = ref(window)->OnAction(action); // we don't currently want the mediawindow actions here
// look at the WindowXMLInterceptor onAction, it skips
bool WindowXML::OnMessage(CGUIMessage& message)
{
-#ifdef ENABLE_TRACE_API
- TRACE;
+#ifdef ENABLE_XBMC_TRACE_API
+ XBMC_TRACE;
CLog::Log(LOGDEBUG,"%sMessage id:%d",_tg.getSpaces(),(int)message.GetMessage());
#endif
void WindowXML::AllocResources(bool forceLoad /*= FALSE */)
{
- TRACE;
+ XBMC_TRACE;
CStdString tmpDir = URIUtils::GetDirectory(ref(window)->GetProperty("xmlfile").asString());
CStdString fallbackMediaPath;
URIUtils::GetParentPath(tmpDir, fallbackMediaPath);
void WindowXML::FreeResources(bool forceUnLoad /*= FALSE */)
{
- TRACE;
+ XBMC_TRACE;
ref(window)->FreeResources(forceUnLoad);
}
void WindowXML::Process(unsigned int currentTime, CDirtyRegionList ®ions)
{
- TRACE;
+ XBMC_TRACE;
g_TextureManager.AddTexturePath(m_mediaDir);
ref(window)->Process(currentTime, regions);
g_TextureManager.RemoveTexturePath(m_mediaDir);
bool WindowXML::OnClick(int iItem)
{
- TRACE;
+ XBMC_TRACE;
// Hook Over calling CGUIMediaWindow::OnClick(iItem) results in it trying to PLAY the file item
// which if its not media is BAD and 99 out of 100 times undesireable.
return false;
bool WindowXML::OnDoubleClick(int iItem)
{
- TRACE;
+ XBMC_TRACE;
return false;
}
void WindowXML::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
- TRACE;
+ XBMC_TRACE;
// maybe on day we can make an easy way to do this context menu
// with out this method overriding the MediaWindow version, it will display 'Add to Favorites'
}
bool WindowXML::LoadXML(const String &strPath, const String &strLowerPath)
{
- TRACE;
+ XBMC_TRACE;
// load our window
XFILE::CFile file;
if (!file.Open(strPath) && !file.Open(CStdString(strPath).ToLower()) && !file.Open(strLowerPath))
void WindowXML::SetupShares()
{
- TRACE;
+ XBMC_TRACE;
A(UpdateButtons());
}
bool WindowXML::Update(const String &strPath)
{
- TRACE;
+ XBMC_TRACE;
return true;
}
const String& defaultRes) throw(WindowException) :
WindowXML(xmlFilename, scriptPath, defaultSkin, defaultRes),
WindowDialogMixin(this)
- { TRACE; }
+ { XBMC_TRACE; }
- WindowXMLDialog::~WindowXMLDialog() { TRACE; deallocating(); }
+ WindowXMLDialog::~WindowXMLDialog() { XBMC_TRACE; deallocating(); }
bool WindowXMLDialog::OnMessage(CGUIMessage &message)
{
- TRACE;
+ XBMC_TRACE;
if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT)
{
CGUIWindow *pWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow());
bool WindowXMLDialog::OnAction(const CAction &action)
{
- TRACE;
+ XBMC_TRACE;
return WindowDialogMixin::OnAction(action) ? true : WindowXML::OnAction(action);
}
void WindowXMLDialog::OnDeinitWindow(int nextWindowID)
{
- TRACE;
+ XBMC_TRACE;
g_windowManager.RemoveDialog(interceptor->GetID());
WindowXML::OnDeinitWindow(nextWindowID);
}
SWIGHIDDENVIRTUAL bool OnDoubleClick(int iItem);
SWIGHIDDENVIRTUAL void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
- SWIGHIDDENVIRTUAL bool IsMediaWindow() const { TRACE; return true; };
+ SWIGHIDDENVIRTUAL bool IsMediaWindow() const { XBMC_TRACE; return true; };
// This method is identical to the Window::OnDeinitWindow method
// except it passes the message on to their respective parents.
#ifndef SWIG
SWIGHIDDENVIRTUAL bool OnMessage(CGUIMessage &message);
- SWIGHIDDENVIRTUAL bool IsDialogRunning() const { TRACE; return WindowDialogMixin::IsDialogRunning(); }
- SWIGHIDDENVIRTUAL bool IsDialog() const { TRACE; return true;};
- SWIGHIDDENVIRTUAL bool IsModalDialog() const { TRACE; return true; };
- SWIGHIDDENVIRTUAL bool IsMediaWindow() const { TRACE; return false; };
+ SWIGHIDDENVIRTUAL bool IsDialogRunning() const { XBMC_TRACE; return WindowDialogMixin::IsDialogRunning(); }
+ SWIGHIDDENVIRTUAL bool IsDialog() const { XBMC_TRACE; return true;};
+ SWIGHIDDENVIRTUAL bool IsModalDialog() const { XBMC_TRACE; return true; };
+ SWIGHIDDENVIRTUAL bool IsMediaWindow() const { XBMC_TRACE; return false; };
SWIGHIDDENVIRTUAL bool OnAction(const CAction &action);
SWIGHIDDENVIRTUAL void OnDeinitWindow(int nextWindowID);
- SWIGHIDDENVIRTUAL inline void show() { TRACE; WindowDialogMixin::show(); }
- SWIGHIDDENVIRTUAL inline void close() { TRACE; WindowDialogMixin::close(); }
+ SWIGHIDDENVIRTUAL inline void show() { XBMC_TRACE; WindowDialogMixin::show(); }
+ SWIGHIDDENVIRTUAL inline void close() { XBMC_TRACE; WindowDialogMixin::close(); }
friend class DialogJumper;
#endif
*/
PythonCallbackHandler::PythonCallbackHandler()
{
- TRACE;
+ XBMC_TRACE;
objectThreadState = PyThreadState_Get();
}
*/
bool PythonCallbackHandler::isStateOk(AddonClass* obj)
{
- TRACE;
+ XBMC_TRACE;
PyThreadState* state = PyThreadState_Get();
if (objectThreadState == state)
{
*/
bool PythonCallbackHandler::shouldRemoveCallback(AddonClass* obj, void* threadState)
{
- TRACE;
+ XBMC_TRACE;
if (threadState == objectThreadState)
return true;
// vtab instantiation
PythonLanguageHook::~PythonLanguageHook()
{
- TRACE;
+ XBMC_TRACE;
XBMCAddon::LanguageHook::deallocating();
}
void PythonLanguageHook::MakePendingCalls()
{
- TRACE;
+ XBMC_TRACE;
PythonCallbackHandler::makePendingCalls();
}
void PythonLanguageHook::DelayedCallOpen()
{
- TRACE;
+ XBMC_TRACE;
PyGILLock::releaseGil();
}
void PythonLanguageHook::DelayedCallClose()
{
- TRACE;
+ XBMC_TRACE;
PyGILLock::acquireGil();
}
void PythonLanguageHook::RegisterMe()
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(hooksMutex);
hooks[m_interp] = AddonClass::Ref<PythonLanguageHook>(this);
}
void PythonLanguageHook::UnregisterMe()
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(hooksMutex);
hooks.erase(m_interp);
}
// cases like this we're going to use a global interpreter
AddonClass::Ref<PythonLanguageHook> PythonLanguageHook::GetIfExists(PyInterpreterState* interp)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(hooksMutex);
std::map<PyInterpreterState*,AddonClass::Ref<PythonLanguageHook> >::iterator iter = hooks.find(interp);
if (iter != hooks.end())
*/
XBMCAddon::CallbackHandler* PythonLanguageHook::GetCallbackHandler()
{
- TRACE;
+ XBMC_TRACE;
return new PythonCallbackHandler();
}
String PythonLanguageHook::GetAddonId()
{
- TRACE;
+ XBMC_TRACE;
const char* id = NULL;
// Get a reference to the main module
String PythonLanguageHook::GetAddonVersion()
{
- TRACE;
+ XBMC_TRACE;
// Get a reference to the main module
// and global dictionary
PyObject* main_module = PyImport_AddModule((char*)"__main__");
return version;
}
- void PythonLanguageHook::RegisterPlayerCallback(IPlayerCallback* player) { TRACE; g_pythonParser.RegisterPythonPlayerCallBack(player); }
- void PythonLanguageHook::UnregisterPlayerCallback(IPlayerCallback* player) { TRACE; g_pythonParser.UnregisterPythonPlayerCallBack(player); }
- void PythonLanguageHook::RegisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { TRACE; g_pythonParser.RegisterPythonMonitorCallBack(monitor); }
- void PythonLanguageHook::UnregisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { TRACE; g_pythonParser.UnregisterPythonMonitorCallBack(monitor); }
+ void PythonLanguageHook::RegisterPlayerCallback(IPlayerCallback* player) { XBMC_TRACE; g_pythonParser.RegisterPythonPlayerCallBack(player); }
+ void PythonLanguageHook::UnregisterPlayerCallback(IPlayerCallback* player) { XBMC_TRACE; g_pythonParser.UnregisterPythonPlayerCallBack(player); }
+ void PythonLanguageHook::RegisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { XBMC_TRACE; g_pythonParser.RegisterPythonMonitorCallBack(monitor); }
+ void PythonLanguageHook::UnregisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { XBMC_TRACE; g_pythonParser.UnregisterPythonMonitorCallBack(monitor); }
bool PythonLanguageHook::WaitForEvent(CEvent& hEvent, unsigned int milliseconds)
{
- TRACE;
+ XBMC_TRACE;
return g_pythonParser.WaitForEvent(hEvent,milliseconds);
}
void PythonLanguageHook::RegisterAddonClassInstance(AddonClass* obj)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock l(*this);
obj->Acquire();
currentObjects.insert(obj);
void PythonLanguageHook::UnregisterAddonClassInstance(AddonClass* obj)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock l(*this);
if (currentObjects.erase(obj) > 0)
obj->Release();
bool PythonLanguageHook::HasRegisteredAddonClassInstance(AddonClass* obj)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock l(*this);
return currentObjects.find(obj) != currentObjects.end();
}
// Time before ill-behaved scripts are terminated
#define PYTHON_SCRIPT_TIMEOUT 5000 // ms
-#define THREAD_STOP_TIMEOUT_MILLIS 5000
-
using namespace std;
using namespace XFILE;
}
bool systemExitThrown = false;
+ InvokerState stateToSet;
if (!failed && !PyErr_Occurred())
{
CLog::Log(LOGINFO, "CPythonInvoker(%d, %s): script successfully run", GetId(), m_source);
- setState(InvokerStateDone);
+ stateToSet = InvokerStateDone;
onSuccess();
}
else if (PyErr_ExceptionMatches(PyExc_SystemExit))
{
systemExitThrown = true;
CLog::Log(LOGINFO, "CPythonInvoker(%d, %s): script aborted", GetId(), m_source);
- setState(InvokerStateFailed);
+ stateToSet = InvokerStateFailed;
onAbort();
}
else
{
- setState(InvokerStateFailed);
+ stateToSet = InvokerStateFailed;
// if it failed with an exception we already logged the details
if (!failed)
// no need to do anything else because the script has already stopped
if (failed)
+ {
+ setState(stateToSet);
return true;
+ }
PyObject *m = PyImport_AddModule((char*)"xbmc");
if (m == NULL || PyObject_SetAttrString(m, (char*)"abortRequested", PyBool_FromLong(1)))
CLog::Log(LOGERROR, "CPythonInvoker(%d, %s): failed to set abortRequested", GetId(), m_source);
// make sure all sub threads have finished
- XbmcThreads::EndTime waitTime(THREAD_STOP_TIMEOUT_MILLIS); // we will wait THREAD_STOP_TIMEOUT_MILLIS for any given thread to end
for (PyThreadState* s = state->interp->tstate_head, *old = NULL; s;)
{
if (s == state)
if (old != s)
{
CLog::Log(LOGINFO, "CPythonInvoker(%d, %s): waiting on thread %"PRIu64, GetId(), m_source, (uint64_t)s->thread_id);
- waitTime.Set(THREAD_STOP_TIMEOUT_MILLIS); // reset the wait time
old = s;
}
Sleep(100);
pyState.Restore();
- if (waitTime.IsTimePast())
- {
- // let's kick this and see if it helps
- // Raise a SystemExit exception in python threads
- Py_XDECREF(s->async_exc);
- s->async_exc = PyExc_SystemExit;
- Py_XINCREF(s->async_exc);
- }
-
s = state->interp->tstate_head;
}
PyEval_ReleaseLock();
+ setState(stateToSet);
+
return true;
}
void CPythonInvoker::onInitialization()
{
- TRACE;
+ XBMC_TRACE;
{
GilSafeSingleLock lock(s_critical);
initializeModules(getModules());
void CPythonInvoker::onDeinitialization()
{
- TRACE;
+ XBMC_TRACE;
}
void CPythonInvoker::onError()
if (doAsMappingIndex) { %>, PyObject* py${params[0].@name}<% }
else if (methodType != MethodType.destructor) { %> , PyObject *args, PyObject *kwds <%} %> )
{
- TRACE;
+ XBMC_TRACE;
<% if (numParams > 0)
{
if (useKeywordParsing && !doAsMappingIndex)
XBPython::~XBPython()
{
- TRACE;
+ XBMC_TRACE;
CAnnouncementManager::RemoveAnnouncer(this);
}
// message all registered callbacks that we started playing
void XBPython::OnPlayBackStarted()
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
// message all registered callbacks that we paused playing
void XBPython::OnPlayBackPaused()
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
// message all registered callbacks that we resumed playing
void XBPython::OnPlayBackResumed()
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
// message all registered callbacks that xbmc stopped playing
void XBPython::OnPlayBackEnded()
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
// message all registered callbacks that user stopped playing
void XBPython::OnPlayBackStopped()
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
// message all registered callbacks that playback speed changed (FF/RW)
void XBPython::OnPlayBackSpeedChanged(int iSpeed)
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
// message all registered callbacks that player is seeking
void XBPython::OnPlayBackSeek(int iTime, int seekOffset)
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
// message all registered callbacks that player chapter seeked
void XBPython::OnPlayBackSeekChapter(int iChapter)
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
// message all registered callbacks that next item has been queued
void XBPython::OnQueueNextItem()
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
void XBPython::RegisterPythonPlayerCallBack(IPlayerCallback* pCallback)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(m_vecPlayerCallbackList);
m_vecPlayerCallbackList.push_back(pCallback);
}
void XBPython::UnregisterPythonPlayerCallBack(IPlayerCallback* pCallback)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(m_vecPlayerCallbackList);
PlayerCallbackList::iterator it = m_vecPlayerCallbackList.begin();
while (it != m_vecPlayerCallbackList.end())
void XBPython::RegisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallback)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(m_vecMonitorCallbackList);
m_vecMonitorCallbackList.push_back(pCallback);
}
void XBPython::UnregisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallback)
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(m_vecMonitorCallbackList);
MonitorCallbackList::iterator it = m_vecMonitorCallbackList.begin();
while (it != m_vecMonitorCallbackList.end())
void XBPython::OnSettingsChanged(const CStdString &ID)
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
void XBPython::OnScreensaverActivated()
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
void XBPython::OnScreensaverDeactivated()
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
void XBPython::OnDatabaseUpdated(const std::string &database)
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
void XBPython::OnDatabaseScanStarted(const std::string &database)
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
void XBPython::OnAbortRequested(const CStdString &ID)
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
void XBPython::OnNotification(const std::string &sender, const std::string &method, const std::string &data)
{
- TRACE;
+ XBMC_TRACE;
LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
{
*/
bool XBPython::InitializeEngine()
{
- TRACE;
+ XBMC_TRACE;
CLog::Log(LOGINFO, "initializing python engine.");
CSingleLock lock(m_critSection);
m_iDllScriptCounter++;
*/
void XBPython::FinalizeScript()
{
- TRACE;
+ XBMC_TRACE;
CSingleLock lock(m_critSection);
// for linux - we never release the library. its loaded and stays in memory.
if (m_iDllScriptCounter)
// Always called with the lock held on m_critSection
void XBPython::Finalize()
{
- TRACE;
+ XBMC_TRACE;
if (m_bInitialized)
{
CLog::Log(LOGINFO, "Python, unloading python shared library because no scripts are running anymore");
*/
void prepareForReturn(XBMCAddon::AddonClass* c)
{
- TRACE;
+ XBMC_TRACE;
if(c) {
c->Acquire();
PyThreadState* state = PyThreadState_Get();
static bool handleInterpRegistrationForClean(XBMCAddon::AddonClass* c)
{
- TRACE;
+ XBMC_TRACE;
if(c){
XBMCAddon::AddonClass::Ref<XBMCAddon::Python::PythonLanguageHook> lh =
XBMCAddon::AddonClass::Ref<XBMCAddon::AddonClass>(c->GetLanguageHook());
*/
void cleanForDealloc(XBMCAddon::AddonClass* c)
{
- TRACE;
+ XBMC_TRACE;
if (handleInterpRegistrationForClean(c))
c->Release();
}
*/
void cleanForDealloc(XBMCAddon::xbmcgui::Window* c)
{
- TRACE;
+ XBMC_TRACE;
if (handleInterpRegistrationForClean(c))
{
c->dispose();
static inline int compare(PyObject* obj1, PyObject* obj2, const char* swigType, const char* methodNamespacePrefix, const char* methodNameForErrorString)
throw(XBMCAddon::WrongTypeException)
{
- TRACE;
+ XBMC_TRACE;
try
{
T* o1 = (T*)retrieveApiInstance(obj1, swigType, methodNamespacePrefix, methodNameForErrorString);
// This is such a damn hack it makes me nauseous
%feature("python:rcmp") XBMCAddon::xbmcgui::Action
- { TRACE;
+ { XBMC_TRACE;
if (method == Py_EQ)
{
XBMCAddon::xbmcgui::Action* a1 = (Action*)retrieveApiInstance(obj1,&TyXBMCAddon_xbmcgui_Action_Type,"rcmp","XBMCAddon::xbmcgui::Action");
if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &needed, NULL, 0) == 0)
{
- if (buf = (char*)malloc(needed))
+ buf = (char*)malloc(needed);
+ if (buf)
{
if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &needed, NULL, 0) == 0)
{
#include "utils/TimeUtils.h"
#include "threads/SingleLock.h"
#include "log.h"
+#include "utils/FileUtils.h"
#define RSS_COLOR_BODY 0
#define RSS_COLOR_HEADLINE 1
if (url.GetProtocol() != "http" && url.GetProtocol() != "https")
{
- CFile file;
- if (file.Open(strUrl))
+ void* bufferPtr;
+ const unsigned int fsize = CFileUtils::LoadFile(strUrl, bufferPtr);
+ if (fsize != 0)
{
- char *yo = new char[(int)file.GetLength() + 1];
- file.Read(yo, file.GetLength());
- yo[file.GetLength()] = '\0';
- strXML = yo;
- delete[] yo;
+ strXML.assign((const char*)bufferPtr, fsize);
+ free(bufferPtr);
break;
}
}
XFILE::CFile file;
if (file.Open(strCachePath))
{
- char* temp = new char[(int)file.GetLength()];
- file.Read(temp,file.GetLength());
- strHTML.clear();
- strHTML.append(temp,temp+file.GetLength());
+ size_t flen = file.GetLength();
+ char* temp = new char[flen];
+ strHTML.assign(temp, file.Read(temp, flen));
file.Close();
delete[] temp;
return true;
{
// Iterate backwards over strFileName untill we hit a '.' or a mismatch
for (CStdString::const_reverse_iterator itFileName = strFileName.rbegin();
- itFileName != strFileName.rend(), itExtensions != strExtensions.rend(),
+ itFileName != strFileName.rend() && itExtensions != strExtensions.rend() &&
tolower(*itFileName) == *itExtensions;
++itFileName, ++itExtensions)
{
virtual void Unregister(IDispResource *resource);
virtual int GetNumScreens();
+ virtual int GetCurrentScreen();
+
+ void WindowChangedScreen();
void CheckDisplayChanging(u_int32_t flags);
bool m_use_system_screensaver;
bool m_can_display_switch;
+ bool m_movedToOtherScreen;
+ int m_lastDisplayNr;
void *m_windowDidMove;
void *m_windowDidReSize;
+ void *m_windowChangedScreen;
CCriticalSection m_resourceSection;
std::vector<IDispResource*> m_resources;
*/
}
@end
+
+//------------------------------------------------------------------------------------------
+// special object-c class for handling the NSWindowDidChangeScreenNotification callback.
+@interface windowDidChangeScreenNoteClass : NSObject
+{
+ void *m_userdata;
+}
++ initWith: (void*) userdata;
+- (void) windowDidChangeScreenNotification:(NSNotification*) note;
+@end
+@implementation windowDidChangeScreenNoteClass
++ initWith: (void*) userdata;
+{
+ windowDidChangeScreenNoteClass *windowDidChangeScreen = [windowDidChangeScreenNoteClass new];
+ windowDidChangeScreen->m_userdata = userdata;
+ return [windowDidChangeScreen autorelease];
+}
+- (void) windowDidChangeScreenNotification:(NSNotification*) note;
+{
+ CWinSystemOSX *winsys = (CWinSystemOSX*)m_userdata;
+ if (!winsys)
+ return;
+ winsys->WindowChangedScreen();
+}
+@end
//------------------------------------------------------------------------------------------
m_use_system_screensaver = true;
// check runtime, we only allow this on 10.5+
m_can_display_switch = (floor(NSAppKitVersionNumber) >= 949);
+ m_lastDisplayNr = -1;
+ m_movedToOtherScreen = false;
}
CWinSystemOSX::~CWinSystemOSX()
name:NSWindowDidResizeNotification object:nil];
m_windowDidReSize = windowDidReSize;
+ windowDidChangeScreenNoteClass *windowDidChangeScreen;
+ windowDidChangeScreen = [windowDidChangeScreenNoteClass initWith: this];
+ [center addObserver:windowDidChangeScreen
+ selector:@selector(windowDidChangeScreenNotification:)
+ name:NSWindowDidChangeScreenNotification object:nil];
+ m_windowChangedScreen = windowDidChangeScreen;
+
return true;
}
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center removeObserver:(windowDidMoveNoteClass*)m_windowDidMove name:NSWindowDidMoveNotification object:nil];
[center removeObserver:(windowDidReSizeNoteClass*)m_windowDidReSize name:NSWindowDidResizeNotification object:nil];
+ [center removeObserver:(windowDidChangeScreenNoteClass*)m_windowChangedScreen name:NSWindowDidChangeScreenNotification object:nil];
if (m_can_display_switch)
CGDisplayRemoveReconfigurationCallback(DisplayReconfigured, (void*)this);
static NSPoint last_view_origin;
static NSInteger last_window_level = NSNormalWindowLevel;
bool was_fullscreen = m_bFullScreen;
- static int lastDisplayNr = res.iScreen;
NSOpenGLContext* cur_context;
+
+ if (m_lastDisplayNr == -1)
+ m_lastDisplayNr = res.iScreen;
// Fade to black to hide resolution-switching flicker and garbage.
CGDisplayFadeReservationToken fade_token = DisplayFadeToBlack(needtoshowme);
// switch videomode
SwitchToVideoMode(res.iWidth, res.iHeight, res.fRefreshRate, res.iScreen);
- lastDisplayNr = res.iScreen;
+ m_lastDisplayNr = res.iScreen;
}
}
return(numDisplays);
}
+int CWinSystemOSX::GetCurrentScreen()
+{
+ NSOpenGLContext* context = [NSOpenGLContext currentContext];
+
+ // if user hasn't moved us in windowed mode - return the
+ // last display we were fullscreened at
+ if (!m_movedToOtherScreen)
+ return m_lastDisplayNr;
+
+ // if we are here the user dragged the window to a different
+ // screen and we return the screen of the window
+ if (context)
+ {
+ NSView* view;
+
+ view = [context view];
+ if (view)
+ {
+ NSWindow* window;
+ window = [view window];
+ if (window)
+ {
+ m_movedToOtherScreen = false;
+ return GetDisplayIndex(GetDisplayIDFromScreen( [window screen] ));
+ }
+
+ }
+ }
+ return 0;
+}
+
+void CWinSystemOSX::WindowChangedScreen()
+{
+ // user has moved the window to a
+ // different screen
+ m_movedToOtherScreen = true;
+}
+
void CWinSystemOSX::CheckDisplayChanging(u_int32_t flags)
{
if (flags)