diff --git a/src/zapit/include/zapit/client/msgtypes.h b/src/zapit/include/zapit/client/msgtypes.h index 691457316..1da5b0eb9 100644 --- a/src/zapit/include/zapit/client/msgtypes.h +++ b/src/zapit/include/zapit/client/msgtypes.h @@ -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 diff --git a/src/zapit/include/zapit/client/zapitclient.h b/src/zapit/include/zapit/client/zapitclient.h index 4387ef43e..bb71ad4a0 100644 --- a/src/zapit/include/zapit/client/zapitclient.h +++ b/src/zapit/include/zapit/client/zapitclient.h @@ -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); diff --git a/src/zapit/lib/zapitclient.cpp b/src/zapit/lib/zapitclient.cpp index b5ed35828..393c4e8fa 100644 --- a/src/zapit/lib/zapitclient.cpp +++ b/src/zapit/lib/zapitclient.cpp @@ -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);