Skip to content

Commit

Permalink
fix conflicts for merging upstream/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jdembski committed Jan 2, 2014
2 parents e839b58 + 63d52ae commit 192c52d
Show file tree
Hide file tree
Showing 420 changed files with 55,577 additions and 6,831 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -33,6 +33,10 @@ missing
*.pvr
*.zip

*.idb
*.tlog
*.lastbuildstate

# Windows specific generated files
*.exp
*.lib
Expand Down
3 changes: 3 additions & 0 deletions Makefile.am
Expand Up @@ -11,16 +11,19 @@ install:
sync:
cp -f ../xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h xbmc/DVDDemuxPacket.h
cat ../addons/library.xbmc.addon/libXBMC_addon.h | sed 's/#include "..\/library.xbmc.addon\/libXBMC_addon.h"/#include "libXBMC_addon.h"/' > xbmc/libXBMC_addon.h
cat ../addons/library.xbmc.codec/libXBMC_codec.h | sed 's/#include "..\/library.xbmc.addon\/libXBMC_addon.h"/#include "libXBMC_addon.h"/' > xbmc/libXBMC_codec.h
cat ../addons/library.xbmc.gui/libXBMC_gui.h | sed 's/#include "..\/library.xbmc.addon\/libXBMC_addon.h"/#include "libXBMC_addon.h"/' > xbmc/libXBMC_gui.h
cat ../addons/library.xbmc.pvr/libXBMC_pvr.h | sed 's/#include "..\/library.xbmc.addon\/libXBMC_addon.h"/#include "libXBMC_addon.h"/' > xbmc/libXBMC_pvr.h
cp -f ../xbmc/addons/include/xbmc_addon_cpp_dll.h xbmc/xbmc_addon_cpp_dll.h
cp -f ../xbmc/addons/include/xbmc_addon_dll.h xbmc/xbmc_addon_dll.h
cp -f ../xbmc/addons/include/xbmc_addon_types.h xbmc/xbmc_addon_types.h
cp -f ../xbmc/addons/include/xbmc_codec_types.h xbmc/xbmc_codec_types.h
cp -f ../xbmc/addons/include/xbmc_epg_types.h xbmc/xbmc_epg_types.h
cp -f ../xbmc/addons/include/xbmc_pvr_dll.h xbmc/xbmc_pvr_dll.h
cp -f ../xbmc/addons/include/xbmc_pvr_types.h xbmc/xbmc_pvr_types.h
cp -f ../xbmc/addons/include/xbmc_scr_dll.h xbmc/xbmc_scr_dll.h
cp -f ../xbmc/addons/include/xbmc_scr_types.h xbmc/xbmc_scr_types.h
cp -f ../xbmc/addons/include/xbmc_stream_utils.hpp xbmc/xbmc_stream_utils.hpp
cp -f ../xbmc/addons/include/xbmc_vis_dll.h xbmc/xbmc_vis_dll.h
cp -f ../xbmc/addons/include/xbmc_vis_types.h xbmc/xbmc_vis_types.h

2 changes: 2 additions & 0 deletions README
Expand Up @@ -30,6 +30,8 @@ List of addons with dependencies:
- MythTV addon:
Build dependencies: libmysqlclient, boost (headers)
Runtime dependencies: libmysqlclient
- IPTV Simple addon:
Build dependencies: zlib

=============================
Windows
Expand Down
10 changes: 8 additions & 2 deletions addons/Makefile.am
@@ -1,5 +1,8 @@
if ADDON_MYTHTV
ADDITIONAL_SUBDIRS = pvr.mythtv.cmyth
ADDON_MYTHTV_SUBDIRS = pvr.mythtv.cmyth
endif
if ADDON_IPTVSIMPLE
ADDON_IPTVSIMPLE_SUBDIRS = pvr.iptvsimple
endif

SUBDIRS = pvr.demo \
Expand All @@ -11,7 +14,10 @@ SUBDIRS = pvr.demo \
pvr.njoy \
pvr.vuplus \
pvr.argustv \
$(ADDITIONAL_SUBDIRS)
pvr.dvblink \
pvr.wmc \
$(ADDON_MYTHTV_SUBDIRS) \
$(ADDON_IPTVSIMPLE_SUBDIRS)

