zapit/lib/zapitclient.cpp: add start/stop commands got PiP

Origin commit data
------------------
Commit: f4b6177076
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-03-08 (Fri, 08 Mar 2013)
This commit is contained in:
[CST] Focus
2013-03-08 13:22:27 +04:00
parent 1febf10efb
commit 174edb973c
3 changed files with 33 additions and 1 deletions

View File

@@ -148,7 +148,8 @@ class CZapitMessages
CMD_GET_ASPECTRATIO = 107,
CMD_SET_ASPECTRATIO = 108,
CMD_GET_MODE43 = 109,
CMD_SET_MODE43 = 110
CMD_SET_MODE43 = 110,
CMD_STOP_PIP = 111
};
@@ -188,6 +189,7 @@ class CZapitMessages
{
t_channel_id channel_id;
bool record;
bool pip;
};
struct commandSetAudioChannel

View File

@@ -273,6 +273,7 @@ class CZapitClient:public CBasicClient
/* zaps to channel, returns the "zap-status" */
unsigned int zapTo_serviceID(const t_channel_id channel_id);
unsigned int zapTo_record(const t_channel_id channel_id);
unsigned int zapTo_pip(const t_channel_id channel_id);
/* zaps to subservice, returns the "zap-status" */
unsigned int zapTo_subServiceID(const t_channel_id channel_id);
@@ -486,6 +487,7 @@ class CZapitClient:public CBasicClient
void setStandby(const bool enable);
void startPlayBack();
void stopPlayBack();
void stopPip();
void lockPlayBack();
void unlockPlayBack();
bool tune_TP(TP_params TP);

View File

@@ -151,6 +151,7 @@ unsigned int CZapitClient::zapTo_serviceID(const t_channel_id channel_id)
msg.channel_id = channel_id;
msg.record = false;
msg.pip = false;
send(CZapitMessages::CMD_ZAPTO_SERVICEID, (const char *) & msg, sizeof(msg));
@@ -168,6 +169,25 @@ unsigned int CZapitClient::zapTo_record(const t_channel_id channel_id)
msg.channel_id = channel_id;
msg.record = true;
msg.pip = false;
send(CZapitMessages::CMD_ZAPTO_SERVICEID, (const char *) & msg, sizeof(msg));
CZapitMessages::responseZapComplete response;
CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection();
return response.zapStatus;
}
unsigned int CZapitClient::zapTo_pip(const t_channel_id channel_id)
{
CZapitMessages::commandZaptoServiceID msg;
msg.channel_id = channel_id;
msg.record = false;
msg.pip = true;
send(CZapitMessages::CMD_ZAPTO_SERVICEID, (const char *) & msg, sizeof(msg));
@@ -968,6 +988,14 @@ void CZapitClient::stopPlayBack()
close_connection();
}
void CZapitClient::stopPip()
{
send(CZapitMessages::CMD_STOP_PIP);
CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection();
}
void CZapitClient::lockPlayBack()
{
send(CZapitMessages::CMD_SB_LOCK_PLAYBACK);