- #include "Config.h" // Global Configuration - do not remove!
- #ifdef TV_GUARDIAN_ENABLE
- #include "Playcoretvgtvgapi.h"
- #include "playcorepsps.h"
- #include "decoderdecoder.h"
- #include "kerneleventdef.h"
- #include "playcorecoremaincoregdef.h"
- #include "playcorescpadscmgr.h"
- extern BYTE gLine21MuteQueue_Read, gLine21MuteQueue_Write;
- extern LINE21MUTEENTRY Line21MuteQueue[LINE21MUTEQUEUESIZE];
- extern BYTE gLine21DataBufferPool_Read, gLine21DataBufferPool_Write;
- extern LINE21DATA_BUFFER_POOL Line21DataBufferPool[NUM_OF_LINE21DATA_BUFFER_POOL];
- extern NV_SETTINGS *gps;
- //extern BYTE mute_sem;
- #ifdef _DEBUG
- extern BYTE datain_session_id;
- #endif
- const char tvg_message_array1[] = {"TVG"};
- const char tvg_message_array2[] = {"NOTVG"};
- const char tvg_message_array3[] = {"TV GUARDIAN ACTIVATED"};
- const char tvg_message_array4[] = {"TVG-DVD DICT V1.05"};
- uchar GetTVGMode( void ) {
- // return(unsigned char)(gps->tvg_mode);
- return PS_Get_TVG_Mode_Value();
- }
- uchar GetTVGCCOperation( void ) {
- // return((unsigned char)(gps->tvg_cc));
- return PS_Get_TVG_CC_Value();
- }
- uchar GetCCShiftValue( void ) {
- // return((BYTE)(gps->tvg_cc_channel));
- return PS_Get_TVG_CC_Channel_Value();
- }
- void DisplayOperationalMessage(uchar message_index) {
- switch ( message_index ){
- case BUG_TVG:
- // ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array1));
- break;
- case BUG_NOTVG:
- // ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array2));
- break;
- case BUG_TVG_ACTIVE:
- // ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array3));
- break;
- case BUG_TVG_VERSION:
- // ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array4));
- break;
- }
- return;
- }
- void HostDispalyTVGMsg(void)
- {
- ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array1));
- }
- void MuteAudio( uchar enable, uchar *offset) {
- BYTE index;
- // if ( gps->tvg_cc != TVG_CC_ONCUSS )
- // return;
- index = ( gLine21MuteQueue_Write + 1 ) % LINE21MUTEQUEUESIZE;
- #ifdef _DEBUG
- //rtouts("Mute command: ");debug_out_bx(enable); rtouts(" Offset: "); debug_out_bx(*offset); rtouts(" GOP is: ");
- //debug_out_bx(Line21DataBufferPool[gLine21DataBufferPool_Write].GopCounter);
- //rtouts("Session ID: "); debug_out_bx(datain_session_id); rtouts("n");
- #endif
- if (index != gLine21MuteQueue_Read){
- Line21MuteQueue[index].mGOP = Line21DataBufferPool[gLine21DataBufferPool_Write].GopCounter;
- Line21MuteQueue[index].mCmd = (enable == 1 ) ? 1: 0;
- Line21MuteQueue[index].mOffset = (BYTE)((*offset) >> 1);
- gLine21MuteQueue_Write = index;
- #if 0
- if ( enable ){
- Line21MuteQueue[index].mMute = (BYTE)((*offset)<<1);
- Line21MuteQueue[index].mGOP = Line21DataBufferPool[gLine21DataBufferPool_Write].GopCounter;
- // mute_sem ++;
- gLine21MuteQueue_Write = index;
- }
- else{
- // if ( mute_sem){
- Line21MuteQueue[index].mUNMute = (BYTE)((*offset)<<1);
- Line21MuteQueue[index].mGOP = Line21DataBufferPool[gLine21DataBufferPool_Write].GopCounter;
- // mute_sem --;
- gLine21MuteQueue_Write = index;
- // }
- // else
- //dbouts("Ignore unmute commandn");
- }
- #endif
- }
- else
- dbg_printf(("Not enough Mute Queue!n"));
- return;
- }
- #endif //TV_GUARDIAN_ENABLE