Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mediaportal pvr addon: cosmetic changes and cleanup

  • Loading branch information...
commit 284cb946e5ff710df3f3e48ec0ef66ae2a95b2f9 1 parent 46e02c5
@margro authored
View
2  xbmc/pvrclients/MediaPortal/Socket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This program is free software: you can redistribute it and/or modify
View
2  xbmc/pvrclients/MediaPortal/Socket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
View
6 xbmc/pvrclients/MediaPortal/channels.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This program is free software: you can redistribute it and/or modify
@@ -66,7 +66,9 @@ bool cChannel::Parse(const std::string& data)
}
return true;
- } else {
+ }
+ else
+ {
return false;
}
}
View
2  xbmc/pvrclients/MediaPortal/channels.h
@@ -1,6 +1,6 @@
#pragma once
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
View
3  xbmc/pvrclients/MediaPortal/client.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This program is free software: you can redistribute it and/or modify
@@ -253,6 +253,7 @@ ADDON_STATUS ADDON_GetStatus()
{
return m_CurStatus;
}
+
//-- HasSettings --------------------------------------------------------------
// Report "true", yes this AddOn have settings
//-----------------------------------------------------------------------------
View
2  xbmc/pvrclients/MediaPortal/client.h
@@ -1,6 +1,6 @@
#pragma once
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
View
47 xbmc/pvrclients/MediaPortal/epg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This program is free software: you can redistribute it and/or modify
@@ -22,15 +22,16 @@
using namespace std;
+#include "xbmc_pvr_types.h"
#include "epg.h"
#include "utils.h"
#include "client.h"
-//Copied from PVREpg.h:
-//subtypes derived from English strings.xml and CPVREpgInfoTag::ConvertGenreIdToString
-//TODO: Finish me... This list is not yet complete
-#define EPG_EVENT_CONTENTMASK_MOVIEDRAMA 0x10
-//Subtypes MOVIE/DRAMA
+// For the main EPG event types, see xbmc_pvr_types.h
+// Subtypes below are derived from English strings.xml and CEpg::ConvertGenreIdToString()
+// TODO: Finish me... This list is not yet complete
+// EPG_EVENT_CONTENTMASK_MOVIEDRAMA 0x10
+// Subtypes MOVIE/DRAMA
#define DETECTIVE_THRILLER 0x01
#define ADVENTURE_WESTERN_WAR 0x02
#define SF_FANTASY_HORROR 0x03
@@ -40,32 +41,32 @@ using namespace std;
#define SERIOUS_CLASSICAL_RELIGIOUS_HISTORICAL_DRAMA 0x07
#define ADULTMOVIE_DRAMA 0x08
-#define EPG_EVENT_CONTENTMASK_NEWSCURRENTAFFAIRS 0x20
-//subtypes:
+// EPG_EVENT_CONTENTMASK_NEWSCURRENTAFFAIRS 0x20
+// subtypes:
#define NEWS_WEATHER_REPORT 0x01
#define NEWS_MAGAZINE 0x02
#define DOCUMENTARY 0x03
#define DISCUSSION_INTERVIEW_DEBATE 0x04
-#define EPG_EVENT_CONTENTMASK_SHOW 0x30
-//subtypes:
+// EPG_EVENT_CONTENTMASK_SHOW 0x30
+// subtypes:
#define GAMESHOW_QUIZ_CONTEST 0x01
#define VARIETY_SHOW 0x02
#define TALK_SHOW 0x03
-#define EPG_EVENT_CONTENTMASK_SPORTS 0x40
+// EPG_EVENT_CONTENTMASK_SPORTS 0x40
-#define EPG_EVENT_CONTENTMASK_CHILDRENYOUTH 0x50
-//subtypes
+// EPG_EVENT_CONTENTMASK_CHILDRENYOUTH 0x50
+// subtypes
#define PRESCHOOL_CHILD_PROGRAM 0x01
#define ENTERTAINMENT_6TO14 0x02
#define ENTERTAINMENT_10TO16 0x03
#define INFO_EDUC_SCHOOL_PROGRAM 0x04
#define CARTOONS_PUPPETS 0x05
-#define EPG_EVENT_CONTENTMASK_MUSICBALLETDANCE 0x60
-#define EPG_EVENT_CONTENTMASK_ARTSCULTURE 0x70
-//subtypes
+// EPG_EVENT_CONTENTMASK_MUSICBALLETDANCE 0x60
+// EPG_EVENT_CONTENTMASK_ARTSCULTURE 0x70
+// subtypes
#define PERFORMING_ARTS 0x01
#define FINE_ARTS 0x02
#define RELIGION 0x03
@@ -78,14 +79,14 @@ using namespace std;
#define ARTS_CULTURE_MAGAZINES 0x10
#define FASHION 0x11
-#define EPG_EVENT_CONTENTMASK_SOCIALPOLITICALECONOMICS 0x80
-//subtype
+// EPG_EVENT_CONTENTMASK_SOCIALPOLITICALECONOMICS 0x80
+// subtype
#define MAGAZINES_REPORTS_DOCUMENTARY 0x01
#define ECONOMICS_SOCIAL_ADVISORY 0x02
#define REMARKABLE_PEOPLE 0x03
-#define EPG_EVENT_CONTENTMASK_EDUCATIONALSCIENCE 0x90
-//subtypes
+// EPG_EVENT_CONTENTMASK_EDUCATIONALSCIENCE 0x90
+// subtypes
#define NATURE_ANIMALS_ENVIRONMENT 0x01
#define TECHNOLOGY_NATURAL_SCIENCES 0x02
#define MEDICINE_PHYSIOLOGY_PSYCHOLOGY 0x03
@@ -94,9 +95,9 @@ using namespace std;
#define FURTHER_EDUCATION 0x06
#define LANGUAGES 0x07
-#define EPG_EVENT_CONTENTMASK_LEISUREHOBBIES 0xA0
-#define EPG_EVENT_CONTENTMASK_SPECIAL 0xB0
-#define EPG_EVENT_CONTENTMASK_USERDEFINED 0xF0
+// EPG_EVENT_CONTENTMASK_LEISUREHOBBIES 0xA0
+// EPG_EVENT_CONTENTMASK_SPECIAL 0xB0
+// EPG_EVENT_CONTENTMASK_USERDEFINED 0xF0
cEpg::cEpg()
{
View
2  xbmc/pvrclients/MediaPortal/epg.h
@@ -1,6 +1,6 @@
#pragma once
/*
- * Copyright (C) 2005-2009 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
View
2  xbmc/pvrclients/MediaPortal/os-dependent.h
@@ -1,6 +1,6 @@
#pragma once
/*
- * Copyright (C) 2005-2009 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
View
1  xbmc/pvrclients/MediaPortal/project/VS2010Express/XBMC_MPTV_tsreader.vcxproj
@@ -160,7 +160,6 @@
<ClInclude Include="..\..\pvrclient-mediaportal.h" />
<ClInclude Include="..\..\recordings.h" />
<ClInclude Include="..\..\Socket.h" />
- <ClInclude Include="..\..\StdString.h" />
<ClInclude Include="..\..\timers.h" />
<ClInclude Include="..\..\utils.h" />
</ItemGroup>
View
3  xbmc/pvrclients/MediaPortal/project/VS2010Express/XBMC_MPTV_tsreader.vcxproj.filters
@@ -106,9 +106,6 @@
<ClInclude Include="..\..\Socket.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\..\StdString.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\..\timers.h">
<Filter>Header Files</Filter>
</ClInclude>
View
141 xbmc/pvrclients/MediaPortal/pvrclient-mediaportal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This program is free software: you can redistribute it and/or modify
@@ -39,7 +39,7 @@
using namespace std;
-//Globals
+/* Globals */
int g_iTVServerXBMCBuild = 0;
/************************************************************/
@@ -78,9 +78,11 @@ string cPVRClientMediaPortal::SendCommand(string command)
if ( !m_tcpclient->send(command) )
{
- if ( !m_tcpclient->is_valid() ) {
+ if ( !m_tcpclient->is_valid() )
+ {
// Connection lost, try to reconnect
- if ( Connect() ) {
+ if ( Connect() )
+ {
// Resend the command
if (!m_tcpclient->send(command))
{
@@ -95,10 +97,8 @@ string cPVRClientMediaPortal::SendCommand(string command)
if ( !m_tcpclient->ReadResponse(code, lines) )
{
XBMC->Log(LOG_ERROR, "SendCommand - Failed with code: %d (%s)", code, lines[lines.size()-1].c_str());
- } //else
- //{
- // XBMC->Log(LOG_DEBUG, "cPVRClientMediaPortal::SendCommand('%s') response: %s", command.c_str(), lines[lines.size()-1].c_str());
- //}
+ }
+
return lines[lines.size()-1].c_str();
}
@@ -125,10 +125,11 @@ bool cPVRClientMediaPortal::SendCommand2(string command, int& code, vector<strin
{
XBMC->Log(LOG_ERROR, "SendCommand - Failed with code: %d (%s)", code, lines[lines.size()-1].c_str());
return false;
- } else {
+ }
+ else
+ {
string result = lines[lines.size()-1];
lines.clear();
- //XBMC->Log(LOG_DEBUG, "cPVRClientMediaPortal::SendCommand('%s') response: %s", command.c_str(), result.c_str());
Tokenize(result, lines, ",");
@@ -164,7 +165,9 @@ bool cPVRClientMediaPortal::Connect()
{
XBMC->Log(LOG_ERROR, "TVServer does not accept protocol: PVRclientXBMC:0-1");
return false;
- } else {
+ }
+ else
+ {
vector<string> fields;
int major = 0, minor = 0, revision = 0;
int count = 0;
@@ -180,6 +183,7 @@ bool cPVRClientMediaPortal::Connect()
XBMC->Log(LOG_ERROR, "Could not parse the TVServerXBMC version string '%s'", fields[1].c_str());
return false;
}
+
// Check for the minimal requirement: 1.1.0.70
if( g_iTVServerXBMCBuild < 70 ) //major < 1 || minor < 1 || revision < 0 || build < 70
{
@@ -197,7 +201,9 @@ bool cPVRClientMediaPortal::Connect()
XBMC->Log(LOG_INFO, "It is adviced to upgrade your TVServerXBMC version '%s' to 1.1.3.104 or higher!", fields[1].c_str());
}
}
- } else {
+ }
+ else
+ {
XBMC->Log(LOG_ERROR, "Your TVServerXBMC version is too old. Please upgrade.");
XBMC->QueueNotification(QUEUE_ERROR, "Your TVServerXBMC version is too old. Please upgrade to 1.1.0.70 or higher!");
return false;
@@ -244,7 +250,8 @@ bool cPVRClientMediaPortal::IsUp()
{
if(!m_tcpclient->is_valid())
{
- if(!Connect()) {
+ if(!Connect())
+ {
return false;
}
}
@@ -271,7 +278,7 @@ const char* cPVRClientMediaPortal::GetBackendName(void)
XBMC->Log(LOG_DEBUG, "->GetBackendName()");
- if(m_BackendName.length() == 0)
+ if (m_BackendName.length() == 0)
{
m_BackendName = "MediaPortal TV-server (";
m_BackendName += SendCommand("GetBackendName:\n");
@@ -339,8 +346,6 @@ PVR_ERROR cPVRClientMediaPortal::GetMPTVTime(time_t *localTime, int *gmtOffset)
int count = 0;
struct tm timeinfo;
- //XBMC->Log(LOG_DEBUG, "->GetMPTVTime");
-
if (!IsUp())
return PVR_ERROR_SERVER_ERROR;
@@ -392,7 +397,8 @@ PVR_ERROR cPVRClientMediaPortal::GetMPTVTime(time_t *localTime, int *gmtOffset)
{
return PVR_ERROR_SERVER_ERROR;
}
- } else
+ }
+ else
return PVR_ERROR_SERVER_ERROR;
}
@@ -409,7 +415,6 @@ PVR_ERROR cPVRClientMediaPortal::GetEpg(PVR_HANDLE handle, const PVR_CHANNEL &ch
struct tm starttime;
struct tm endtime;
-
starttime = *gmtime( &iStart );
endtime = *gmtime( &iEnd );
XBMC->Log(LOG_DEBUG, "->RequestEPGForChannel(%i)", channel.iUniqueId);
@@ -482,10 +487,14 @@ PVR_ERROR cPVRClientMediaPortal::GetEpg(PVR_HANDLE handle, const PVR_CHANNEL &ch
epg.Reset();
}
}
- } else {
+ }
+ else
+ {
XBMC->Log(LOG_DEBUG, "No EPG items found for channel %i", channel.iUniqueId);
}
- } else {
+ }
+ else
+ {
XBMC->Log(LOG_DEBUG, "RequestEPGForChannel(%i) %s", channel.iUniqueId, result.c_str());
}
@@ -526,7 +535,9 @@ PVR_ERROR cPVRClientMediaPortal::GetChannels(PVR_HANDLE handle, bool bRadio)
{
XBMC->Log(LOG_DEBUG, "RequestChannelList for Radio group:%s", g_szRadioGroup.c_str());
command.Format("ListRadioChannels:%s\n", uri::encode(uri::PATH_TRAITS, g_szRadioGroup).c_str());
- } else {
+ }
+ else
+ {
XBMC->Log(LOG_DEBUG, "RequestChannelList for TV group:%s", g_szTVGroup.c_str());
command.Format("ListTVChannels:%s\n", uri::encode(uri::PATH_TRAITS, g_szTVGroup).c_str());
}
@@ -538,7 +549,8 @@ PVR_ERROR cPVRClientMediaPortal::GetChannels(PVR_HANDLE handle, bool bRadio)
{
string& data(*it);
- if (data.length() == 0) {
+ if (data.length() == 0)
+ {
if(bRadio)
XBMC->Log(LOG_DEBUG, "TVServer returned no data. Empty/non existing radio group '%s'?", g_szRadioGroup.c_str());
else
@@ -547,11 +559,6 @@ PVR_ERROR cPVRClientMediaPortal::GetChannels(PVR_HANDLE handle, bool bRadio)
}
uri::decode(data);
- //if(bRadio) {
- // XBMC->Log(LOG_DEBUG, "Radio channel: %s", data.c_str() );
- //} else {
- // XBMC->Log(LOG_DEBUG, "TV channel: %s", data.c_str() );
- //}
cChannel channel;
if( channel.Parse(data) )
@@ -639,7 +646,9 @@ PVR_ERROR cPVRClientMediaPortal::GetChannelGroups(PVR_HANDLE handle, bool bRadio
{
XBMC->Log(LOG_DEBUG, "GetChannelGroups for radio");
SendCommand2("ListRadioGroups\n", code, lines);
- } else {
+ }
+ else
+ {
XBMC->Log(LOG_DEBUG, "RequestChannelList for TV group:%s", g_szTVGroup.c_str());
SendCommand2("ListRadioGroups\n", code, lines);
}
@@ -650,7 +659,8 @@ PVR_ERROR cPVRClientMediaPortal::GetChannelGroups(PVR_HANDLE handle, bool bRadio
{
string& data(*it);
- if (data.length() == 0) {
+ if (data.length() == 0)
+ {
if(bRadio)
XBMC->Log(LOG_DEBUG, "TVServer returned no data. No radio groups found?");
else
@@ -684,7 +694,9 @@ PVR_ERROR cPVRClientMediaPortal::GetChannelGroupMembers(PVR_HANDLE handle, const
{
XBMC->Log(LOG_DEBUG, "%s: for group '%s', radio=%i", __FUNCTION__, group.strGroupName, group.bIsRadio);
command.Format("ListRadioChannels:%s\n", uri::encode(uri::PATH_TRAITS, group.strGroupName).c_str());
- } else {
+ }
+ else
+ {
XBMC->Log(LOG_DEBUG, "%s: for group '%s', radio=%i", __FUNCTION__, group.strGroupName, group.bIsRadio);
command.Format("ListTVChannels:%s\n", uri::encode(uri::PATH_TRAITS, group.strGroupName).c_str());
}
@@ -696,7 +708,8 @@ PVR_ERROR cPVRClientMediaPortal::GetChannelGroupMembers(PVR_HANDLE handle, const
{
string& data(*it);
- if (data.length() == 0) {
+ if (data.length() == 0)
+ {
if(group.bIsRadio)
XBMC->Log(LOG_DEBUG, "TVServer returned no data. Empty/non existing radio group '%s'?", g_szRadioGroup.c_str());
else
@@ -819,7 +832,8 @@ PVR_ERROR cPVRClientMediaPortal::GetRecordings(PVR_HANDLE handle)
}
#else
if (g_bUseRecordingsDir == true)
- { //Replace path by given path in g_szRecordingsDir
+ {
+ //Replace path by given path in g_szRecordingsDir
if (g_szRecordingsDir.length() > 0)
{
recording.SetDirectory(g_szRecordingsDir);
@@ -875,7 +889,7 @@ PVR_ERROR cPVRClientMediaPortal::RenameRecording(const PVR_RECORDING &recording)
return PVR_ERROR_SERVER_ERROR;
snprintf(command, 512, "UpdateRecording:%i|%s\n",
- recording.iClientIndex,
+ recording.iClientIndex,
uri::encode(uri::PATH_TRAITS, recording.strTitle).c_str());
result = SendCommand(command);
@@ -987,27 +1001,18 @@ PVR_ERROR cPVRClientMediaPortal::AddTimer(const PVR_TIMER &timerinfo)
cTimer timer(timerinfo);
- //if (timerinfo.index == -1)
- //{ // New timer
- result = SendCommand(timer.AddScheduleCommand());
-
- if(result.find("True") == string::npos)
- {
- XBMC->Log(LOG_DEBUG, "AddTimer for channel: %i [failed]", timerinfo.iClientChannelUid);
- return PVR_ERROR_NOT_SAVED;
- }
- XBMC->Log(LOG_DEBUG, "AddTimer for channel: %i [done]", timerinfo.iClientChannelUid);
+ result = SendCommand(timer.AddScheduleCommand());
- // Although XBMC adds this timer, we still have to trigger XBMC to update its timer list to
- // see this new timer at the XBMC side
- PVR->TriggerTimerUpdate();
+ if(result.find("True") == string::npos)
+ {
+ XBMC->Log(LOG_DEBUG, "AddTimer for channel: %i [failed]", timerinfo.iClientChannelUid);
+ return PVR_ERROR_NOT_SAVED;
+ }
+ XBMC->Log(LOG_DEBUG, "AddTimer for channel: %i [done]", timerinfo.iClientChannelUid);
- //}
- //else
- //{
- // // Modified timer
- // return UpdateTimer(timerinfo);
- //}
+ // Although XBMC adds this timer, we still have to trigger XBMC to update its timer list to
+ // see this new timer at the XBMC side
+ PVR->TriggerTimerUpdate();
return PVR_ERROR_NO_ERROR;
}
@@ -1026,7 +1031,9 @@ PVR_ERROR cPVRClientMediaPortal::DeleteTimer(const PVR_TIMER &timer, bool bForce
{
XBMC->Log(LOG_DEBUG, "DeleteTimer: schedule index = -1", timer.iClientIndex);
return PVR_ERROR_NOT_DELETED;
- } else {
+ }
+ else
+ {
XBMC->Log(LOG_DEBUG, "DeleteTimer: About to delete MediaPortal schedule index=%i", timer.iClientIndex);
result = SendCommand(command);
@@ -1117,7 +1124,9 @@ bool cPVRClientMediaPortal::OpenLiveStream(const PVR_CHANNEL &channelinfo)
{
//Use the optimized TimeshiftChannel call (don't stop a running timeshift)
snprintf(command, 256, "TimeshiftChannel:%i|False|False\n", channel);
- } else {
+ }
+ else
+ {
snprintf(command, 256, "TimeshiftChannel:%i|True\n", channel);
}
result = SendCommand(command);
@@ -1176,19 +1185,25 @@ bool cPVRClientMediaPortal::OpenLiveStream(const PVR_CHANNEL &channelinfo)
m_tsreader->OnZap();
usleep(100000);
return true;
- } else {
+ }
+ else
+ {
m_tsreader->Close();
delete m_tsreader;
m_tsreader = new CTsReader();
}
- } else {
+ }
+ else
+ {
m_tsreader = new CTsReader();
}
if(g_bDirectTSFileRead)
{ // Timeshift buffer
m_tsreader->Open(timeshiftfields[2].c_str());
- } else {
+ }
+ else
+ {
// RTSP url
m_tsreader->Open(timeshiftfields[0].c_str());
usleep(400000);
@@ -1264,7 +1279,9 @@ void cPVRClientMediaPortal::CloseLiveStream(void)
XBMC->Log(LOG_INFO, "CloseLiveStream: %s", result.c_str());
m_bTimeShiftStarted = false;
m_iCurrentChannel = 0;
- } else {
+ }
+ else
+ {
XBMC->Log(LOG_DEBUG, "CloseLiveStream: Nothing to do.");
}
}
@@ -1498,7 +1515,9 @@ const char* cPVRClientMediaPortal::GetLiveStreamURL(const PVR_CHANNEL &channelin
{ //old way
// RTSP URL may contain a hostname, XBMC will do the IP resolve
snprintf(command, 256, "TimeshiftChannel:%i|False\n", channel);
- } else {
+ }
+ else
+ {
//Faster, skip StopTimeShift
snprintf(command, 256, "TimeshiftChannel:%i|False|False\n", channel);
}
@@ -1510,7 +1529,9 @@ const char* cPVRClientMediaPortal::GetLiveStreamURL(const PVR_CHANNEL &channelin
// RTSP URL will always contain an IP address, TVServerXBMC will
// do the IP resolve
snprintf(command, 256, "TimeshiftChannel:%i|True\n", channel);
- } else {
+ }
+ else
+ {
//Faster, skip StopTimeShift
snprintf(command, 256, "TimeshiftChannel:%i|True|False\n", channel);
}
View
10 xbmc/pvrclients/MediaPortal/pvrclient-mediaportal.h
@@ -1,6 +1,6 @@
#pragma once
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
@@ -18,10 +18,6 @@
*
*/
-/*
-* for DESCRIPTION see 'PVRClient-MediaPortal.cpp'
-*/
-
#include <vector>
/* Master defines for client control */
@@ -88,6 +84,7 @@ class cPVRClientMediaPortal
int GetCurrentClientChannel();
bool SwitchChannel(const PVR_CHANNEL &channel);
PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS &signalStatus);
+ const char* GetLiveStreamURL(const PVR_CHANNEL &channel);
/* Record stream handling */
bool OpenRecordedStream(const PVR_RECORDING &recording);
@@ -96,9 +93,6 @@ class cPVRClientMediaPortal
long long SeekRecordedStream(long long iPosition, int iWhence = SEEK_SET);
long long LengthRecordedStream(void);
- //MG: Added for MediaPortal streaming
- const char* GetLiveStreamURL(const PVR_CHANNEL &channel);
-
protected:
MPTV::Socket *m_tcpclient;
View
6 xbmc/pvrclients/MediaPortal/recordings.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This program is free software: you can redistribute it and/or modify
@@ -157,7 +157,9 @@ bool cRecording::ParseLine(const std::string& data)
if (fields.size() == 10) // Since 1.0.8.0
{
m_originalurl = fields[9];
- } else {
+ }
+ else
+ {
m_originalurl = fields[6];
}
View
2  xbmc/pvrclients/MediaPortal/recordings.h
@@ -1,6 +1,6 @@
#pragma once
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This program is free software: you can redistribute it and/or modify
View
39 xbmc/pvrclients/MediaPortal/timers.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This program is free software: you can redistribute it and/or modify
@@ -23,7 +23,6 @@
using namespace std;
-//#include "libPlatform/os-dependent.h"
#include "os-dependent.h" //needed for snprintf
#include "client.h"
#include "timers.h"
@@ -57,7 +56,9 @@ cTimer::cTimer(const PVR_TIMER& timerinfo)
if(!m_active)
{
time(&m_canceled);
- } else {
+ }
+ else
+ {
// Don't know when it was cancelled, so assume that it was canceled now...
// backend (TVServerXBMC) will only update the canceled date time when
// this schedule was just canceled
@@ -65,7 +66,6 @@ cTimer::cTimer(const PVR_TIMER& timerinfo)
}
m_title = timerinfo.strTitle;
- //m_title.Replace(",",""); //Remove commas from title field => still needed?
m_directory = timerinfo.strDirectory;
m_channel = timerinfo.iClientChannelUid;
m_starttime = timerinfo.startTime;
@@ -94,8 +94,8 @@ cTimer::~cTimer()
}
/**
- * @brief Fills the PVR_TIMERINFO_OLD struct with information from this timer
- * @param tag A reference to the PVR_TIMERINFO_OLD struct
+ * @brief Fills the PVR_TIMER struct with information from this timer
+ * @param tag A reference to the PVR_TIMER struct
*/
void cTimer::GetPVRtimerinfo(PVR_TIMER &tag)
{
@@ -181,7 +181,6 @@ bool cTimer::ParseLine(const char *s)
if(count != 6)
return false;
- //timeinfo = *localtime ( &rawtime );
timeinfo.tm_hour = hour;
timeinfo.tm_min = minute;
timeinfo.tm_sec = second;
@@ -203,7 +202,6 @@ bool cTimer::ParseLine(const char *s)
if( count != 6)
return false;
- //timeinfo2 = *localtime ( &rawtime );
timeinfo.tm_hour = hour;
timeinfo.tm_min = minute;
timeinfo.tm_sec = second;
@@ -231,7 +229,8 @@ bool cTimer::ParseLine(const char *s)
m_directory = schedulefields[10];
if(schedulefields.size() >= 18)
- { //TVServerXBMC build >= 100
+ {
+ //TVServerXBMC build >= 100
m_keepmethod = (KeepMethodType) atoi(schedulefields[11].c_str());
count = sscanf(schedulefields[12].c_str(), "%d-%d-%d %d:%d:%d", &year, &month, &day, &hour, &minute, &second);
@@ -239,7 +238,6 @@ bool cTimer::ParseLine(const char *s)
if(count != 6)
return false;
- //timeinfo = *localtime ( &rawtime );
timeinfo.tm_hour = hour;
timeinfo.tm_min = minute;
timeinfo.tm_sec = second;
@@ -272,7 +270,6 @@ bool cTimer::ParseLine(const char *s)
if(count != 6)
return false;
- //timeinfo = *localtime ( &rawtime );
timeinfo.tm_hour = hour;
timeinfo.tm_min = minute;
timeinfo.tm_sec = second;
@@ -290,7 +287,9 @@ bool cTimer::ParseLine(const char *s)
m_series = stringtobool(schedulefields[16]);
m_isrecording = stringtobool(schedulefields[17]);
- } else {
+ }
+ else
+ {
m_keepmethod = UntilSpaceNeeded;
m_keepdate = cUndefinedDate;
m_prerecordinterval = -1;
@@ -490,17 +489,15 @@ std::string cTimer::UpdateScheduleCommand()
endtime.tm_hour, endtime.tm_min, endtime.tm_sec); //End time
}
- //result = command;
-
return command;
}
int cTimer::XBMC2MepoPriority(int xbmcprio)
{
- //From XBMC side: 0.99 where 0=lowest and 99=highest priority (like VDR). Default value: 50
- //Meaning of the MediaPortal field is unknown to me. Default seems to be 0.
- //TODO: figure out the mapping
+ // From XBMC side: 0.99 where 0=lowest and 99=highest priority (like VDR). Default value: 50
+ // Meaning of the MediaPortal field is unknown to me. Default seems to be 0.
+ // TODO: figure out the mapping
return 0;
}
@@ -510,7 +507,7 @@ int cTimer::Mepo2XBMCPriority(int mepoprio)
}
-/**
+/*
* @brief Convert a XBMC Lifetime value to MediaPortals keepMethod+keepDate settings
* @param lifetime the XBMC lifetime value (in days) (following the VDR syntax)
* Should be called after setting m_starttime !!
@@ -528,11 +525,13 @@ void cTimer::SetKeepMethod(int lifetime)
{
m_keepmethod = UntilSpaceNeeded;
m_keepdate = cUndefinedDate;
- } else if (lifetime == 99)
+ }
+ else if (lifetime == 99)
{
m_keepmethod = Forever;
m_keepdate = cUndefinedDate;
- } else
+ }
+ else
{
m_keepmethod = UntilKeepDate;
m_keepdate = m_starttime + (lifetime * cSecsInDay);
View
8 xbmc/pvrclients/MediaPortal/timers.h
@@ -1,6 +1,6 @@
#pragma once
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
@@ -88,6 +88,12 @@ class cTimer
private:
int SchedRecType2RepeatFlags(ScheduleRecordingType schedtype);
+
+ /**
+ * @brief Convert a XBMC Lifetime value to MediaPortals keepMethod+keepDate settings
+ * @param lifetime the XBMC lifetime value (in days) (following the VDR syntax)
+ * Should be called after setting m_starttime !!
+ */
void SetKeepMethod(int lifetime);
int GetLifetime(void);
int XBMC2MepoPriority(int xbmcprio);
View
25 xbmc/pvrclients/MediaPortal/windows/os_windows.h
@@ -1,6 +1,6 @@
#pragma once
/*
- * Copyright (C) 2005-2010 Team XBMC
+ * Copyright (C) 2005-2011 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
@@ -21,29 +21,6 @@
#define WIN32_LEAN_AND_MEAN // Enable LEAN_AND_MEAN support
#include <windows.h>
-//#ifndef _WINSOCKAPI_
-//#define _WINSOCKAPI_
-//#endif
-//#pragma warning(disable:4005) // Disable "warning C4005: '_WINSOCKAPI_' : macro redefinition"
-//#include <winsock2.h>
-//#pragma warning(default:4005)
-//#include <stdlib.h>
-//#include <stdio.h>
-//#include <stdarg.h>
-//#include <signal.h>
-//#include <time.h>
-//#include <sys/types.h>
-//#include <sys/timeb.h>
-
-//#if defined(DLL_IMPORT)
-//#define LIBTYPE __declspec( dllexport )
-//#elif defined(DLL_EXPORT)
-//#define LIBTYPE __declspec( dllimport )
-//#else
-//#define LIBTYPE
-//#endif
-
-
typedef HANDLE wait_event_t;
typedef CRITICAL_SECTION criticalsection_t;
typedef unsigned __int32 uint;
Please sign in to comment.
Something went wrong with that request. Please try again.