Home AMX User Forum AMX General Discussion

Vbrick codecs

I have been working with the vbrick 5200 and 6200 codecs. They seem to be a little difficult to program, very picky on the login and logout of the vbrick.
I was wondering if anyone had any code or had found a very successful way to monitor these codecs, and if so was it done over IP or serial?
Let me know.
Seth C. olle

Comments

  • AMXJeffAMXJeff Posts: 450
    setholle wrote:
    I have been working with the vbrick 5200 and 6200 codecs. They seem to be a little difficult to program, very picky on the login and logout of the vbrick.
    I was wondering if anyone had any code or had found a very successful way to monitor these codecs, and if so was it done over IP or serial?
    Let me know.
    Seth C. olle

    I do not know how different the 5200 and 6200 are to the 3000. But here is a module that controls the 3000, maybe it can give you some incite.
    MODULE_NAME='VBrick 3000,Rev 0' (Dev dvCodec, Dev vdvCodec, Char cIPAddress[]
                                                              , Char cLoginName[]
                                                              , Char cLoginPass[])
    (*{{PS_SOURCE_INFO(PROGRAM STATS)                          *)
    (***********************************************************)
    (*  FILE CREATED ON: 10/18/2002 AT: 15:11:12               *)
    (***********************************************************)
    (*  FILE_LAST_MODIFIED_ON: 04/30/2003 AT: 23:11:47         *)
    (***********************************************************)
    (*  ORPHAN_FILE_PLATFORM: 1                                *)
    (***********************************************************)
    (*!!FILE REVISION: Rev 0                                   *)
    (*  REVISION DATE: 04/29/2003                              *)
    (*                                                         *)
    (*  COMMENTS:                                              *)
    (*                                                         *)
    (***********************************************************)
    (*!!FILE REVISION: Rev 0                                   *)
    (*  REVISION DATE: 10/21/2002                              *)
    (*                                                         *)
    (*  COMMENTS:                                              *)
    (*                                                         *)
    (***********************************************************)
    (*!!FILE REVISION:                                         *)
    (*  REVISION DATE: 10/18/2002                              *)
    (*                                                         *)
    (*  COMMENTS:                                              *)
    (*                                                         *)
    (***********************************************************)
    (*}}PS_SOURCE_INFO                                         *)
    (***********************************************************)
    
    (***********************************************************)
    (* System Type : Netlinx                                   *)
    (***********************************************************)
    (* REV HISTORY:                                            *)
    (***********************************************************)
    
    (***********************************************************)
    (*          DEVICE NUMBER DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_DEVICE
    dvdCodec  = Dynamic_Virtual_Device
    (***********************************************************)
    (*               CONSTANT DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_CONSTANT
    
    // TimeLines
    TL_AUDIO_RAISE_RT         = 1;
    TL_AUDIO_LOWER_RT         = 2;
    TL_AUDIO_RAISE_LT         = 3;
    TL_AUDIO_LOWER_LT         = 4;
    TL_VIDEO_CONTRAST_RAISE   = 5;
    TL_VIDEO_CONTRAST_LOWER   = 6;
    TL_VIDEO_HUE_RAISE        = 7;
    TL_VIDEO_HUE_LOWER        = 8;
    TL_VIDEO_SAT_RAISE        = 9;
    TL_VIDEO_SAT_LOWER        = 10;
    TL_VIDEO_BRIT_RAISE       = 11;
    TL_VIDEO_BRIT_LOWER       = 12;
    TL_MAINLINE               = 13;
    
    // Decoder Audio
    DECODE_AUD_MUTE           = 1;
    DECODE_AUD_MONO           = 2;
    DECODE_AUD_STEREO         = 3;
    
    // Decoder Video
    DECODE_VID_START          = 4;
    DECODE_VID_STOP           = 5;
    DECODE_VID_OUT_NTSC       = 6;
    DECODE_VID_OUT_PAL        = 7;
    DECODE_VID_IN_MPEG1       = 8;
    DECODE_VID_IN_MPEG2       = 9;
    
    // Encoder Audio
    ENCODE_AUD_START          = 10;
    ENCODE_AUD_STOP           = 11;
    ENCODE_AUD_MODE_MONO      = 12;
    ENCODE_AUD_MODE_STEREO    = 13;
    ENCODE_AUD_MODE_DUAL      = 14;
    ENCODE_AUD_MODE_JOINT_0   = 15;
    ENCODE_AUD_MODE_JOINT_1   = 16;
    ENCODE_AUD_MODE_JOINT_2   = 17;
    ENCODE_AUD_MODE_JOINT_3   = 18;
    ENCODE_AUD_BIT_RATE_65K   = 19;
    ENCODE_AUD_BIT_RATE_80K   = 20;
    ENCODE_AUD_BIT_RATE_96K   = 21;
    ENCODE_AUD_BIT_RATE_112K  = 22;
    ENCODE_AUD_BIT_RATE_128K  = 23;
    ENCODE_AUD_BIT_RATE_160K  = 24;
    ENCODE_AUD_BIT_RATE_192K  = 25;
    ENCODE_AUD_VOL_RAISE_LT   = 26;
    ENCODE_AUD_VOL_LOWER_LT   = 27;
    ENCODE_AUD_VOL_STOP_LT    = 28;
    ENCODE_AUD_VOL_RAISE_RT   = 29;
    ENCODE_AUD_VOL_LOWER_RT   = 30;
    ENCODE_AUD_VOL_STOP_RT    = 31;
    ENCODE_AUD_VOL_LEVEL_LT   = 32;
    ENCODE_AUD_VOL_LEVEL_RT   = 33;
    
    // Encoder Video
    ENCODE_VID_START          = 34;
    ENCODE_VID_STOP           = 35;
    ENCODE_VID_NTSC_SIF       = 36;
    ENCODE_VID_PAL_SIF        = 37;
    ENCODE_VID_NTSC_QSIF      = 38;
    ENCODE_VID_PAL_QSIF       = 39;
    ENCODE_VID_BIT_RATE_1M    = 40;
    ENCODE_VID_BIT_RATE_1_5M  = 41;
    ENCODE_VID_BIT_RATE_2M    = 42;
    ENCODE_VID_BIT_RATE_2_5M  = 43;
    ENCODE_VID_BIT_RATE_3M    = 44;
    ENCODE_VID_CONT_RAISE     = 45;
    ENCODE_VID_CONT_LOWER     = 46;
    ENCODE_VID_CONT_STOP      = 47;
    ENCODE_VID_HUE_RAISE      = 48;
    ENCODE_VID_HUE_LOWER      = 49;
    ENCODE_VID_HUE_STOP       = 50;
    ENCODE_VID_SATR_RAISE     = 51;
    ENCODE_VID_SATR_LOWER     = 52;
    ENCODE_VID_SATR_STOP      = 53;
    ENCODE_VID_BRIT_RAISE     = 54;
    ENCODE_VID_BRIT_LOWER     = 55;
    ENCODE_VID_BRIT_STOP      = 56;
    ENCODE_VID_IN_COMPOSITE   = 57;
    ENCODE_VID_IN_SVHS        = 58;
    ENCODE_VID_CONT_LEVEL     = 59;
    ENCODE_VID_HUE_LEVEL      = 60;
    ENCODE_VID_SATR_LEVEL     = 61;
    ENCODE_VID_BRIT_LEVEL     = 62;
    
    // IP Config
    IP_XMIT_ENABLE            = 63;
    IP_XMIT_DISABLE           = 64;
    IP_XMIT_MODE_UNICAST      = 65;
    IP_XMIT_MODE_MULTICAST    = 66;
    IP_RCVE_MODE_UNICAST      = 67;
    IP_RCVE_MODE_MULTICAST    = 68;
    IP_SET_IP                 = 78;
    IP_SET_NET_MASK           = 79;
    IP_SET_GATEWAY            = 80;
    IP_SET_DST_IP             = 81;
    IP_SET_DST_PORT           = 82;
    IP_SET_RCV_IP             = 83;
    IP_SET_RCV_PORT           = 84;
    
    // Save Configuration
    SAVE_CONFIG               = 69;
    IP_APPLY_CHANGES          = 70;
    
    // Status
    STAT_DECODE_AUD           = 71;
    STAT_DECODE_VID           = 72;
    STAT_ENCODE_AUD           = 73;
    STAT_ENCODE_VID           = 74;
    STAT_IP_PROC              = 75;
    
    // Passwords              
    LOGIN_NAME                = 76;
    LOGIN_PASS                = 77;
    SET_LOGIN_NAME            = 85;
    SET_LOGIN_PASS            = 86;
    
    // Typical
    BUSY                      = 251;
    DEBUG                     = 252;
    
    // IP Socket
    SOCKET_OPEN               = 255;
    LOGGED_IN                 = 254;
    IP_PORT                   = 4429;
    TCP                       = 1;
    UDP                       = 2;
    
    // Status Flags
    COMMAND_COMPLETE          = 0;
    DECODER_AUDIO_OPT         = 1;
    DECODER_VIDEO_OPT         = 2;
    ENCODER_AUDIO_OPT         = 3;
    ENCODER_VIDEO_OPT         = 4;
    IP_OPTIONS                = 5;
    (***********************************************************)
    (*              DATA TYPE DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_TYPE
    
    Structure _IPInfo
    {
      Char cDHCP[25];
      Char cCodecIP[25];
      Char cCodecSubMask[25];
      Char cCodecGateway[25];
      Char cCodecHWInterface[25];
      Char cXmitMode[25];
      Char cDestIP[25];
      Char cDestPort[25];
      Char cJoinOwnMulti[25];
      Char cRcveMode[25];
      Char cRcveIP[25];
      Char cRcvePort[25];  
    }
    
    Structure _GainLevel
    {
      SInteger snLow;
      SInteger snMax;
      SInteger snInc;
      Integer nLowerTL;
      Integer nRaiseTL;
      SInteger snLevel;
    }
    (***********************************************************)
    (*               VARIABLE DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_VARIABLE
    Volatile _GainLevel uAudioVolumeLeft
    Volatile _GainLevel uAudioVolumeRight
    Volatile _GainLevel uVideoContrast
    Volatile _GainLevel uVideoHue
    Volatile _GainLevel uVideoSaturation
    Volatile _GainLevel uVideoBrightness
    Volatile _IPInfo uIPInfo
    Volatile Char cCodecQueue[2000];
    Volatile Char cCodecBuffer[2000];
    Volatile Integer nCodecStatFlags;
    Volatile Long lTLTimes[] = {500};    
    Volatile Long lTLMainTimes[] = {100};
    (***********************************************************)
    (*               LATCHING DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_LATCHING
    
    (***********************************************************)
    (*       MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW           *)
    (***********************************************************)
    DEFINE_MUTUALLY_EXCLUSIVE
    
    (***********************************************************)
    (*        SUBROUTINE/FUNCTION DEFINITIONS GO BELOW         *)
    (***********************************************************)
    (* EXAMPLE: DEFINE_FUNCTION <RETURN_TYPE> <NAME> (<PARAMETERS>) *)
    (* EXAMPLE: DEFINE_CALL '<NAME>' (<PARAMETERS>) *)
    
    
    Define_Function InitGainLevel(_GainLevel uLevel,SInteger snLow
                                                   ,SInteger snMax
                                                   ,SInteger snInc
                                                   ,Integer nLowerTL
                                                   ,Integer nRaiseTL
                                                   ,SInteger snLevel)
    {
      uLevel.snLow    = snLow;
      uLevel.snMax    = snMax;
      uLevel.snInc    = snInc;
      uLevel.nLowerTL = nLowerTL;
      uLevel.nRaiseTL = nRaiseTL;
      uLevel.snLevel  = snLevel;
    }                                               
    Define_Function TimelineCreate(Long lTimelineID,Long TimelineTimes[],Long TimeLineQty,Integer nRelative,Integer nOnce)
    {
      If (!TIMELINE_ACTIVE(lTimelineID))
      {
        Timeline_Create(lTimelineID,TimelineTimes,TimeLineQty,nRelative,nOnce);
      }
    }
    
    Define_Function TimelineKill(Long lTimelineID)
    {
      If (TIMELINE_ACTIVE(lTimelineID))
      {
        Timeline_Kill(lTimelineID);
      }
    }
    
    Define_Function Integer ConvertLevels(_GainLevel uLevel)
    {
      Return Type_Cast(((uLevel.snLevel-uLevel.snLow) * 255) / (uLevel.snMax-uLevel.snLow))
    }
    
    Define_Function RaiseLevels(_GainLevel uLevel)
    {
      Select
      {
        // Will Not Wrap Around
        Active ((uLevel.snLevel + uLevel.snInc) < uLevel.snMax):
          uLevel.snLevel = uLevel.snLevel + uLevel.snInc;
        // Will Wrap Around
        Active (uLevel.snLevel <> uLevel.snMax):
          uLevel.snLevel = uLevel.snMax
        Active (1):
          Timeline_Kill(uLevel.nRaiseTL);
      }  
    }
    
    Define_Function LowerLevels(_GainLevel uLevel)
    {
      Select
      {
        // Will Not Wrap Around
        Active ((uLevel.snLevel - uLevel.snInc) > uLevel.snLow):
          uLevel.snLevel = uLevel.snLevel - uLevel.snInc;
        // Will Wrap Around
        Active (uLevel.snLevel <> uLevel.snLow):
          uLevel.snLevel = uLevel.snLow;
        Active (1):
          Timeline_Kill(uLevel.nLowerTL);
      }  
    }
    
    Define_Function CommServer()
    {
      IF ((![vdvCodec,SOCKET_OPEN]) and Length_String(cIPAddress) and dvCodec.Number == 0 and Length_String(cCodecQueue))
      {
        IP_CLIENT_OPEN(dvCodec.Port,cIPAddress,IP_PORT,TCP);
      }
        
      If ([vdvCodec,LOGGED_IN])
        PopOffQueue()
    }
    
    Define_Function PopOffQueue()
    {
      If (![vdvCodec,BUSY] and Length_String(cCodecQueue))
      {
        Send_String dvCodec,"Remove_String(cCodecQueue,"13",1)";
        Set_Pulse_Time(40);
        Pulse[dvdCodec,BUSY]
        Set_Pulse_Time(5);
        
        Cancel_Wait 'Close Ip Socket'
        Wait 100 'Close Ip Socket'
        {
          IP_CLIENT_CLOSE(dvCodec.Port);
        }
      }  
    }
    
    Define_Function PushBackQueue(Char cMsg[])
    {
      cCodecQueue = "cCodecQueue,cMsg,13"  
    }
    
    Define_Function PushBackStack(Char cMsg[])
    {
      cCodecQueue = "cMsg,cCodecQueue,13"  
    }
    
    Define_Function CodecFunc(Dev dvCodec,Integer nFunc,Char cData[])
    {
      Stack_Var Char cMsg[100];  
      
      Switch (nFunc)
      {
        Case DECODE_AUD_MUTE:
        {    
          cMsg = 'CDA:3:1';
          On[dvdCodec,DECODE_AUD_MUTE];
          Off[dvdCodec,DECODE_AUD_MONO];
          Off[dvdCodec,DECODE_AUD_STEREO];
        }
        Case DECODE_AUD_MONO:
        {
          cMsg = 'CDA:3:2';
          Off[dvdCodec,DECODE_AUD_MUTE];
          On[dvdCodec,DECODE_AUD_MONO];
          Off[dvdCodec,DECODE_AUD_STEREO];
        }
        Case DECODE_AUD_STEREO:
        {
          cMsg = 'CDA:3:3';
          Off[dvdCodec,DECODE_AUD_MUTE];
          Off[dvdCodec,DECODE_AUD_MONO];
          On[dvdCodec,DECODE_AUD_STEREO];    
        }
        Case DECODE_VID_START:
        {
          cMsg = 'CDV:2';
          On[dvdCodec,DECODE_VID_START];
          Off[dvdCodec,DECODE_VID_STOP];
        }
        Case DECODE_VID_STOP:
        {
          cMsg = 'CDV:3';    
          Off[dvdCodec,DECODE_VID_START];
          On[dvdCodec,DECODE_VID_STOP];    
        }
        Case DECODE_VID_OUT_NTSC:
        {
          cMsg = 'CDV:5:1';    
          On[dvdCodec,DECODE_VID_OUT_NTSC];
          Off[dvdCodec,DECODE_VID_OUT_PAL];
        }
        Case DECODE_VID_OUT_PAL:
        {
          cMsg = 'CDV:5:2';     
          Off[dvdCodec,DECODE_VID_OUT_NTSC];
          On[dvdCodec,DECODE_VID_OUT_PAL];    
        }
        Case DECODE_VID_IN_MPEG1:
        {
          cMsg = 'CDV:6:1';    
          On[dvdCodec,DECODE_VID_IN_MPEG1];
          Off[dvdCodec,DECODE_VID_IN_MPEG2];
        }
        Case DECODE_VID_IN_MPEG2:
        {
          cMsg = 'CDV:6:2';    
          Off[dvdCodec,DECODE_VID_IN_MPEG1];
          On[dvdCodec,DECODE_VID_IN_MPEG2];
        }
        Case ENCODE_AUD_START:
        {
          cMsg = 'CEA:2';
          On[dvdCodec,ENCODE_AUD_START];
          Off[dvdCodec,ENCODE_AUD_STOP];
        }
        Case ENCODE_AUD_STOP:
        {
          cMsg = 'CEA:3';
          Off[dvdCodec,ENCODE_AUD_START];
          On[dvdCodec,ENCODE_AUD_STOP];    
        }
        Case ENCODE_AUD_MODE_MONO:
        {
          cMsg = 'CEA:5:1';
          On[dvdCodec,ENCODE_AUD_MODE_MONO];
          Off[dvdCodec,ENCODE_AUD_MODE_STEREO];
          Off[dvdCodec,ENCODE_AUD_MODE_DUAL];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_0];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_1];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_2];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_3];
        }
        Case ENCODE_AUD_MODE_STEREO:
        {
          cMsg = 'CEA:5:2';
          Off[dvdCodec,ENCODE_AUD_MODE_MONO];
          On[dvdCodec,ENCODE_AUD_MODE_STEREO];
          Off[dvdCodec,ENCODE_AUD_MODE_DUAL];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_0];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_1];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_2];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_3];    
        }
        Case ENCODE_AUD_MODE_DUAL:
        {
          cMsg = 'CEA:5:3';
          Off[dvdCodec,ENCODE_AUD_MODE_MONO];
          Off[dvdCodec,ENCODE_AUD_MODE_STEREO];
          On[dvdCodec,ENCODE_AUD_MODE_DUAL];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_0];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_1];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_2];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_3];
        }
        Case ENCODE_AUD_MODE_JOINT_0:
        {
          cMsg = 'CEA:5:4';        
          Off[dvdCodec,ENCODE_AUD_MODE_MONO];
          Off[dvdCodec,ENCODE_AUD_MODE_STEREO];
          Off[dvdCodec,ENCODE_AUD_MODE_DUAL];
          On[dvdCodec,ENCODE_AUD_MODE_JOINT_0];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_1];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_2];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_3];    
        }
        Case ENCODE_AUD_MODE_JOINT_1:
        {
          cMsg = 'CEA:5:5';    
          Off[dvdCodec,ENCODE_AUD_MODE_MONO];
          Off[dvdCodec,ENCODE_AUD_MODE_STEREO];
          Off[dvdCodec,ENCODE_AUD_MODE_DUAL];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_0];
          On[dvdCodec,ENCODE_AUD_MODE_JOINT_1];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_2];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_3];    
        }
        Case ENCODE_AUD_MODE_JOINT_2:
        {
          cMsg = 'CEA:5:6';    
          Off[dvdCodec,ENCODE_AUD_MODE_MONO];
          Off[dvdCodec,ENCODE_AUD_MODE_STEREO];
          Off[dvdCodec,ENCODE_AUD_MODE_DUAL];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_0];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_1];
          On[dvdCodec,ENCODE_AUD_MODE_JOINT_2];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_3];    
        }
        Case ENCODE_AUD_MODE_JOINT_3:
        {
          cMsg = 'CEA:5:7';    
          Off[dvdCodec,ENCODE_AUD_MODE_MONO];
          Off[dvdCodec,ENCODE_AUD_MODE_STEREO];
          Off[dvdCodec,ENCODE_AUD_MODE_DUAL];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_0];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_1];
          Off[dvdCodec,ENCODE_AUD_MODE_JOINT_2];
          On[dvdCodec,ENCODE_AUD_MODE_JOINT_3];    
        }
        Case ENCODE_AUD_BIT_RATE_65K:
        {
          cMsg = 'CEA:6:4';
          On[dvdCodec,ENCODE_AUD_BIT_RATE_65K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_80K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_96K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_112K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_128K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_160K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_192K];
        }
        Case ENCODE_AUD_BIT_RATE_80K:
        {
          cMsg = 'CEA:6:5';    
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_65K];
          On[dvdCodec,ENCODE_AUD_BIT_RATE_80K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_96K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_112K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_128K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_160K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_192K];    
        }
        Case ENCODE_AUD_BIT_RATE_96K:
        {
          cMsg = 'CEA:6:6';    
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_65K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_80K];
          On[dvdCodec,ENCODE_AUD_BIT_RATE_96K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_112K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_128K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_160K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_192K];    
        }
        Case ENCODE_AUD_BIT_RATE_112K:
        {
          cMsg = 'CEA:6:7';    
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_65K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_80K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_96K];
          On[dvdCodec,ENCODE_AUD_BIT_RATE_112K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_128K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_160K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_192K];    
        }
        Case ENCODE_AUD_BIT_RATE_128K:
        {
          cMsg = 'CEA:6:8';    
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_65K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_80K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_96K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_112K];
          On[dvdCodec,ENCODE_AUD_BIT_RATE_128K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_160K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_192K];    
        }
        Case ENCODE_AUD_BIT_RATE_160K:
        {
          cMsg = 'CEA:6:9';    
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_65K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_80K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_96K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_112K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_128K];
          On[dvdCodec,ENCODE_AUD_BIT_RATE_160K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_192K];    
        }
        Case ENCODE_AUD_BIT_RATE_192K:
        {
          cMsg = 'CEA:6:10';    
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_65K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_80K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_96K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_112K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_128K];
          Off[dvdCodec,ENCODE_AUD_BIT_RATE_160K];
          On[dvdCodec,ENCODE_AUD_BIT_RATE_192K];    
        }
        Case ENCODE_AUD_VOL_LEVEL_LT:
        {
          PushBackStack("'CEA:7:',cData")
        }
        Case ENCODE_AUD_VOL_LEVEL_RT:
        {
          PushBackStack("'CEA:8:',cData")
        }    
        Case ENCODE_AUD_VOL_RAISE_LT:
        {      
          RaiseLevels(uAudioVolumeLeft);
          CodecFunc(dvCodec,ENCODE_AUD_VOL_LEVEL_LT,Itoa(uAudioVolumeRight.snLevel));
          TimelineKill(TL_AUDIO_LOWER_LT);
          TimelineCreate(TL_AUDIO_RAISE_LT,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);      
          On[dvdCodec,ENCODE_AUD_VOL_RAISE_LT];
          Off[dvdCodec,ENCODE_AUD_VOL_LOWER_LT];
          Off[dvdCodec,ENCODE_AUD_VOL_STOP_LT];
        }
        Case ENCODE_AUD_VOL_LOWER_LT:
        {
          RaiseLevels(uAudioVolumeLeft);
          CodecFunc(dvCodec,ENCODE_AUD_VOL_LEVEL_LT,Itoa(uAudioVolumeRight.snLevel));    
          TimelineKill(TL_AUDIO_RAISE_LT);
          TimelineCreate(TL_AUDIO_LOWER_LT,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);
          Off[dvdCodec,ENCODE_AUD_VOL_RAISE_LT];
          On[dvdCodec,ENCODE_AUD_VOL_LOWER_LT];
          Off[dvdCodec,ENCODE_AUD_VOL_STOP_LT];    
        }
        Case ENCODE_AUD_VOL_STOP_LT:
        {
          TimelineKill(TL_AUDIO_RAISE_LT);
          TimelineKill(TL_AUDIO_LOWER_LT);
          Off[dvdCodec,ENCODE_AUD_VOL_RAISE_LT];
          Off[dvdCodec,ENCODE_AUD_VOL_LOWER_LT];
          On[dvdCodec,ENCODE_AUD_VOL_STOP_LT];    
        }
        Case ENCODE_AUD_VOL_RAISE_RT:
        {
          RaiseLevels(uAudioVolumeRight);
          CodecFunc(dvCodec,ENCODE_AUD_VOL_LEVEL_RT,Itoa(uAudioVolumeRight.snLevel));
          TimelineKill(TL_AUDIO_LOWER_RT);
          TimelineCreate(TL_AUDIO_RAISE_RT,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);
          On[dvdCodec,ENCODE_AUD_VOL_RAISE_RT];
          Off[dvdCodec,ENCODE_AUD_VOL_LOWER_RT];
          Off[dvdCodec,ENCODE_AUD_VOL_STOP_RT];
        }
        Case ENCODE_AUD_VOL_LOWER_RT:
        {
          RaiseLevels(uAudioVolumeRight);
          CodecFunc(dvCodec,ENCODE_AUD_VOL_LEVEL_RT,Itoa(uAudioVolumeRight.snLevel));      
          TimelineKill(TL_AUDIO_RAISE_RT);
          TimelineCreate(TL_AUDIO_LOWER_RT,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);
          Off[dvdCodec,ENCODE_AUD_VOL_RAISE_RT];
          On[dvdCodec,ENCODE_AUD_VOL_LOWER_RT];
          Off[dvdCodec,ENCODE_AUD_VOL_STOP_RT];
        }
        Case ENCODE_AUD_VOL_STOP_RT:
        {
          TimelineKill(TL_AUDIO_RAISE_RT);
          TimelineKill(TL_AUDIO_LOWER_RT);
          Off[dvdCodec,ENCODE_AUD_VOL_RAISE_RT];
          Off[dvdCodec,ENCODE_AUD_VOL_LOWER_RT];
          On[dvdCodec,ENCODE_AUD_VOL_STOP_RT];
        }
        Case ENCODE_VID_START:
        {
          cMsg = 'CEV:2';
          On[dvdCodec,ENCODE_VID_START];
          Off[dvdCodec,ENCODE_VID_STOP];    
        }
        Case ENCODE_VID_STOP:
        {
          cMsg = 'CEV:3';    
          Off[dvdCodec,ENCODE_VID_START];
          On[dvdCodec,ENCODE_VID_STOP];    
        }
        Case ENCODE_VID_NTSC_SIF:
        {
          cMsg = 'CEV:4:1';
          On[dvdCodec,ENCODE_VID_NTSC_SIF];
          Off[dvdCodec,ENCODE_VID_PAL_SIF];
          Off[dvdCodec,ENCODE_VID_NTSC_QSIF];
          Off[dvdCodec,ENCODE_VID_PAL_QSIF];
        }
        Case ENCODE_VID_PAL_SIF:
        {
          cMsg = 'CEV:4:2';    
          Off[dvdCodec,ENCODE_VID_NTSC_SIF];
          On[dvdCodec,ENCODE_VID_PAL_SIF];
          Off[dvdCodec,ENCODE_VID_NTSC_QSIF];
          Off[dvdCodec,ENCODE_VID_PAL_QSIF];    
        }
        Case ENCODE_VID_NTSC_QSIF:
        {
          cMsg = 'CEV:4:3';    
          Off[dvdCodec,ENCODE_VID_NTSC_SIF];
          Off[dvdCodec,ENCODE_VID_PAL_SIF];
          On[dvdCodec,ENCODE_VID_NTSC_QSIF];
          Off[dvdCodec,ENCODE_VID_PAL_QSIF];    
        }
        Case ENCODE_VID_PAL_QSIF:
        {
          cMsg = 'CEV:4:4';    
          Off[dvdCodec,ENCODE_VID_NTSC_SIF];
          Off[dvdCodec,ENCODE_VID_PAL_SIF];
          Off[dvdCodec,ENCODE_VID_NTSC_QSIF];
          On[dvdCodec,ENCODE_VID_PAL_QSIF];    
        }
        Case ENCODE_VID_BIT_RATE_1M:
        {
          cMsg = 'CEV:5:1000';
          On[dvdCodec,ENCODE_VID_BIT_RATE_1M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_1_5M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_2M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_2_5M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_3M];    
        }
        Case ENCODE_VID_BIT_RATE_1_5M:
        {
          cMsg = 'CEV:5:1500';
          Off[dvdCodec,ENCODE_VID_BIT_RATE_1M];
          On[dvdCodec,ENCODE_VID_BIT_RATE_1_5M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_2M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_2_5M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_3M];    
        }
        Case ENCODE_VID_BIT_RATE_2M:
        {
          cMsg = 'CEV:5:2000';
          Off[dvdCodec,ENCODE_VID_BIT_RATE_1M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_1_5M];
          On[dvdCodec,ENCODE_VID_BIT_RATE_2M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_2_5M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_3M];    
        }
        Case ENCODE_VID_BIT_RATE_2_5M:
        {
          cMsg = 'CEV:5:2500';
          Off[dvdCodec,ENCODE_VID_BIT_RATE_1M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_1_5M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_2M];
          On[dvdCodec,ENCODE_VID_BIT_RATE_2_5M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_3M];        
        }
        Case ENCODE_VID_BIT_RATE_3M:
        {
          cMsg = 'CEV:5:3000';    
          Off[dvdCodec,ENCODE_VID_BIT_RATE_1M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_1_5M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_2M];
          Off[dvdCodec,ENCODE_VID_BIT_RATE_2_5M];
          On[dvdCodec,ENCODE_VID_BIT_RATE_3M];    
        }
        Case ENCODE_VID_IN_COMPOSITE:
        {
          cMsg = 'CEV:9:1';    
          On[dvdCodec,ENCODE_VID_IN_COMPOSITE];
          Off[dvdCodec,ENCODE_VID_IN_SVHS];    
        }
        Case ENCODE_VID_IN_SVHS:
        {
          cMsg = 'CEV:9:2';    
          Off[dvdCodec,ENCODE_VID_IN_COMPOSITE];
          On[dvdCodec,ENCODE_VID_IN_SVHS];    
        }
        Case ENCODE_VID_BRIT_LEVEL:
        {
          PushBackStack("'CEV:10:',cData")    
        }    
        Case ENCODE_VID_CONT_LEVEL:
        {
          PushBackStack("'CEV:11:',cData")
        }
        Case ENCODE_VID_HUE_LEVEL:
        {
          PushBackStack("'CEV:12:',cData")
        }
        Case ENCODE_VID_SATR_LEVEL:
        {
          PushBackStack("'CEV:13:',cData")
        }
        Case ENCODE_VID_CONT_RAISE:
        {
          RaiseLevels(uVideoContrast);
          CodecFunc(dvCodec,ENCODE_VID_CONT_LEVEL,Itoa(uVideoContrast.snLevel));
          TimelineKill(TL_VIDEO_CONTRAST_LOWER);      
          TimelineCreate(TL_VIDEO_CONTRAST_RAISE,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);
          On[dvdCodec,ENCODE_VID_CONT_RAISE];
          Off[dvdCodec,ENCODE_VID_CONT_LOWER];
          Off[dvdCodec,ENCODE_VID_CONT_STOP];
        }
        Case ENCODE_VID_CONT_LOWER:
        { 
          LowerLevels(uVideoContrast);
          CodecFunc(dvCodec,ENCODE_VID_CONT_LEVEL,Itoa(uVideoContrast.snLevel));
          TimelineKill(TL_VIDEO_CONTRAST_RAISE);
          TimelineCreate(TL_VIDEO_CONTRAST_LOWER,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);
          Off[dvdCodec,ENCODE_VID_CONT_RAISE];
          On[dvdCodec,ENCODE_VID_CONT_LOWER];
          Off[dvdCodec,ENCODE_VID_CONT_STOP];    
        }
        Case ENCODE_VID_CONT_STOP:
        {
          TimelineKill(TL_VIDEO_CONTRAST_RAISE);
          TimelineKill(TL_VIDEO_CONTRAST_LOWER)    
          Off[dvdCodec,ENCODE_VID_CONT_RAISE];
          Off[dvdCodec,ENCODE_VID_CONT_LOWER];
          On[dvdCodec,ENCODE_VID_CONT_STOP];    
        }
        Case ENCODE_VID_HUE_RAISE:
        {
          RaiseLevels(uVideoHue);
          CodecFunc(dvCodec,ENCODE_VID_HUE_LEVEL,Itoa(uVideoHue.snLevel));
          TimelineKill(TL_VIDEO_HUE_LOWER);      
          TimelineCreate(TL_VIDEO_HUE_RAISE,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);      
          On[dvdCodec,ENCODE_VID_HUE_RAISE];
          Off[dvdCodec,ENCODE_VID_HUE_LOWER];
          Off[dvdCodec,ENCODE_VID_HUE_STOP];    
        }
        Case ENCODE_VID_HUE_LOWER:
        {
          RaiseLevels(uVideoHue);
          CodecFunc(dvCodec,ENCODE_VID_HUE_LEVEL,Itoa(uVideoHue.snLevel));
          TimelineKill(TL_VIDEO_HUE_RAISE);
          TimelineCreate(TL_VIDEO_HUE_LOWER,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);      
          Off[dvdCodec,ENCODE_VID_HUE_RAISE];
          On[dvdCodec,ENCODE_VID_HUE_LOWER];
          Off[dvdCodec,ENCODE_VID_HUE_STOP];    
        }
        Case ENCODE_VID_HUE_STOP:
        {
          TimelineKill(TL_VIDEO_HUE_RAISE);
          TimelineKill(TL_VIDEO_HUE_LOWER);    
          Off[dvdCodec,ENCODE_VID_HUE_RAISE];
          Off[dvdCodec,ENCODE_VID_HUE_LOWER];
          On[dvdCodec,ENCODE_VID_HUE_STOP];    
        }
        Case ENCODE_VID_SATR_RAISE:
        {      
          RaiseLevels(uVideoSaturation);
          CodecFunc(dvCodec,ENCODE_VID_SATR_LEVEL,Itoa(uVideoSaturation.snLevel)); 
          TimelineKill(TL_VIDEO_SAT_LOWER);  
          TimelineCreate(TL_VIDEO_SAT_RAISE,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);      
          On[dvdCodec,ENCODE_VID_SATR_RAISE];
          Off[dvdCodec,ENCODE_VID_SATR_LOWER];
          Off[dvdCodec,ENCODE_VID_SATR_STOP];    
        }
        Case ENCODE_VID_SATR_LOWER:
        {
          LowerLevels(uVideoSaturation);
          CodecFunc(dvCodec,ENCODE_VID_SATR_LEVEL,Itoa(uVideoSaturation.snLevel)); 
          TimelineKill(TL_VIDEO_SAT_RAISE);
          TimelineCreate(TL_VIDEO_SAT_LOWER,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);        
          Off[dvdCodec,ENCODE_VID_SATR_RAISE];
          On[dvdCodec,ENCODE_VID_SATR_LOWER];
          Off[dvdCodec,ENCODE_VID_SATR_STOP];    
        }
        Case ENCODE_VID_SATR_STOP:
        {
          TimelineKill(TL_VIDEO_SAT_RAISE);
          TimelineKill(TL_VIDEO_SAT_LOWER);    
          Off[dvdCodec,ENCODE_VID_SATR_RAISE];
          Off[dvdCodec,ENCODE_VID_SATR_LOWER];
          On[dvdCodec,ENCODE_VID_SATR_STOP];    
        }
        Case ENCODE_VID_BRIT_RAISE:
        {   
          RaiseLevels(uVideoBrightness);
          CodecFunc(dvCodec,ENCODE_VID_BRIT_LEVEL,Itoa(uVideoBrightness.snLevel));
          TimelineKill(TL_VIDEO_BRIT_LOWER);      
          TimelineCreate(TL_VIDEO_BRIT_RAISE,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);
          On[dvdCodec,ENCODE_VID_BRIT_RAISE];
          Off[dvdCodec,ENCODE_VID_BRIT_LOWER];
          Off[dvdCodec,ENCODE_VID_BRIT_STOP];    
        }
        Case ENCODE_VID_BRIT_LOWER:
        {
          LowerLevels(uVideoBrightness);
          CodecFunc(dvCodec,ENCODE_VID_BRIT_LEVEL,Itoa(uVideoBrightness.snLevel));
          TimelineKill(TL_VIDEO_BRIT_RAISE);
          TimelineCreate(TL_VIDEO_BRIT_LOWER,lTLTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT);
          Off[dvdCodec,ENCODE_VID_BRIT_RAISE];
          On[dvdCodec,ENCODE_VID_BRIT_LOWER];
          Off[dvdCodec,ENCODE_VID_BRIT_STOP];    
        }
        Case ENCODE_VID_BRIT_STOP:
        {
          TimelineKill(TL_VIDEO_BRIT_RAISE);
          TimelineKill(TL_VIDEO_BRIT_LOWER);    
          Off[dvdCodec,ENCODE_VID_BRIT_RAISE];
          Off[dvdCodec,ENCODE_VID_BRIT_LOWER];
          On[dvdCodec,ENCODE_VID_BRIT_STOP];    
        }
        Case IP_XMIT_ENABLE:
        {
          cMsg = 'CIP:19:2';
          On[dvdCodec,IP_XMIT_ENABLE];
          Off[dvdCodec,IP_XMIT_DISABLE];
        }
        Case IP_XMIT_DISABLE:
        {
          cMsg = 'CIP:19:1';    
          Off[dvdCodec,IP_XMIT_ENABLE];
          On[dvdCodec,IP_XMIT_DISABLE];    
        }
        Case IP_XMIT_MODE_UNICAST:
        {
          cMsg = 'CIP:7:1';
          On[dvdCodec,IP_XMIT_MODE_UNICAST];
          Off[dvdCodec,IP_XMIT_MODE_MULTICAST];    
        }
        Case IP_XMIT_MODE_MULTICAST:
        {
          cMsg = 'CIP:7:2';    
          Off[dvdCodec,IP_XMIT_MODE_UNICAST];
          On[dvdCodec,IP_XMIT_MODE_MULTICAST];    
        }
        Case IP_RCVE_MODE_UNICAST:
        {
          cMsg = 'CIP:10:1';    
          On[dvdCodec,IP_RCVE_MODE_UNICAST];
          Off[dvdCodec,IP_RCVE_MODE_MULTICAST];    
        }
        Case IP_RCVE_MODE_MULTICAST:
        {
          cMsg = 'CIP:10:2';    
          Off[dvdCodec,IP_RCVE_MODE_UNICAST];
          On[dvdCodec,IP_RCVE_MODE_MULTICAST];    
        }
        Case STAT_DECODE_AUD:
        {
          cMsg = 'CDA:1';
          Pulse[dvdCodec,STAT_DECODE_AUD];
        }
        Case STAT_DECODE_VID:
        {
          cMsg = 'CDV:1';
          Pulse[dvdCodec,STAT_DECODE_VID];    
        }
        Case STAT_ENCODE_AUD:
        {
          cMsg = 'CEA:1';
          Pulse[dvdCodec,STAT_ENCODE_AUD];    
        }
        Case STAT_ENCODE_VID:
        {
          cMsg = 'CEV:1';
          Pulse[dvdCodec,STAT_ENCODE_VID];    
        }
        Case STAT_IP_PROC:
        {
          cMsg = 'CIP:1';
          Pulse[dvdCodec,STAT_IP_PROC];    
        }
        Case LOGIN_NAME:
        {
          Send_String dvCodec,"cData,13"
        }
        Case LOGIN_PASS:
        {
          Send_String dvCodec,"cData,13"
        }
        Case IP_SET_IP:
        {
          cMsg = "'CIP:3:',cData";
          Pulse[dvdCodec,IP_SET_IP];
        }
        Case IP_SET_NET_MASK:
        {
          cMsg = "'CIP:4:',cData";
          Pulse[dvdCodec,IP_SET_NET_MASK];
        }
        Case IP_SET_GATEWAY:
        {
          cMsg = "'CIP:5:',cData";
          Pulse[dvdCodec,IP_SET_GATEWAY];
        }
        Case IP_SET_DST_IP:
        {
          cMsg = "'CIP:8:',cData";
          Pulse[dvdCodec,IP_SET_DST_IP];
        }
        Case IP_SET_DST_PORT:
        {
          cMsg = "'CIP:9:',cData";
          Pulse[dvdCodec,IP_SET_DST_PORT]; 
        }
        Case IP_SET_RCV_IP:
        {
          cMsg = "'CIP:11:',cData";
          Pulse[dvdCodec,IP_SET_RCV_IP];
        }
        Case IP_SET_RCV_PORT:
        {
          cMsg = "'CIP:12:',cData";
          Pulse[dvdCodec,IP_SET_RCV_PORT];
        }
        Case IP_APPLY_CHANGES:
        {
          cMsg = "'CIP:22'";    
          Pulse[dvdCodec,IP_APPLY_CHANGES];      
        }
        Case SET_LOGIN_NAME:
        {
          cMsg = "'CPW:2:',cData";
          Pulse[dvdCodec,SET_LOGIN_NAME];    
        }
        Case SET_LOGIN_PASS:
        {
          cMsg = "'CPW:3:',cData";
          Pulse[dvdCodec,SET_LOGIN_PASS];    
        }
      }
      
      If (Length_String(cMsg))
      {
        PushBackQueue(cMsg);
      }
    }   
    
    (* Send Command Parse **************************************)
    Define_Function ParseCommands(Char cCmd[])
    {  
      Stack_Var Char cTrash[100];
      
      cCmd = Upper_String(cCmd);  
      Select
      {
        Active (Find_String(cCmd,"'CODEC IP-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC IP-'",1);
          CodecFunc(dvCodec,IP_SET_IP,cCmd);
        }
        Active (Find_String(cCmd,"'CODEC NETMASK-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC NETMASK-'",1);
          CodecFunc(dvCodec,IP_SET_NET_MASK,cCmd);
        }
        Active (Find_String(cCmd,"'CODEC GATEWAY-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC GATEWAY-'",1);
          CodecFunc(dvCodec,IP_SET_GATEWAY,cCmd);
        }       
        Active (Find_String(cCmd,"'CODEC DEST IP-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC DEST IP-'",1);
          CodecFunc(dvCodec,IP_SET_DST_IP,cCmd);    
        }
        Active (Find_String(cCmd,"'CODEC RCVE IP-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC RCVE IP-'",1);
          CodecFunc(dvCodec,IP_SET_RCV_IP,cCmd);    
        }
        Active (Find_String(cCmd,"'CODEC DEST IP PORT-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC DEST IP PORT-'",1);
          CodecFunc(dvCodec,IP_SET_DST_PORT,cCmd);    
        }
        Active (Find_String(cCmd,"'CODEC RCVE IP PORT-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC RCVE IP PORT-'",1);
          CodecFunc(dvCodec,IP_SET_RCV_PORT,cCmd);      
        }
        Active (Find_String(cCmd,"'CODEC DECODE TYPE-UNICAST'",1)):
        {
          CodecFunc(dvCodec,IP_RCVE_MODE_UNICAST,cCmd); 
        }
        Active (Find_String(cCmd,"'CODEC DECODE TYPE-MULTICAST'",1)):
        {
          CodecFunc(dvCodec,IP_RCVE_MODE_MULTICAST,cCmd); 
        }
        Active (Find_String(cCmd,"'CODEC ENCODE TYPE-UNICAST'",1)):
        {
          CodecFunc(dvCodec,IP_XMIT_MODE_UNICAST,cCmd); 
        }
        Active (Find_String(cCmd,"'CODEC ENCODE TYPE-MULTICAST'",1)):
        {
          CodecFunc(dvCodec,IP_XMIT_MODE_MULTICAST,cCmd); 
        }
        Active (Find_String(cCmd,"'CODEC ENCODER STATE-RUN'",1)):
        {
          CodecFunc(dvCodec,IP_XMIT_ENABLE,cCmd); 
        }
        Active (Find_String(cCmd,"'CODEC ENCODER STATE-STOP'",1)):
        {
          CodecFunc(dvCodec,IP_XMIT_DISABLE,cCmd); 
        }    
        Active (Find_String(cCmd,"'CODEC LOGIN NAME-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC LOGIN NAME-'",1);   
          CodecFunc(dvCodec,SET_LOGIN_NAME,cCmd);     
        }
        Active (Find_String(cCmd,"'CODEC LOGIN PASS-'",1)):
        {
          cTrash = Remove_String(cCmd,"'CODEC LOGIN PASS-'",1);    
          CodecFunc(dvCodec,SET_LOGIN_PASS,cCmd);
        }
      }           
    }
    
    (* Incoming Buffer Parsing *********************************)
    Define_Function Char[1000] PickOutWord(Char cMsg[])
    {
      Stack_Var Char cTrash[100],cChar;
      Stack_Var Integer nIndex;
      
      Set_Length_String(cMsg,Length_String(cMsg)-1)
      cTrash = Remove_String(cMsg,':',1);   
      For (nIndex = 1;Left_String(cMsg,1) == ' ';nIndex++)
        cChar = Get_Buffer_Char(cMsg);
        
      Return cMsg;    
    }
    
    Define_Function ParseDecoderAudioOpt(Char cMsg[])
    {
      Select
      {
        Active (Find_String(cMsg,"'Mode:'",1)):
        {
          [dvdCodec,DECODE_AUD_MUTE]    = Find_String(cMsg,"'Mute'",1);
          [dvdCodec,DECODE_AUD_MONO]    = Find_String(cMsg,"'Monoaural'",1);
          [dvdCodec,DECODE_AUD_STEREO]  = Find_String(cMsg,"'Stereo'",1);
        }
        Active (Find_String(cMsg,"'Sampling Frequency:'",1)):
        {
          // Do not Care!!!
        }
      }              
    }
    
    Define_Function ParseDecoderVideoOpt(Char cMsg[])
    {
      Select
      {
        Active (Find_String(cMsg,"'Output:'",1)):
        {
          [dvdCodec,DECODE_VID_OUT_NTSC]  = Find_String(cMsg,"'NTSC'",1);
          [dvdCodec,DECODE_VID_OUT_PAL]   = Find_String(cMsg,"'PAL'",1);
        }
        Active (Find_String(cMsg,"'Bitstream Type:'",1)):
        {
          [dvdCodec,DECODE_VID_IN_MPEG1]  = Find_String(cMsg,"'MPEG-1'",1);
          [dvdCodec,DECODE_VID_IN_MPEG2]  = Find_String(cMsg,"'MPEG-2'",1);
        }
        Active (Find_String(cMsg,"'Overlay:'",1)):
        {
          // Do not Care!!!    
        }
        Active (Find_String(cMsg,"'No Data Mode:'",1)):
        {
          // Do not Care!!!    
        }
      }
    }
    
    Define_Function ParseEncoderAudioOpt(Char cMsg[])
    {
      Select
      { 
        Active (Find_String(cMsg,"'Mode:'",1)):
        {
          [dvdCodec,ENCODE_AUD_MODE_MONO]     = Find_String(cMsg,"'Mono'",1);
          [dvdCodec,ENCODE_AUD_MODE_STEREO]   = Find_String(cMsg,"'Stereo'",1);
          [dvdCodec,ENCODE_AUD_MODE_DUAL]     = Find_String(cMsg,"'Dual Channel'",1);
          [dvdCodec,ENCODE_AUD_MODE_JOINT_0]  = Find_String(cMsg,"'Joint Stereo Mode 0'",1);
          [dvdCodec,ENCODE_AUD_MODE_JOINT_1]  = Find_String(cMsg,"'Joint Stereo Mode 1'",1);
          [dvdCodec,ENCODE_AUD_MODE_JOINT_2]  = Find_String(cMsg,"'Joint Stereo Mode 2'",1);
          [dvdCodec,ENCODE_AUD_MODE_JOINT_3]  = Find_String(cMsg,"'Joint Stereo Mode 3'",1);
        }
        Active (Find_String(cMsg,"'Sampling Frequency:'",1)):
        {
          // Do not Care!!!
        }
        Active (Find_String(cMsg,"'Bit Rate:'",1)):
        {
          [dvdCodec,ENCODE_AUD_BIT_RATE_65K]    = Find_String(cMsg,"'65K'",1);
          [dvdCodec,ENCODE_AUD_BIT_RATE_80K]    = Find_String(cMsg,"'80K'",1);
          [dvdCodec,ENCODE_AUD_BIT_RATE_96K]    = Find_String(cMsg,"'96K'",1);
          [dvdCodec,ENCODE_AUD_BIT_RATE_112K]   = Find_String(cMsg,"'112K'",1);
          [dvdCodec,ENCODE_AUD_BIT_RATE_128K]   = Find_String(cMsg,"'128K'",1);
          [dvdCodec,ENCODE_AUD_BIT_RATE_160K]   = Find_String(cMsg,"'160K'",1);
          [dvdCodec,ENCODE_AUD_BIT_RATE_192K]   = Find_String(cMsg,"'192K'",1);
        }
        Active (Find_String(cMsg,"'Left Channel Gain:'",1)):
        {
          Set_Length_String(cMsg,Length_String(cMsg)-1);
          uAudioVolumeLeft.snLevel = Atoi(Right_String(cMsg,4));
        }
        Active (Find_String(cMsg,"'Right Channel Gain:'",1)):    
        {
          Set_Length_String(cMsg,Length_String(cMsg)-1);
          uAudioVolumeRight.snLevel = Atoi(Right_String(cMsg,4)); 
        }
      }    
    }
    
    Define_Function ParseEncoderVideoOpt(Char cMsg[])
    {
      Select
      { 
        Active (Find_String(cMsg,"'Video Format:'",1)):
        {
          [dvdCodec,ENCODE_VID_NTSC_SIF]  = Find_String(cMsg,'NTSC/SIF',1);
          [dvdCodec,ENCODE_VID_PAL_SIF]   = Find_String(cMsg,'PAL/SIF',1);
          [dvdCodec,ENCODE_VID_NTSC_QSIF] = Find_String(cMsg,'NTSC-QSIF',1);
          [dvdCodec,ENCODE_VID_PAL_QSIF]  = Find_String(cMsg,'PAL/QSIF',1);
        }
        Active (Find_String(cMsg,"'Input Type:'",1)):
        {
          [dvdCodec,ENCODE_VID_IN_COMPOSITE]  = Find_String(cMsg,'Composite',1);
          [dvdCodec,ENCODE_VID_IN_SVHS]       = Find_String(cMsg,'S-VHS',1);
        }
        Active (Find_String(cMsg,"'Bit Rate:'",1)):
        {
          [dvdCodec,ENCODE_VID_BIT_RATE_1M]   = Find_String(cMsg,'1000000',1);
          [dvdCodec,ENCODE_VID_BIT_RATE_1_5M] = Find_String(cMsg,'1500000',1);
          [dvdCodec,ENCODE_VID_BIT_RATE_2M]   = Find_String(cMsg,'2000000',1);
          [dvdCodec,ENCODE_VID_BIT_RATE_2_5M] = Find_String(cMsg,'2500000',1);
          [dvdCodec,ENCODE_VID_BIT_RATE_3M]   = Find_String(cMsg,'3000000',1);
        }
        Active (Find_String(cMsg,"'Window Vertical Offset:'",1)):
        {
          // Do Not Care!!
        }
        Active (Find_String(cMsg,"'Reference Distance (M):'",1)):
        {
          // Do Not Care!!
        }
        Active (Find_String(cMsg,"'Intra-Picture Distance (N):'",1)):
        {
          // Do Not Care!!    
        }
        Active (Find_String(cMsg,"'Brightness:'",1)):
        {
           Set_Length_String(cMsg,Length_String(cMsg)-1);
          uVideoBrightness.snLevel = Atoi(Right_String(cMsg,4));
        }
        Active (Find_String(cMsg,"'Contrast:'",1)):
        {
          Set_Length_String(cMsg,Length_String(cMsg)-1);
          uVideoContrast.snLevel = Atoi(Right_String(cMsg,4));    
        }
        Active (Find_String(cMsg,"'Hue:'",1)):
        {
          Set_Length_String(cMsg,Length_String(cMsg)-1);
          uVideoHue.snLevel = Atoi(Right_String(cMsg,4));    
        }
        Active (Find_String(cMsg,"'Saturation:'",1)):
        {
          Set_Length_String(cMsg,Length_String(cMsg)-1);
          uVideoSaturation.snLevel = Atoi(Right_String(cMsg,4));    
        }
        Active (Find_String(cMsg,"'Assured Sync:'",1)):
        {
          // Do Not Care!!    
        }
      }
    }
    
    Define_Function ParseIPOptions(Char cMsg[])
    {
      Select
      { 
        Active (Find_String(cMsg,"'DHCP:'",1)):
        {
          uIPInfo.cDHCP = PickOutWord(cMsg);
        }
        Active (Find_String(cMsg,"'Codec IP Address:'",1)):
        {
          uIPInfo.cCodecIP = PickOutWord(cMsg);
        }
        Active (Find_String(cMsg,"'Subnet Mask:'",1)):
        {
          uIPInfo.cCodecSubMask = PickOutWord(cMsg);    
        }
        Active (Find_String(cMsg,"'Gateway IP Address:'",1)):
        {
          uIPInfo.cCodecGateway = PickOutWord(cMsg);    
        }
        Active (Find_String(cMsg,"'Ethernet HW Interface:'",1)):
        {
          uIPInfo.cCodecHWInterface = PickOutWord(cMsg);    
        }
        Active (Find_String(cMsg,"'Transmit Mode:'",1)):
        {
          uIPInfo.cXmitMode = PickOutWord(cMsg);    
          [dvdCodec,IP_XMIT_MODE_UNICAST]   = (Upper_String(uIPInfo.cXmitMode) = 'UNICAST')
          [dvdCodec,IP_XMIT_MODE_MULTICAST] = (Upper_String(uIPInfo.cXmitMode) = 'MULTICAST')
        }
        Active (Find_String(cMsg,"'Destination IP Address:'",1)):
        {
          uIPInfo.cDestIP = PickOutWord(cMsg);    
        }
        Active (Find_String(cMsg,"'Destination Port:'",1)):
        {
          uIPInfo.cDestPort = PickOutWord(cMsg);    
        }
        Active (Find_String(cMsg,"'Join Own Multicast Group:'",1)):
        {
          uIPInfo.cJoinOwnMulti = PickOutWord(cMsg);    
        }
        Active (Find_String(cMsg,"'Receive Mode:'",1)):
        {
          uIPInfo.cRcveMode = PickOutWord(cMsg);    
          [dvdCodec,IP_RCVE_MODE_UNICAST]   = (Upper_String(uIPInfo.cRcveMode) = 'UNICAST')
          [dvdCodec,IP_RCVE_MODE_MULTICAST] = (Upper_String(uIPInfo.cRcveMode) = 'MULTICAST')      
        }
        Active (Find_String(cMsg,"'Receive IP Address:'",1)):
        {
          uIPInfo.cRcveIP = PickOutWord(cMsg);    
        }
        Active (Find_String(cMsg,"'Receive Port:'",1)):
        {
          uIPInfo.cRcvePort = PickOutWord(cMsg);    
        }
        Active (Find_String(cMsg,"'PassThrough Dest:'",1)):
        {
          // Do not Care!!!
        }
        Active (Find_String(cMsg,"'PassThrough IP Address:'",1)):
        {
          // Do not Care!!!
        }
        Active (Find_String(cMsg,"'PassThrough Port:'",1)):
        {
          // Do not Care!!!
        }
        Active (Find_String(cMsg,"'Video Time-To-Live:'",1)):
        {
          // Do not Care!!!
        }
        Active (Find_String(cMsg,"'Type of Service:'",1)):
        {
          // Do not Care!!!
        }
        Active (Find_String(cMsg,"'Poll Unicast Destination:'",1)):
        {
          // Do not Care!!!
        }
        Active (Find_String(cMsg,"'VBrick Transmit:'",1)):
        {
          // Do not Care!!!
        }
      }    
    }
    
    Define_Function ParseChooser(Char cMsg[], Integer nCodecStatFlags)
    {
      Switch (nCodecStatFlags)
      {
        Case COMMAND_COMPLETE:
          Break;
        Case DECODER_AUDIO_OPT:
          ParseDecoderAudioOpt(cMsg);
        Case DECODER_VIDEO_OPT:
          ParseDecoderVideoOpt(cMsg);
        Case ENCODER_AUDIO_OPT:
          ParseEncoderAudioOpt(cMsg);
        Case ENCODER_VIDEO_OPT:
          ParseEncoderVideoOpt(cMsg);
        Case IP_OPTIONS:
          ParseIPOptions(cMsg);
      }
    }
    
    Define_Function ParseCodecResponse(Char cCodecBuffer[])
    {
      Local_Var Char cMsg[255],cTrash[100]; 
      
      Select
      {
        Active (Find_String(cCodecBuffer,"'Login:'",1)):
        {
          CodecFunc(dvCodec,LOGIN_NAME,cLoginName);
          cTrash = Remove_String(cCodecBuffer,"'Login:'",1)
        }
        Active (Find_String(cCodecBuffer,"'Password:'",1)):
        {
          CodecFunc(dvCodec,LOGIN_PASS,cLoginPass);
          cTrash = Remove_String(cCodecBuffer,"'Password:'",1)
        }
        Active (Find_String(cCodecBuffer,"'Connected'",1)):
        {
          On[dvdCodec,LOGGED_IN]
          cTrash = Remove_String(cCodecBuffer,"'Connected'",1)
        } 
        Active (1):
        {
          cMsg = Remove_String(cCodecBuffer,"13",1)
          If (Length_String(cMsg))
          {
            Select
            {
              Active (Find_String(cMsg,"'Decoder Audio Options'",1)):
              {
                nCodecStatFlags = DECODER_AUDIO_OPT;
              }
              Active (Find_String(cMsg,"'Decoder Video Options'",1)):
              {
                nCodecStatFlags = DECODER_VIDEO_OPT;
              }
              Active (Find_String(cMsg,"'Encoder Audio Options'",1)):
              {
                nCodecStatFlags = ENCODER_AUDIO_OPT;
              }                    
              Active (Find_String(cMsg,"'Encoder Video Options'",1)):
              {
                nCodecStatFlags = ENCODER_VIDEO_OPT;
              }
              Active (Find_String(cMsg,"'CIP:1'",1)):
              {
                nCodecStatFlags = IP_OPTIONS;
              }          
              Active (Find_String(cMsg,"'Command Complete'",1)):
              {
                nCodecStatFlags = COMMAND_COMPLETE;
                off[dvdCodec,BUSY]
              }             
            }
            ParseChooser(cMsg,nCodecStatFlags);       
          }
          If (Find_String(cCodecBuffer,"13",1))
             ParseCodecResponse(cCodecBuffer);
        }
      }   
    }(***********************************************************)
    (*                STARTUP CODE GOES BELOW                  *)
    (***********************************************************)
    DEFINE_START
    
    Translate_Device(vdvCodec,dvdCodec);
    
    (* Buffers *************************************************)
    Create_Buffer dvCodec,cCodecBuffer;
    
    (* Gain Level Init *****************************************)
    InitGainLevel(uAudioVolumeLeft  ,0
                                    ,15
                                    ,1
                                    ,TL_AUDIO_RAISE_LT
                                    ,TL_AUDIO_LOWER_LT
                                    ,0);
                                  
    InitGainLevel(uAudioVolumeRight ,0
                                    ,15
                                    ,1
                                    ,TL_AUDIO_RAISE_RT
                                    ,TL_AUDIO_LOWER_RT
                                    ,0);
                                   
    InitGainLevel(uVideoContrast   ,0  
                                   ,127
                                   ,1
                                   ,TL_VIDEO_CONTRAST_RAISE
                                   ,TL_VIDEO_CONTRAST_LOWER
                                   ,0);
                                   
    InitGainLevel(uVideoHue        ,-128
                                   ,127
                                   ,1
                                   ,TL_VIDEO_HUE_RAISE
                                   ,TL_VIDEO_HUE_LOWER
                                   ,0);
                                  
    InitGainLevel(uVideoSaturation ,0
                                   ,127
                                   ,1
                                   ,TL_VIDEO_SAT_RAISE
                                   ,TL_VIDEO_SAT_LOWER
                                   ,0);
    
    InitGainLevel(uVideoBrightness ,0
                                   ,255
                                   ,1
                                   ,TL_VIDEO_BRIT_RAISE
                                   ,TL_VIDEO_BRIT_LOWER
                                   ,0);
                                   
    Timeline_Create(TL_MAINLINE,lTLMainTimes,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT)
    (***********************************************************)                               
    (* System Information Strings ******************************)
    (* Use this section if there is a TP in the System!        *)
    (*
        SEND_COMMAND TP,"'!F',250,'1'"
        SEND_COMMAND TP,"'TEXT250-',__NAME__"
        SEND_COMMAND TP,"'!F',251,'1'"
        SEND_COMMAND TP,"'TEXT251-',__FILE__,', ',S_DATE,', ',S_TIME"
        SEND_COMMAND TP,"'!F',252,'1'"
        SEND_COMMAND TP,"'TEXT252-',__VERSION__"
        SEND_COMMAND TP,"'!F',253,'1'"
        (* Must fill this (Master Ver) *)
        SEND_COMMAND TP,'TEXT253-'
        SEND_COMMAND TP,"'!F',254,'1'"
        (* Must fill this (Panel File) *)
        SEND_COMMAND TP,'TEXT254-'
        SEND_COMMAND TP,"'!F',255,'1'"
        (* Must fill this (Dealer Info) *)
        SEND_COMMAND TP,'TEXT255-'
    *)
    (***********************************************************)
    (*                THE EVENTS GOES BELOW                    *)
    (***********************************************************)
    DEFINE_EVENT
    
    Channel_Event[dvdCodec,DECODE_AUD_MUTE]
    Channel_Event[dvdCodec,DECODE_AUD_MONO]
    Channel_Event[dvdCodec,DECODE_AUD_STEREO]
    Channel_Event[dvdCodec,DECODE_VID_START]
    Channel_Event[dvdCodec,DECODE_VID_STOP]
    Channel_Event[dvdCodec,DECODE_VID_OUT_NTSC]
    Channel_Event[dvdCodec,DECODE_VID_OUT_PAL]
    Channel_Event[dvdCodec,DECODE_VID_IN_MPEG1]
    Channel_Event[dvdCodec,DECODE_VID_IN_MPEG2]
    Channel_Event[dvdCodec,ENCODE_AUD_START]
    Channel_Event[dvdCodec,ENCODE_AUD_STOP]
    Channel_Event[dvdCodec,ENCODE_AUD_MODE_MONO]
    Channel_Event[dvdCodec,ENCODE_AUD_MODE_STEREO]
    Channel_Event[dvdCodec,ENCODE_AUD_MODE_DUAL]
    Channel_Event[dvdCodec,ENCODE_AUD_MODE_JOINT_0]
    Channel_Event[dvdCodec,ENCODE_AUD_MODE_JOINT_1]
    Channel_Event[dvdCodec,ENCODE_AUD_MODE_JOINT_2]
    Channel_Event[dvdCodec,ENCODE_AUD_MODE_JOINT_3]
    Channel_Event[dvdCodec,ENCODE_AUD_BIT_RATE_65K]
    Channel_Event[dvdCodec,ENCODE_AUD_BIT_RATE_80K]
    Channel_Event[dvdCodec,ENCODE_AUD_BIT_RATE_96K]
    Channel_Event[dvdCodec,ENCODE_AUD_BIT_RATE_112K]
    Channel_Event[dvdCodec,ENCODE_AUD_BIT_RATE_128K]
    Channel_Event[dvdCodec,ENCODE_AUD_BIT_RATE_160K]
    Channel_Event[dvdCodec,ENCODE_AUD_BIT_RATE_192K]
    Channel_Event[dvdCodec,ENCODE_AUD_VOL_RAISE_LT]
    Channel_Event[dvdCodec,ENCODE_AUD_VOL_LOWER_LT]
    Channel_Event[dvdCodec,ENCODE_AUD_VOL_RAISE_RT]
    Channel_Event[dvdCodec,ENCODE_AUD_VOL_LOWER_RT]
    Channel_Event[dvdCodec,ENCODE_VID_START]
    Channel_Event[dvdCodec,ENCODE_VID_STOP]
    Channel_Event[dvdCodec,ENCODE_VID_NTSC_SIF]
    Channel_Event[dvdCodec,ENCODE_VID_PAL_SIF]
    Channel_Event[dvdCodec,ENCODE_VID_NTSC_QSIF]
    Channel_Event[dvdCodec,ENCODE_VID_PAL_QSIF]
    Channel_Event[dvdCodec,ENCODE_VID_IN_COMPOSITE]
    Channel_Event[dvdCodec,ENCODE_VID_IN_SVHS]
    Channel_Event[dvdCodec,ENCODE_VID_BIT_RATE_1M]
    Channel_Event[dvdCodec,ENCODE_VID_BIT_RATE_1_5M]
    Channel_Event[dvdCodec,ENCODE_VID_BIT_RATE_2M]
    Channel_Event[dvdCodec,ENCODE_VID_BIT_RATE_2_5M]
    Channel_Event[dvdCodec,ENCODE_VID_BIT_RATE_3M]
    Channel_Event[dvdCodec,ENCODE_VID_CONT_RAISE]
    Channel_Event[dvdCodec,ENCODE_VID_CONT_LOWER]
    Channel_Event[dvdCodec,ENCODE_VID_HUE_RAISE]
    Channel_Event[dvdCodec,ENCODE_VID_HUE_LOWER]
    Channel_Event[dvdCodec,ENCODE_VID_SATR_RAISE]
    Channel_Event[dvdCodec,ENCODE_VID_SATR_LOWER]
    Channel_Event[dvdCodec,ENCODE_VID_BRIT_RAISE]
    Channel_Event[dvdCodec,ENCODE_VID_BRIT_LOWER]
    Channel_Event[dvdCodec,IP_XMIT_ENABLE]
    Channel_Event[dvdCodec,IP_XMIT_DISABLE]
    Channel_Event[dvdCodec,IP_XMIT_MODE_UNICAST]
    Channel_Event[dvdCodec,IP_XMIT_MODE_MULTICAST]
    Channel_Event[dvdCodec,IP_RCVE_MODE_UNICAST]
    Channel_Event[dvdCodec,IP_RCVE_MODE_MULTICAST]
    Channel_Event[dvdCodec,IP_APPLY_CHANGES]
    {
      On:
      {
        CodecFunc(dvCodec,Channel.Channel,"");
      }
    }
    
    
    Channel_Event[dvdCodec,ENCODE_AUD_VOL_RAISE_LT]
    Channel_Event[dvdCodec,ENCODE_AUD_VOL_LOWER_LT]
    {
      Off:
      {
        CodecFunc(dvCodec,ENCODE_AUD_VOL_STOP_LT,"");
      }
    }
    
    Channel_Event[dvdCodec,ENCODE_AUD_VOL_RAISE_RT]
    Channel_Event[dvdCodec,ENCODE_AUD_VOL_LOWER_RT]
    {
      Off:
      {
        CodecFunc(dvCodec,ENCODE_AUD_VOL_STOP_RT,"");
      }
    }
    
    Channel_Event[dvdCodec,ENCODE_VID_CONT_RAISE]
    Channel_Event[dvdCodec,ENCODE_VID_CONT_LOWER]
    {
      Off:
      {
        CodecFunc(dvCodec,ENCODE_VID_CONT_STOP,"");
      }
    }
    
    
    Channel_Event[dvdCodec,ENCODE_VID_HUE_RAISE]
    Channel_Event[dvdCodec,ENCODE_VID_HUE_LOWER]
    {
      Off:
      {
        CodecFunc(dvCodec,ENCODE_VID_HUE_STOP,"");
      }
    }
    
    Channel_Event[dvdCodec,ENCODE_VID_SATR_RAISE]
    Channel_Event[dvdCodec,ENCODE_VID_SATR_LOWER]
    {
      Off:
      {
        CodecFunc(dvCodec,ENCODE_VID_SATR_STOP,"");
      }
    }
    
    Channel_Event[dvdCodec,ENCODE_VID_BRIT_RAISE]
    Channel_Event[dvdCodec,ENCODE_VID_BRIT_LOWER]
    {
      Off:
      {
        CodecFunc(dvCodec,ENCODE_VID_BRIT_STOP,"");
      }
    }
    
    Data_Event[dvdCodec]
    {
      Command:
      {
        ParseCommands(Data.Text)
      }
      Online:
      {
        Wait 100 'Codec Online'
        {
          CodecFunc(dvCodec,STAT_DECODE_AUD,"");
          CodecFunc(dvCodec,STAT_DECODE_VID,"");
          CodecFunc(dvCodec,STAT_ENCODE_AUD,"");
          CodecFunc(dvCodec,STAT_ENCODE_VID,"");
          CodecFunc(dvCodec,STAT_IP_PROC,"");
        }        
      }
    }
    
    
    Data_Event[dvCodec]
    {
      Online:
      {
        On[dvdCodec,SOCKET_OPEN]
      }
      Offline:
      {
        Off[dvdCodec,SOCKET_OPEN]
        Off[dvdCodec,LOGGED_IN]
      }   
      String:
      {
        ParseCodecResponse(cCodecBuffer);
      }
    }
    
    (* Timeline Events *****************************************)
    Timeline_Event[TL_AUDIO_RAISE_RT]
    {
      RaiseLevels(uAudioVolumeRight);
      CodecFunc(dvCodec,ENCODE_AUD_VOL_LEVEL_RT,Itoa(uAudioVolumeRight.snLevel));
    }
    
    Timeline_Event[TL_AUDIO_LOWER_RT]
    {
      LowerLevels(uAudioVolumeRight);
      CodecFunc(dvCodec,ENCODE_AUD_VOL_LEVEL_RT,Itoa(uAudioVolumeRight.snLevel));
    }
    
    Timeline_Event[TL_AUDIO_RAISE_LT]
    {
      RaiseLevels(uAudioVolumeLeft);
      CodecFunc(dvCodec,ENCODE_AUD_VOL_LEVEL_LT,Itoa(uAudioVolumeLeft.snLevel));
    }
    
    Timeline_Event[TL_AUDIO_LOWER_LT]
    {
      LowerLevels(uAudioVolumeLeft);
      CodecFunc(dvCodec,ENCODE_AUD_VOL_LEVEL_LT,Itoa(uAudioVolumeLeft.snLevel));
    }
    
    Timeline_Event[TL_VIDEO_CONTRAST_RAISE]
    {
      RaiseLevels(uVideoContrast);
      CodecFunc(dvCodec,ENCODE_VID_CONT_LEVEL,Itoa(uVideoContrast.snLevel));
    }
    
    Timeline_Event[TL_VIDEO_CONTRAST_LOWER]
    {
      LowerLevels(uVideoContrast);
      CodecFunc(dvCodec,ENCODE_VID_CONT_LEVEL,Itoa(uVideoContrast.snLevel));
    }
    
    Timeline_Event[TL_VIDEO_HUE_RAISE]
    {
      RaiseLevels(uVideoHue);
      CodecFunc(dvCodec,ENCODE_VID_HUE_LEVEL,Itoa(uVideoHue.snLevel));
    }
    
    Timeline_Event[TL_VIDEO_HUE_LOWER]
    {
      LowerLevels(uVideoHue);
      CodecFunc(dvCodec,ENCODE_VID_HUE_LEVEL,Itoa(uVideoHue.snLevel));
    }
    
    Timeline_Event[TL_VIDEO_SAT_RAISE]
    {
      RaiseLevels(uVideoSaturation);
      CodecFunc(dvCodec,ENCODE_VID_SATR_LEVEL,Itoa(uVideoSaturation.snLevel));
    }
    
    Timeline_Event[TL_VIDEO_SAT_LOWER]
    {
      LowerLevels(uVideoSaturation);
      CodecFunc(dvCodec,ENCODE_VID_SATR_LEVEL,Itoa(uVideoSaturation.snLevel));
    }
    
    Timeline_Event[TL_VIDEO_BRIT_RAISE]
    {
      RaiseLevels(uVideoBrightness);
      CodecFunc(dvCodec,ENCODE_VID_BRIT_LEVEL,Itoa(uVideoBrightness.snLevel));
    }
    
    Timeline_Event[TL_VIDEO_BRIT_LOWER]
    {
      LowerLevels(uVideoBrightness);
      CodecFunc(dvCodec,ENCODE_VID_BRIT_LEVEL,Itoa(uVideoBrightness.snLevel));
    }
    
    Timeline_Event[TL_MAINLINE]
    {
      CommServer();
    
      //If (Length_String(cCodecBuffer))
      //  ParseCodecResponse(cCodecBuffer);
    }
    (***********************************************************)
    (*            THE ACTUAL PROGRAM GOES BELOW                *)
    (***********************************************************)
    DEFINE_PROGRAM
    
    (***********************************************************)
    (*                     END OF PROGRAM                      *)
    (*        DO NOT PUT ANY CODE BELOW THIS COMMENT           *)
    (***********************************************************)
    
Sign In or Register to comment.