Skip to content
Browse files

Merge branch 'master' into pvr-ppa

  • Loading branch information...
2 parents 0bae5c6 + 97d866a commit bee1ab56df138f695bbe60a6ada1b521992ce088 @opdenkamp committed Oct 17, 2011
View
172 addons/library.xbmc.addon/libXBMC_addon.h
@@ -52,103 +52,121 @@
#endif /* __x86_64__ */
#endif /* _LINUX */
-typedef enum addon_log {
- LOG_DEBUG,
- LOG_INFO,
- LOG_NOTICE,
- LOG_ERROR
-} addon_log_t;
-
-typedef enum queue_msg {
- QUEUE_INFO,
- QUEUE_WARNING,
- QUEUE_ERROR
-} queue_msg_t;
-
-class CHelper_libXBMC_addon
+#ifdef LOG_DEBUG
+#undef LOG_DEBUG
+#endif
+#ifdef LOG_INFO
+#undef LOG_INFO
+#endif
+#ifdef LOG_NOTICE
+#undef LOG_NOTICE
+#endif
+#ifdef LOG_ERROR
+#undef LOG_ERROR
+#endif
+
+namespace ADDON
{
-public:
- CHelper_libXBMC_addon()
+ typedef enum addon_log
{
- m_libXBMC_addon = NULL;
- m_Handle = NULL;
- }
+ LOG_DEBUG,
+ LOG_INFO,
+ LOG_NOTICE,
+ LOG_ERROR
+ } addon_log_t;
- ~CHelper_libXBMC_addon()
+ typedef enum queue_msg
{
- if (m_libXBMC_addon)
- {
- XBMC_unregister_me();
- dlclose(m_libXBMC_addon);
- }
- }
+ QUEUE_INFO,
+ QUEUE_WARNING,
+ QUEUE_ERROR
+ } queue_msg_t;
- bool RegisterMe(void *Handle)
+ class CHelper_libXBMC_addon
{
- m_Handle = Handle;
-
- std::string libBasePath;
- libBasePath = ((cb_array*)m_Handle)->libPath;
- libBasePath += ADDON_DLL;
+ public:
+ CHelper_libXBMC_addon()
+ {
+ m_libXBMC_addon = NULL;
+ m_Handle = NULL;
+ }
- m_libXBMC_addon = dlopen(libBasePath.c_str(), RTLD_LAZY);
- if (m_libXBMC_addon == NULL)
+ ~CHelper_libXBMC_addon()
{
- fprintf(stderr, "Unable to load %s\n", dlerror());
- return false;
+ if (m_libXBMC_addon)
+ {
+ XBMC_unregister_me();
+ dlclose(m_libXBMC_addon);
+ }
}
- XBMC_register_me = (int (*)(void *HANDLE))
- dlsym(m_libXBMC_addon, "XBMC_register_me");
- if (XBMC_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+ bool RegisterMe(void *Handle)
+ {
+ m_Handle = Handle;
- XBMC_unregister_me = (void (*)())
- dlsym(m_libXBMC_addon, "XBMC_unregister_me");
- if (XBMC_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+ std::string libBasePath;
+ libBasePath = ((cb_array*)m_Handle)->libPath;
+ libBasePath += ADDON_DLL;
- Log = (void (*)(const addon_log_t loglevel, const char *format, ... ))
- dlsym(m_libXBMC_addon, "XBMC_log");
- if (Log == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+ m_libXBMC_addon = dlopen(libBasePath.c_str(), RTLD_LAZY);
+ if (m_libXBMC_addon == NULL)
+ {
+ fprintf(stderr, "Unable to load %s\n", dlerror());
+ return false;
+ }
- GetSetting = (bool (*)(const char* settingName, void *settingValue))
- dlsym(m_libXBMC_addon, "XBMC_get_setting");
- if (GetSetting == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+ XBMC_register_me = (int (*)(void *HANDLE))
+ dlsym(m_libXBMC_addon, "XBMC_register_me");
+ if (XBMC_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- QueueNotification = (void (*)(const queue_msg_t loglevel, const char *format, ... ))
- dlsym(m_libXBMC_addon, "XBMC_queue_notification");
- if (QueueNotification == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+ XBMC_unregister_me = (void (*)())
+ dlsym(m_libXBMC_addon, "XBMC_unregister_me");
+ if (XBMC_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- UnknownToUTF8 = (void (*)(std::string &str))
- dlsym(m_libXBMC_addon, "XBMC_unknown_to_utf8");
- if (UnknownToUTF8 == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+ Log = (void (*)(const addon_log_t loglevel, const char *format, ... ))
+ dlsym(m_libXBMC_addon, "XBMC_log");
+ if (Log == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- GetLocalizedString = (const char* (*)(int dwCode))
- dlsym(m_libXBMC_addon, "XBMC_get_localized_string");
- if (GetLocalizedString == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+ GetSetting = (bool (*)(const char* settingName, void *settingValue))
+ dlsym(m_libXBMC_addon, "XBMC_get_setting");
+ if (GetSetting == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- GetDVDMenuLanguage = (const char* (*)())
- dlsym(m_libXBMC_addon, "XBMC_get_dvd_menu_language");
- if (GetDVDMenuLanguage == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+ QueueNotification = (void (*)(const queue_msg_t loglevel, const char *format, ... ))
+ dlsym(m_libXBMC_addon, "XBMC_queue_notification");
+ if (QueueNotification == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- return XBMC_register_me(m_Handle) > 0;
- }
+ UnknownToUTF8 = (void (*)(std::string &str))
+ dlsym(m_libXBMC_addon, "XBMC_unknown_to_utf8");
+ if (UnknownToUTF8 == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- void (*Log)(const addon_log_t loglevel, const char *format, ... );
- bool (*GetSetting)(const char* settingName, void *settingValue);
- void (*QueueNotification)(const queue_msg_t type, const char *format, ... );
- void (*UnknownToUTF8)(std::string &str);
- const char* (*GetLocalizedString)(int dwCode);
- const char* (*GetDVDMenuLanguage)();
+ GetLocalizedString = (const char* (*)(int dwCode))
+ dlsym(m_libXBMC_addon, "XBMC_get_localized_string");
+ if (GetLocalizedString == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
-protected:
- int (*XBMC_register_me)(void *HANDLE);
- void (*XBMC_unregister_me)();
+ GetDVDMenuLanguage = (const char* (*)())
+ dlsym(m_libXBMC_addon, "XBMC_get_dvd_menu_language");
+ if (GetDVDMenuLanguage == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
-private:
- void *m_libXBMC_addon;
- void *m_Handle;
- struct cb_array
- {
- const char* libPath;
+ return XBMC_register_me(m_Handle) > 0;
+ }
+
+ void (*Log)(const addon_log_t loglevel, const char *format, ... );
+ bool (*GetSetting)(const char* settingName, void *settingValue);
+ void (*QueueNotification)(const queue_msg_t type, const char *format, ... );
+ void (*UnknownToUTF8)(std::string &str);
+ const char* (*GetLocalizedString)(int dwCode);
+ const char* (*GetDVDMenuLanguage)();
+
+ protected:
+ int (*XBMC_register_me)(void *HANDLE);
+ void (*XBMC_unregister_me)();
+
+ private:
+ void *m_libXBMC_addon;
+ void *m_Handle;
+ struct cb_array
+ {
+ const char* libPath;
+ };
};
};
View
1 lib/addons/library.xbmc.addon/libXBMC_addon.cpp
@@ -35,6 +35,7 @@
using namespace std;
+using namespace ADDON;
AddonCB *m_Handle = NULL;
CB_AddOnLib *m_cb = NULL;
View
4 xbmc/addons/AddonCallbacks.h
@@ -25,8 +25,8 @@
#include "../../addons/library.xbmc.addon/libXBMC_addon.h"
#include "../../addons/library.xbmc.gui/libXBMC_gui.h"
-typedef void (*AddOnLogCallback)(void *addonData, const addon_log_t loglevel, const char *msg);
-typedef void (*AddOnQueueNotification)(void *addonData, const queue_msg_t type, const char *msg);
+typedef void (*AddOnLogCallback)(void *addonData, const ADDON::addon_log_t loglevel, const char *msg);
+typedef void (*AddOnQueueNotification)(void *addonData, const ADDON::queue_msg_t type, const char *msg);
typedef bool (*AddOnGetSetting)(void *addonData, const char *settingName, void *settingValue);
typedef char* (*AddOnUnknownToUTF8)(const char *sourceDest);
typedef const char* (*AddOnGetLocalizedString)(const void* addonData, long dwCode);
View
2 xbmc/pvr/windows/GUIWindowPVRGuide.cpp
@@ -397,7 +397,7 @@ bool CGUIWindowPVRGuide::PlayEpgItem(CFileItem *item)
if (!channel)
return false;
- CLog::Log(LOG_DEBUG, "play channel '%s'", channel->ChannelName().c_str());
+ CLog::Log(LOGDEBUG, "play channel '%s'", channel->ChannelName().c_str());
bool bReturn = g_application.PlayFile(CFileItem(*channel));
if (!bReturn)
CGUIDialogOK::ShowAndGetInput(19033,0,19035,0);
View
1 xbmc/pvrclients/MediaPortal/Socket.cpp
@@ -26,6 +26,7 @@ extern "C" {
#include <string>
using namespace std;
+using namespace ADDON;
namespace MPTV
{
View
1 xbmc/pvrclients/MediaPortal/client.cpp
@@ -23,6 +23,7 @@
#include "utils.h"
using namespace std;
+using namespace ADDON;
/* User adjustable settings are saved here.
* Default values are defined inside client.h
View
2 xbmc/pvrclients/MediaPortal/client.h
@@ -63,7 +63,7 @@ extern std::string g_szRecordingsDir;
extern std::string g_szTVGroup;
extern std::string g_szRadioGroup;
-extern CHelper_libXBMC_addon *XBMC;
+extern ADDON::CHelper_libXBMC_addon *XBMC;
extern CHelper_libXBMC_pvr *PVR;
extern int g_iTVServerXBMCBuild;
View
2 xbmc/pvrclients/MediaPortal/epg.cpp
@@ -27,6 +27,8 @@ using namespace std;
#include "utils.h"
#include "client.h"
+using namespace ADDON;
+
cEpg::cEpg()
{
m_genremap = NULL;
View
1 xbmc/pvrclients/MediaPortal/pvrclient-mediaportal.cpp
@@ -34,6 +34,7 @@
#include "lib/tinyxml/tinyxml.h"
using namespace std;
+using namespace ADDON;
/* Globals */
int g_iTVServerXBMCBuild = 0;
View
2 xbmc/pvrclients/MediaPortal/recordings.cpp
@@ -27,6 +27,8 @@ using namespace std;
#include "timers.h"
#include "client.h"
+using namespace ADDON;
+
cRecording::cRecording()
{
m_StartTime = 0;
View
2 xbmc/pvrclients/MediaPortal/timers.cpp
@@ -28,6 +28,8 @@ using namespace std;
#include "timers.h"
#include "utils.h"
+using namespace ADDON;
+
cTimer::cTimer()
{
m_index = -1;
View
1 xbmc/pvrclients/mythtv/client.cpp
@@ -24,6 +24,7 @@
#include "MythXml.h"
using namespace std;
+using namespace ADDON;
#define SEEK_POSSIBLE 0x10 // flag used to check if protocol allows seeks
View
2 xbmc/pvrclients/mythtv/client.h
@@ -42,7 +42,7 @@ extern CStdString g_szHostname; ///< The Host name or IP of the mythtv
extern int g_iMythXmlPort; ///< The MYTHXML Port (default is 6544)
extern int g_iPin; ///< The Mythtv server PIN (default is 0000)
-extern CHelper_libXBMC_addon *XBMC;
+extern ADDON::CHelper_libXBMC_addon *XBMC;
extern CHelper_libXBMC_pvr *PVR;
#endif /* CLIENT_H */
View
1 xbmc/pvrclients/tvheadend/HTSPConnection.cpp
@@ -30,6 +30,7 @@ extern "C" {
}
using namespace std;
+using namespace ADDON;
CHTSPConnection::CHTSPConnection() :
m_fd(INVALID_SOCKET),
View
2 xbmc/pvrclients/tvheadend/HTSPData.cpp
@@ -37,6 +37,8 @@ typedef enum {
#define CMD_LOCK cMutexLock CmdLock((cMutex*)&m_Mutex)
+using namespace ADDON;
+
CHTSPData::CHTSPData()
{
m_session = new CHTSPConnection();
View
2 xbmc/pvrclients/tvheadend/HTSPDemux.cpp
@@ -31,6 +31,8 @@ extern "C" {
#include "libhts/sha1.h"
}
+using namespace ADDON;
+
CHTSPDemux::CHTSPDemux() :
m_bGotFirstIframe(false),
m_bIsRadio(false),
View
1 xbmc/pvrclients/tvheadend/client.cpp
@@ -25,6 +25,7 @@
#include "HTSPDemux.h"
using namespace std;
+using namespace ADDON;
bool m_bCreated = false;
ADDON_STATUS m_CurStatus = ADDON_STATUS_UNKNOWN;
View
2 xbmc/pvrclients/tvheadend/client.h
@@ -42,5 +42,5 @@ extern unsigned int g_iPacketSequence;
extern bool g_bShowTimerNotifications;
extern std::string g_szUserPath;
extern std::string g_szClientPath;
-extern CHelper_libXBMC_addon * XBMC;
+extern ADDON::CHelper_libXBMC_addon * XBMC;
extern CHelper_libXBMC_pvr * PVR;
View
2 xbmc/pvrclients/tvheadend/thread.cpp
@@ -36,6 +36,8 @@
#include <stdarg.h>
#include <stdlib.h>
+using namespace ADDON;
+
static bool GetAbsTime(struct timespec *Abstime, int MillisecondsFromNow)
{
struct timeval now;
View
2 xbmc/pvrclients/tvheadend/tools.cpp
@@ -26,6 +26,8 @@
#include "tools.h"
#include "libPlatform/os-dependent.h"
+using namespace ADDON;
+
// --- cTimeMs ---------------------------------------------------------------
cTimeMs::cTimeMs(int Ms)
View
2 xbmc/pvrclients/vdr-vnsi/VNSIChannelScan.cpp
@@ -58,6 +58,8 @@ extern "C" {
#define PROGRESS_SIGNAL 35
#define LABEL_STATUS 36
+using namespace ADDON;
+
cVNSIChannelScan::cVNSIChannelScan()
{
}
View
10 xbmc/pvrclients/vdr-vnsi/VNSIData.cpp
@@ -31,6 +31,8 @@ extern "C" {
#define CMD_LOCK cMutexLock CmdLock((cMutex*)&m_Mutex)
+using namespace ADDON;
+
cVNSIData::cVNSIData()
: m_aborting(false)
{
@@ -497,8 +499,8 @@ PVR_ERROR cVNSIData::AddTimer(const PVR_TIMER &timerinfo)
}
// use timer margin to calculate start/end times
- uint32_t starttime = timerinfo.startTime - timerinfo.iMarginStart;
- uint32_t endtime = timerinfo.endTime + timerinfo.iMarginEnd;
+ uint32_t starttime = timerinfo.startTime - timerinfo.iMarginStart*60;
+ uint32_t endtime = timerinfo.endTime + timerinfo.iMarginEnd*60;
if (!vrp.add_U32(timerinfo.state == PVR_TIMER_STATE_SCHEDULED)) return PVR_ERROR_UNKNOWN;
if (!vrp.add_U32(timerinfo.iPriority)) return PVR_ERROR_UNKNOWN;
@@ -578,8 +580,8 @@ PVR_ERROR cVNSIData::RenameTimer(const PVR_TIMER &timerinfo, const char *newname
PVR_ERROR cVNSIData::UpdateTimer(const PVR_TIMER &timerinfo)
{
// use timer margin to calculate start/end times
- uint32_t starttime = timerinfo.startTime - timerinfo.iMarginStart;
- uint32_t endtime = timerinfo.endTime + timerinfo.iMarginEnd;
+ uint32_t starttime = timerinfo.startTime - timerinfo.iMarginStart*60;
+ uint32_t endtime = timerinfo.endTime + timerinfo.iMarginEnd*60;
cRequestPacket vrp;
if (!vrp.init(VNSI_TIMER_UPDATE)) return PVR_ERROR_UNKNOWN;
View
2 xbmc/pvrclients/vdr-vnsi/VNSIDemux.cpp
@@ -28,6 +28,8 @@
#include "requestpacket.h"
#include "vnsicommand.h"
+using namespace ADDON;
+
cVNSIDemux::cVNSIDemux()
{
m_Streams.iStreamCount = 0;
View
2 xbmc/pvrclients/vdr-vnsi/VNSIRecording.cpp
@@ -27,6 +27,8 @@
#define SEEK_POSSIBLE 0x10 // flag used to check if protocol allows seeks
+using namespace ADDON;
+
cVNSIRecording::cVNSIRecording()
{
}
View
2 xbmc/pvrclients/vdr-vnsi/VNSISession.cpp
@@ -38,6 +38,8 @@
#define SOL_TCP IPPROTO_TCP
#endif
+using namespace ADDON;
+
cVNSISession::cVNSISession()
: m_fd(INVALID_SOCKET)
, m_protocol(0)
View
1 xbmc/pvrclients/vdr-vnsi/client.cpp
@@ -31,6 +31,7 @@
#include <iostream>
using namespace std;
+using namespace ADDON;
bool m_bCreated = false;
ADDON_STATUS m_CurStatus = ADDON_STATUS_UNKNOWN;
View
2 xbmc/pvrclients/vdr-vnsi/client.h
@@ -40,6 +40,6 @@ extern int g_iPriority; ///< The Priority this client have in
extern bool g_bCharsetConv; ///< Convert VDR's incoming strings to UTF8 character set
extern bool g_bHandleMessages; ///< Send VDR's OSD status messages to XBMC OSD
-extern CHelper_libXBMC_addon *XBMC;
+extern ADDON::CHelper_libXBMC_addon *XBMC;
extern CHelper_libXBMC_gui *GUI;
extern CHelper_libXBMC_pvr *PVR;
View
2 xbmc/pvrclients/vdr-vnsi/thread.cpp
@@ -39,6 +39,8 @@
#include <stdarg.h>
#include <stdlib.h>
+using namespace ADDON;
+
static bool GetAbsTime(struct timespec *Abstime, int MillisecondsFromNow)
{
struct timeval now;

0 comments on commit bee1ab5

Please sign in to comment.
Something went wrong with that request. Please try again.