Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
[mythtv-cmyth] Renamed back libcmyth function pointer names from came…
Browse files Browse the repository at this point in the history
…l case to their original names.
  • Loading branch information
fetzerch committed Sep 28, 2012
1 parent cf8d018 commit 6a4d4a1
Show file tree
Hide file tree
Showing 14 changed files with 967 additions and 967 deletions.
22 changes: 11 additions & 11 deletions addons/pvr.mythtv.cmyth/src/cppmyth/MythChannel.cpp
Expand Up @@ -20,55 +20,55 @@ MythChannel::MythChannel()

int MythChannel::ID()
{
return CMYTH->ChannelChanid(*m_channel_t);
return CMYTH->cmyth_channel_chanid(*m_channel_t);
}

int MythChannel::NumberInt()
{
return CMYTH->ChannelChannum(*m_channel_t);
return CMYTH->cmyth_channel_channum(*m_channel_t);
}

CStdString MythChannel::Number()
{
CStdString retval( CMYTH->ChannelChannumstr(*m_channel_t));
CStdString retval( CMYTH->cmyth_channel_channumstr(*m_channel_t));
return retval;
}

CStdString MythChannel::Callsign()
{
CStdString retval( CMYTH->ChannelCallsign(*m_channel_t));
CStdString retval( CMYTH->cmyth_channel_callsign(*m_channel_t));
return retval;
}

int MythChannel::SourceID()
{
return CMYTH->ChannelSourceid(*m_channel_t);
return CMYTH->cmyth_channel_sourceid(*m_channel_t);
}

int MythChannel::MultiplexID()
{
return CMYTH->ChannelMultiplex(*m_channel_t);
return CMYTH->cmyth_channel_multiplex(*m_channel_t);
}

CStdString MythChannel::Name()
{
char* cChan=CMYTH->ChannelName(*m_channel_t);
char* cChan=CMYTH->cmyth_channel_name(*m_channel_t);
CStdString retval(cChan);
CMYTH->RefRelease(cChan);
CMYTH->ref_release(cChan);
return retval;
}

CStdString MythChannel::Icon()
{
char* cIcon=CMYTH->ChannelIcon(*m_channel_t);
char* cIcon=CMYTH->cmyth_channel_icon(*m_channel_t);
CStdString retval(cIcon);
CMYTH->RefRelease(cIcon);
CMYTH->ref_release(cIcon);
return retval;
}

bool MythChannel::Visible()
{
return CMYTH->ChannelVisible(*m_channel_t)>0;
return CMYTH->cmyth_channel_visible(*m_channel_t)>0;
}