clean:
-rm -f *.zip
Expand Down
2 changes: 1 addition & 1 deletion addons/Makefile.include.am
Expand Up @@ -2,7 +2,7 @@
# Makefile include for XBMC PVR add-ons
#

INCLUDES = -I. @FFMPEG_INCLUDES@ -I$(abs_top_srcdir)/xbmc -I$(abs_top_srcdir)/lib @HOST_INCLUDES@
INCLUDES = -I. -I$(abs_top_srcdir)/xbmc -I$(abs_top_srcdir)/lib @HOST_INCLUDES@
WARNINGS = -Wall -Wextra -Wno-missing-field-initializers -Woverloaded-virtual -Wno-parentheses
DEFINES = @ARCH_DEFINES@ -DUSE_DEMUX -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
AM_CXXFLAGS = -g -O2 -fPIC $(WARNINGS) $(DEFINES) @HOST_CXXFLAGS@
Expand Down
1 change: 0 additions & 1 deletion addons/pvr.argustv/Makefile.am
Expand Up @@ -26,7 +26,6 @@ libargustv_addon_la_SOURCES = src/activerecording.cpp \
src/pvrclient-argustv.cpp \
src/recording.cpp \
src/recordinggroup.cpp \
src/recordingsummary.cpp \
src/tools.cpp \
src/upcomingrecording.cpp \
src/uri.cpp \
Expand Down
4 changes: 2 additions & 2 deletions addons/pvr.argustv/addon/addon.xml.in
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.argustv"
version="1.7.165"
version="1.9.171"
name="ARGUS TV client"
provider-name="Fred Hoogduin, Marcel Groothuis">
<requires>
<c-pluff version="0.1"/>
<import addon="xbmc.pvr" version="1.7.0"/>
<import addon="xbmc.pvr" version="1.9.0"/>
</requires>
<extension
point="xbmc.pvrclient"
Expand Down
19 changes: 19 additions & 0 deletions addons/pvr.argustv/addon/changelog.txt
@@ -1,3 +1,22 @@
v1.9.171 (11-12-2013)
- removed redundant notification
v1.9.170 (28-09-2013)
- add timeshift buffer functions
v1.8.170 (23-10-2013)
- Fixes deleting of recordings (regression)
- Improves load time of recordings
v1.8.169 (28-09-2013)
- Fixes playing recordings on Windows
- Migrated all UNC share name handling to single method
v1.8.168 (12-09-2013)
- Minimum ARGUS TV version 2.1 required
- Switched to integer ID's
v1.8.167 (29-08-2013)
- Fixed Live-TV XBMC Gotham
v1.8.166 (08-06-2013)
- sync with PVR API v1.8.0
v1.7.166 (13-03-2013)
- Fixed error when adding timers with " in their title
v1.7.165 (07-03-2013)
- Bump after PVR API version bump
v1.6.165 (19-01-2013)
Expand Down
2 changes: 0 additions & 2 deletions addons/pvr.argustv/project/VS2010Express/pvr.argustv.vcxproj
Expand Up @@ -92,7 +92,6 @@
<ClCompile Include="..\..\src\pvrclient-argustv.cpp" />
<ClCompile Include="..\..\src\recording.cpp" />
<ClCompile Include="..\..\src\recordinggroup.cpp" />
<ClCompile Include="..\..\src\recordingsummary.cpp" />
<ClCompile Include="..\..\src\tools.cpp" />
<ClCompile Include="..\..\src\upcomingrecording.cpp" />
<ClCompile Include="..\..\src\uri.cpp" />
Expand All @@ -112,7 +111,6 @@
<ClInclude Include="..\..\src\pvrclient-argustv.h" />
<ClInclude Include="..\..\src\recording.h" />
<ClInclude Include="..\..\src\recordinggroup.h" />
<ClInclude Include="..\..\src\recordingsummary.h" />
<ClInclude Include="..\..\src\tools.h" />
<ClInclude Include="..\..\src\upcomingrecording.h" />
<ClInclude Include="..\..\src\uri.h" />
Expand Down
Expand Up @@ -45,9 +45,6 @@
<ClCompile Include="..\..\src\recordinggroup.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\recordingsummary.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\tools.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -101,9 +98,6 @@
<ClInclude Include="..\..\src\recordinggroup.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\recordingsummary.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\tools.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
141 changes: 19 additions & 122 deletions addons/pvr.argustv/src/argustvrpc.cpp
Expand Up @@ -31,6 +31,7 @@
#include "utils.h"
#include "argustvrpc.h"
#include "platform/threads/mutex.h"
#include "platform/util/StdString.h"

using namespace ADDON;

Expand Down Expand Up @@ -187,44 +188,6 @@ namespace ArgusTV
return retval;
}

/*
* \brief Retrieve the TV channels that are in the guide
*/
int RequestGuideChannelList()
{
Json::Value root;
int retval = E_FAILED;

retval = ArgusTVJSONRPC("ArgusTV/Guide/Channels/Television", "", root);

if(retval >= 0)
{
if( root.type() == Json::arrayValue)
{
int size = root.size();

// parse channel list
for ( int index =0; index < size; ++index )
{
std::string name = root[index]["Name"].asString();
XBMC->Log(LOG_DEBUG, "Found channel %i: %s\n", index, name.c_str());
}
return size;
}
else
{
XBMC->Log(LOG_DEBUG, "Unknown response format. Expected Json::arrayValue\n");
return -1;
}
}
else
{
XBMC->Log(LOG_DEBUG, "RequestChannelList failed. Return value: %i\n", retval);
}

return retval;
}

/*
* \brief Get the logo for a channel
* \param channelGUID GUID of the channel
Expand Down Expand Up @@ -260,7 +223,6 @@ namespace ArgusTV
char command[512];

snprintf(command, 512, "ArgusTV/Scheduler/ChannelLogo/%s/100/100/false/%d-%02d-%02d", channelGUID.c_str(),
//snprintf(command, 512, "ArgusTV/Scheduler/ChannelLogo/%s/100/100/false/2011-01-01", channelGUID.c_str(),
modificationtime->tm_year + 1900, modificationtime->tm_mon + 1, modificationtime->tm_mday);

long http_response;
Expand Down Expand Up @@ -419,25 +381,6 @@ namespace ArgusTV
return retval;
}

#if FALSE
/**
* \brief Fetch the Logo for the given channel id
* \param channel_id String containing the 4TR channel_id
* \param filename filename returned here
*/
int GetChannelLogo(const std::string& channel_id, std::string& filename)
{
char command[512];

snprintf(command, 512, "ArgusTV/Scheduler/ChannelLogo/%s/100/100/false/2011-01-01", channel_id.c_str());

filename = _tempnam(NULL, "atvico");
int retval = ArgusTVRPCToFile(command, "", filename);

return retval;
}
#endif