bool MythChannel::IsRadio()
Expand Down
84 changes: 42 additions & 42 deletions addons/pvr.mythtv.cmyth/src/cppmyth/MythConnection.cpp
Expand Up @@ -36,7 +36,7 @@ using namespace ADDON;
{ \
Lock(); \
if ( var != NULL ) \
CMYTH->RefRelease( var ); \
CMYTH->ref_release( var ); \
var = CMYTH->call; \
Unlock(); \
} \
Expand All @@ -58,7 +58,7 @@ MythConnection::MythConnection(CStdString server,unsigned short port):
m_conn_t(new MythPointerThreadSafe<cmyth_conn_t>),m_server(server),m_port(port),m_retry_count(0)
{
char *cserver=strdup(server.c_str());
cmyth_conn_t connection=CMYTH->ConnConnectCtrl(cserver,port,64*1024, 16*1024);
cmyth_conn_t connection=CMYTH->cmyth_conn_connect_ctrl(cserver,port,64*1024, 16*1024);
free(cserver);
*m_conn_t=(connection);

Expand All @@ -70,7 +70,7 @@ std::vector< CStdString > MythConnection::GetStorageGroupFileList_(CStdString sg
Lock();
char **sg;
CStdString bckHostNme = GetBackendHostname();
int len = CMYTH->StoragegroupFilelist(*m_conn_t,&sg,sgGetList.Buffer(),bckHostNme.Buffer());
int len = CMYTH->cmyth_storagegroup_filelist(*m_conn_t,&sg,sgGetList.Buffer(),bckHostNme.Buffer());
if(!sg)
return retval;
for(int i=0;i<len;i++)
Expand All @@ -81,7 +81,7 @@ std::vector< CStdString > MythConnection::GetStorageGroupFileList_(CStdString sg
retval.push_back(tmpSG/*.c_str()*/);
}

CMYTH->RefRelease(sg);
CMYTH->ref_release(sg);
Unlock();
return retval;
}
Expand All @@ -90,32 +90,32 @@ std::vector< MythSGFile > MythConnection::GetStorageGroupFileList(CStdString sto
{
CStdString hostname = GetBackendHostname();
cmyth_storagegroup_filelist_t filelist = NULL;
CMYTH_CONN_CALL_REF( filelist, filelist == NULL, StoragegroupGetFilelist( *m_conn_t, storagegroup.Buffer(), hostname.Buffer() ) );
CMYTH_CONN_CALL_REF( filelist, filelist == NULL, cmyth_storagegroup_get_filelist( *m_conn_t, storagegroup.Buffer(), hostname.Buffer() ) );
Lock();
int len=CMYTH->StoragegroupFilelistCount(filelist);
int len=CMYTH->cmyth_storagegroup_filelist_count(filelist);
std::vector< MythSGFile > retval(len);
for(int i=0;i<len;i++)
{
cmyth_storagegroup_file_t file=CMYTH->StoragegroupFilelistGetItem(filelist,i);
cmyth_storagegroup_file_t file=CMYTH->cmyth_storagegroup_filelist_get_item(filelist,i);
retval.push_back(MythSGFile(file));
}
CMYTH->RefRelease(filelist);
CMYTH->ref_release(filelist);
Unlock();
return retval;
}

MythFile MythConnection::ConnectPath(CStdString filename, CStdString storageGroup)
{
cmyth_file_t file = NULL;
CMYTH_CONN_CALL_REF( file, file == NULL, ConnConnectPath( filename.Buffer(),*m_conn_t,64*1024, 16*1024,storageGroup.Buffer()) );
CMYTH_CONN_CALL_REF( file, file == NULL, cmyth_conn_connect_path( filename.Buffer(),*m_conn_t,64*1024, 16*1024,storageGroup.Buffer()) );
MythFile retval = MythFile( file, *this );
return retval;
}

bool MythConnection::IsConnected()
{
Lock();
bool connected = *m_conn_t != 0 && !CMYTH->ConnHung(*m_conn_t);
bool connected = *m_conn_t != 0 && !CMYTH->cmyth_conn_hung(*m_conn_t);
Unlock();
if ( g_bExtraDebug )
XBMC->Log( LOG_DEBUG, "%s - %i", __FUNCTION__, connected );
Expand All @@ -129,7 +129,7 @@ bool MythConnection::TryReconnect()
{
m_retry_count++;
Lock();
retval = CMYTH->ConnReconnectCtrl( *m_conn_t );
retval = CMYTH->cmyth_conn_reconnect_ctrl( *m_conn_t );
Unlock();
if ( retval == 1 )
{
Expand All @@ -148,15 +148,15 @@ bool MythConnection::TryReconnect()
MythRecorder MythConnection::GetFreeRecorder()
{
cmyth_recorder_t rec = NULL;
CMYTH_CONN_CALL_REF( rec, rec == NULL, ConnGetFreeRecorder( *m_conn_t ) );
CMYTH_CONN_CALL_REF( rec, rec == NULL, cmyth_conn_get_free_recorder( *m_conn_t ) );
MythRecorder retval = MythRecorder( rec, *this );
return retval;
}

MythRecorder MythConnection::GetRecorder(int n)
{
cmyth_recorder_t rec = NULL;
CMYTH_CONN_CALL_REF( rec, rec == NULL, ConnGetRecorderFromNum( *m_conn_t, n ) );
CMYTH_CONN_CALL_REF( rec, rec == NULL, cmyth_conn_get_recorder_from_num( *m_conn_t, n ) );
MythRecorder retval = MythRecorder( rec, *this );
return retval;
}
Expand All @@ -166,16 +166,16 @@ MythRecorder MythConnection::GetRecorder(int n)
Lock();
boost::unordered_map<CStdString, MythProgramInfo> retval;
cmyth_proglist_t proglist = NULL;
CMYTH_CONN_CALL_REF( proglist, proglist == NULL, ProglistGetAllRecorded( *m_conn_t ) );
int len=CMYTH->ProglistGetCount(proglist);
CMYTH_CONN_CALL_REF( proglist, proglist == NULL, cmyth_proglist_get_all_recorded( *m_conn_t ) );
int len=CMYTH->cmyth_proglist_get_count(proglist);
for(int i=0;i<len;i++)
{
cmyth_proginfo_t cmprog=CMYTH->ProglistGetItem(proglist,i);
MythProgramInfo prog=CMYTH->ProginfoGetDetail(*m_conn_t,cmprog);
cmyth_proginfo_t cmprog=CMYTH->cmyth_proglist_get_item(proglist,i);
MythProgramInfo prog=CMYTH->cmyth_proginfo_get_detail(*m_conn_t,cmprog);
CStdString path=prog.Path();
retval.insert(std::pair<CStdString,MythProgramInfo>(path.c_str(),prog));
}
CMYTH->RefRelease(proglist);
CMYTH->ref_release(proglist);
Unlock();
return retval;
}
Expand All @@ -185,16 +185,16 @@ MythRecorder MythConnection::GetRecorder(int n)
Lock();
boost::unordered_map<CStdString, MythProgramInfo> retval;
cmyth_proglist_t proglist = NULL;
CMYTH_CONN_CALL_REF( proglist, proglist == NULL, ProglistGetAllPending( *m_conn_t ) );
int len=CMYTH->ProglistGetCount(proglist);
CMYTH_CONN_CALL_REF( proglist, proglist == NULL, cmyth_proglist_get_all_pending( *m_conn_t ) );
int len=CMYTH->cmyth_proglist_get_count(proglist);
for(int i=0;i<len;i++)
{
MythProgramInfo prog=CMYTH->ProglistGetItem(proglist,i);
MythProgramInfo prog=CMYTH->cmyth_proglist_get_item(proglist,i);
CStdString filename;
filename.Format("%i_%i",prog.ChannelID(),prog.StartTime());
retval.insert(std::pair<CStdString,MythProgramInfo>(filename.c_str(),prog));
}
CMYTH->RefRelease(proglist);
CMYTH->ref_release(proglist);
Unlock();
return retval;
}
Expand All @@ -204,24 +204,24 @@ MythRecorder MythConnection::GetRecorder(int n)
Lock();
boost::unordered_map<CStdString, MythProgramInfo> retval;
cmyth_proglist_t proglist = NULL;
CMYTH_CONN_CALL_REF( proglist, proglist == NULL, ProglistGetAllScheduled( *m_conn_t ) );
int len=CMYTH->ProglistGetCount(proglist);
CMYTH_CONN_CALL_REF( proglist, proglist == NULL, cmyth_proglist_get_all_scheduled( *m_conn_t ) );
int len=CMYTH->cmyth_proglist_get_count(proglist);
for(int i=0;i<len;i++)
{
cmyth_proginfo_t cmprog=CMYTH->ProglistGetItem(proglist,i);
MythProgramInfo prog=CMYTH->ProginfoGetDetail(*m_conn_t,cmprog);//Release cmprog????
cmyth_proginfo_t cmprog=CMYTH->cmyth_proglist_get_item(proglist,i);
MythProgramInfo prog=CMYTH->cmyth_proginfo_get_detail(*m_conn_t,cmprog);//Release cmprog????
CStdString path=prog.Path();
retval.insert(std::pair<CStdString,MythProgramInfo>(path.c_str(),prog));
}
CMYTH->RefRelease(proglist);
CMYTH->ref_release(proglist);
Unlock();
return retval;
}

bool MythConnection::DeleteRecording(MythProgramInfo &recording)
{
int retval = 0;
CMYTH_CONN_CALL( retval, retval != 0, ProginfoDeleteRecording( *m_conn_t, *recording.m_proginfo_t ) );
CMYTH_CONN_CALL( retval, retval != 0, cmyth_proginfo_delete_recording( *m_conn_t, *recording.m_proginfo_t ) );
return retval==0;
}

Expand All @@ -245,14 +245,14 @@ CStdString MythConnection::GetServer()
int MythConnection::GetProtocolVersion()
{
int retval = 0;
CMYTH_CONN_CALL( retval, retval < 0, ConnGetProtocolVersion( *m_conn_t ) );
CMYTH_CONN_CALL( retval, retval < 0, cmyth_conn_get_protocol_version( *m_conn_t ) );
return retval;
}

bool MythConnection::GetDriveSpace(long long &total,long long &used)
{
int retval = 0;
CMYTH_CONN_CALL( retval, retval != 0, ConnGetFreespace( *m_conn_t, &total, &used ) );
CMYTH_CONN_CALL( retval, retval != 0, cmyth_conn_get_freespace( *m_conn_t, &total, &used ) );
return retval==0;
}

Expand All @@ -261,16 +261,16 @@ bool MythConnection::UpdateSchedules(int id)
CStdString cmd;
cmd.Format("RESCHEDULE_RECORDINGS %i",id);
int retval = 0;
CMYTH_CONN_CALL( retval, retval < 0, ScheduleRecording( *m_conn_t, cmd.Buffer() ) );
CMYTH_CONN_CALL( retval, retval < 0, cmyth_schedule_recording( *m_conn_t, cmd.Buffer() ) );
return retval>=0;
}

MythFile MythConnection::ConnectFile(MythProgramInfo &recording)
{
cmyth_file_t file = NULL;
/* When file is not NULL doesn't need to mean there is no more connection,
* so always check after callng ConnConnectFile if still connected to control socket. */
CMYTH_CONN_CALL_REF( file, true, ConnConnectFile( *recording.m_proginfo_t, *m_conn_t, 64 * 1024, 16 * 1024 ) );
* so always check after callng cmyth_conn_connect_file if still connected to control socket. */
CMYTH_CONN_CALL_REF( file, true, cmyth_conn_connect_file( *recording.m_proginfo_t, *m_conn_t, 64 * 1024, 16 * 1024 ) );
MythFile retval = MythFile( file, *this );
return retval;
}
Expand Down Expand Up @@ -304,9 +304,9 @@ void MythConnection::Unlock()
CStdString retval;
Lock();
char * value = NULL;
CMYTH_CONN_CALL_REF( value, value == NULL, ConnGetSetting( *m_conn_t, hostname.Buffer(), setting.Buffer() ) );
CMYTH_CONN_CALL_REF( value, value == NULL, cmyth_conn_get_setting( *m_conn_t, hostname.Buffer(), setting.Buffer() ) );
retval = value;
CMYTH->RefRelease(value);
CMYTH->ref_release(value);
value = NULL;
Unlock();
return retval;
Expand All @@ -316,7 +316,7 @@ void MythConnection::Unlock()
{
int retval = 0;
Lock();
CMYTH_CONN_CALL( retval, retval < 0, ConnSetSetting( *m_conn_t, hostname.Buffer(), setting.Buffer(), value.Buffer() ) );
CMYTH_CONN_CALL( retval, retval < 0, cmyth_conn_set_setting( *m_conn_t, hostname.Buffer(), setting.Buffer(), value.Buffer() ) );
Unlock();
return retval>=0;
}
Expand All @@ -326,9 +326,9 @@ void MythConnection::Unlock()
CStdString retval;
Lock();
char * hostname = NULL;
CMYTH_CONN_CALL_REF( hostname, hostname == NULL, ConnGetClientHostname( *m_conn_t ) );
CMYTH_CONN_CALL_REF( hostname, hostname == NULL, cmyth_conn_get_client_hostname( *m_conn_t ) );
retval = hostname;
CMYTH->RefRelease(hostname);
CMYTH->ref_release(hostname);
hostname = NULL;
Unlock();
return retval;
Expand All @@ -339,9 +339,9 @@ void MythConnection::Unlock()
CStdString retval;
Lock();
char * hostname = NULL;
CMYTH_CONN_CALL_REF( hostname, hostname == NULL, ConnGetBackendHostname( *m_conn_t ) );
CMYTH_CONN_CALL_REF( hostname, hostname == NULL, cmyth_conn_get_backend_hostname( *m_conn_t ) );
retval = hostname;
CMYTH->RefRelease(hostname);
CMYTH->ref_release(hostname);
hostname = NULL;
Unlock();
return retval;
Expand Down Expand Up @@ -392,13 +392,13 @@ start/endoffset => DefaultStartOffset/DefaultEndOffset
int MythConnection::SetBookmark(MythProgramInfo &recording, long long bookmark)
{
int retval;
CMYTH_CONN_CALL(retval, retval < 0, SetBookmark(*m_conn_t, *recording.m_proginfo_t, bookmark));
CMYTH_CONN_CALL(retval, retval < 0, cmyth_set_bookmark(*m_conn_t, *recording.m_proginfo_t, bookmark));
return retval;
}

long long MythConnection::GetBookmark(MythProgramInfo &recording)
{
long long bookmark;
CMYTH_CONN_CALL(bookmark, bookmark < 0, GetBookmark(*m_conn_t, *recording.m_proginfo_t));
CMYTH_CONN_CALL(bookmark, bookmark < 0, cmyth_get_bookmark(*m_conn_t, *recording.m_proginfo_t));
return bookmark;
}

0 comments on commit 6a4d4a1

Please sign in to comment.