/*
* \brief Ping core service.
* \param requestedApiVersion The API version the client needs, pass in Constants.ArgusTVRestApiVersion.
Expand Down Expand Up @@ -762,25 +705,25 @@ namespace ArgusTV
return retval;
}

int GetRecordingsForTitleUsingPOSTData(const std::string& title, Json::Value& response)
int GetFullRecordingsForTitle(const std::string& title, Json::Value& response)
{
XBMC->Log(LOG_DEBUG, "GetRecordingsForTitleUsingPOSTData(\"%s\")", title.c_str());
std::string command = "ArgusTV/Control/GetRecordingsForProgramTitle/Television?includeNonExisting=false";
std::string arguments = "\"" + title + "\"";
XBMC->Log(LOG_DEBUG, "GetFullRecordingsForTitle(\"%s\")", title.c_str());
std::string command = "ArgusTV/Control/GetFullRecordings/Television?includeNonExisting=false";
Json::Value jsArgument;
jsArgument["ScheduleId"] = Json::nullValue;
jsArgument["ProgramTitle"] = title;
jsArgument["Category"] = Json::nullValue;
jsArgument["ChannelId"] = Json::nullValue;
Json::FastWriter writer;
std::string arguments = writer.write(jsArgument);

int retval = ArgusTV::ArgusTVJSONRPC(command, arguments, response);
if (retval < 0)
{
XBMC->Log(LOG_NOTICE, "GetRecordingsForTitleUsingPOSTData remote call failed.");
XBMC->Log(LOG_NOTICE, "GetFullRecordingsForTitle remote call failed. (%d)", retval);
}
return retval;
}

int GetRecordingsForTitle(const std::string& title, Json::Value& response)
{
XBMC->Log(LOG_DEBUG, "GetRecordingsForTitle");

return GetRecordingsForTitleUsingPOSTData(title, response);
return retval;
}

int GetRecordingById(const std::string& id, Json::Value& response)
Expand Down Expand Up @@ -1138,10 +1081,12 @@ namespace ArgusTV

time_t now = time(NULL);
std::string modifiedtime = TimeTToWCFDate(mktime(localtime(&now)));
CStdString modifiedtitle = title;
modifiedtitle.Replace("\"", "\\\"");
char arguments[1024];
snprintf( arguments, sizeof(arguments),
"{\"ChannelType\":0,\"IsActive\":true,\"IsOneTime\":true,\"KeepUntilMode\":\"%i\",\"KeepUntilValue\":\"%i\",\"LastModifiedTime\":\"%s\",\"Name\":\"%s\",\"PostRecordSeconds\":%i,\"PreRecordSeconds\":%i,\"ProcessingCommands\":[],\"RecordingFileFormatId\":null,\"Rules\":[{\"Arguments\":[\"%s\"],\"Type\":\"TitleEquals\"},{\"Arguments\":[\"%i-%02i-%02iT00:00:00\"],\"Type\":\"OnDate\"},{\"Arguments\":[\"%02i:%02i:%02i\"],\"Type\":\"AroundTime\"},{\"Arguments\":[\"%s\"],\"Type\":\"Channels\"}],\"ScheduleId\":\"00000000-0000-0000-0000-000000000000\",\"SchedulePriority\":0,\"ScheduleType\":82,\"Version\":0}",
lifetimeToKeepUntilMode(lifetime), lifetimeToKeepUntilValue(lifetime), modifiedtime.c_str(), title.c_str(), postrecordseconds, prerecordseconds, title.c_str(),
lifetimeToKeepUntilMode(lifetime), lifetimeToKeepUntilValue(lifetime), modifiedtime.c_str(), modifiedtitle.c_str(), postrecordseconds, prerecordseconds, modifiedtitle.c_str(),
tm_start.tm_year + 1900, tm_start.tm_mon + 1, tm_start.tm_mday,
tm_start.tm_hour, tm_start.tm_min, tm_start.tm_sec,
channelid.c_str());
Expand Down Expand Up @@ -1190,11 +1135,13 @@ namespace ArgusTV

time_t now = time(NULL);
std::string modifiedtime = TimeTToWCFDate(mktime(localtime(&now)));
CStdString modifiedtitle = title;
modifiedtitle.Replace("\"", "\\\"");
char arguments[1024];
snprintf( arguments, sizeof(arguments),
"{\"ChannelType\":0,\"IsActive\":true,\"IsOneTime\":true,\"KeepUntilMode\":\"%i\",\"KeepUntilValue\":\"%i\",\"LastModifiedTime\":\"%s\",\"Name\":\"%s (manual)\",\"PostRecordSeconds\":%i,\"PreRecordSeconds\":%i,\"ProcessingCommands\":[],\"RecordingFileFormatId\":null,"
"\"Rules\":[{\"Arguments\":[\"%i-%02i-%02iT%02i:%02i:%02i\", \"%02i:%02i:%02i\"],\"Type\":\"ManualSchedule\"},{\"Arguments\":[\"%s\"],\"Type\":\"Channels\"}],\"ScheduleId\":\"00000000-0000-0000-0000-000000000000\",\"SchedulePriority\":0,\"ScheduleType\":82,\"Version\":0}",
lifetimeToKeepUntilMode(lifetime), lifetimeToKeepUntilValue(lifetime), modifiedtime.c_str(), title.c_str(), postrecordseconds, prerecordseconds,
lifetimeToKeepUntilMode(lifetime), lifetimeToKeepUntilValue(lifetime), modifiedtime.c_str(), modifiedtitle.c_str(), postrecordseconds, prerecordseconds,
tm_start.tm_year + 1900, tm_start.tm_mon + 1, tm_start.tm_mday,
tm_start.tm_hour, tm_start.tm_min, tm_start.tm_sec,
duration_hrs, duration_min, duration_sec,
Expand Down Expand Up @@ -1362,56 +1309,6 @@ namespace ArgusTV
return wcfdate;
}

// transform [\\nascat\qrecordings\NCIS\2012-05-15_20-30_SBS 6_NCIS.ts]
// into [smb://user:password@nascat/qrecordings/NCIS/2012-05-15_20-30_SBS 6_NCIS.ts]
std::string ToCIFS(std::string& UNCName)
{
std::string CIFSname = UNCName;
std::string SMBPrefix = "smb://";
if (g_szUser.length() > 0)
{
SMBPrefix += g_szUser;
if (g_szPass.length() > 0)
{
SMBPrefix += ":" + g_szPass;
}
}
else
{
SMBPrefix += "Guest";
}
SMBPrefix += "@";
size_t found;
while ((found = CIFSname.find("\\")) != std::string::npos)
{
CIFSname.replace(found, 1, "/");
}
CIFSname.erase(0,2);
CIFSname.insert(0, SMBPrefix);
return CIFSname;
}


// transform [smb://user:password@nascat/qrecordings/NCIS/2012-05-15_20-30_SBS 6_NCIS.ts]
// into [\\nascat\qrecordings\NCIS\2012-05-15_20-30_SBS 6_NCIS.ts]
std::string ToUNC(std::string& CIFSName)
{
std::string UNCname = CIFSName;

UNCname.erase(0,6);
size_t found = UNCname.find("@");
if (found != std::string::npos) {
UNCname.erase(0, found+1);
}

while ((found = UNCname.find("/")) != std::string::npos)
{
UNCname.replace(found, 1, "\\");
}
UNCname.insert(0, "\\\\");
return UNCname;
}

}


Expand Down
12 changes: 5 additions & 7 deletions addons/pvr.argustv/src/argustvrpc.h
Expand Up @@ -21,9 +21,9 @@
#include <json/json.h>
#include <cstdlib>

#define ATV_2_0_1 (52)
#define ATV_REST_MINIMUM_API_VERSION ATV_2_0_1
#define ATV_REST_MAXIMUM_API_VERSION ATV_2_0_1
#define ATV_2_2_0 (60)
#define ATV_REST_MINIMUM_API_VERSION ATV_2_2_0
#define ATV_REST_MAXIMUM_API_VERSION ATV_2_2_0

#define E_SUCCESS 0
#define E_FAILED -1
Expand Down Expand Up @@ -195,11 +195,11 @@ namespace ArgusTV
int GetRecordingGroupByTitle(Json::Value& response);

/**
* \brief Fetch the data for all recordings for a given title
* \brief Fetch the detailed data for all recordings for a given title
* \param title Program title of recording
* \param response Reference to a std::string used to store the json response string
*/
int GetRecordingsForTitle(const std::string& title, Json::Value& response);
int GetFullRecordingsForTitle(const std::string& title, Json::Value& response);

/**
* \brief Fetch the detailed information of a recorded show
Expand Down Expand Up @@ -344,6 +344,4 @@ namespace ArgusTV

time_t WCFDateToTimeT(const std::string& wcfdate, int& offset);
std::string TimeTToWCFDate(const time_t thetime);
std::string ToCIFS(std::string& UNCName);
std::string ToUNC(std::string& CIFSName);
} //namespace ArgusTV

0 comments on commit 192c52d

Please sign in to comment.