--------SPLICER VARIABLES------------------------------------------------------------------ 'Variable Definition (Router,User Flag) Public intSetSplicerFunction As Integer '1=Main, 2=Backup, 3=Main PIP, 4=Backup PIP, 5=Alternate One, 6=Alternate Two, 7=Alternate Three, 8=Alternate Four, 9=Alternate Five, 10=Alternate Six, 11=Alternate Seven, 12=Alternate Eight Public intSetSplicerUnit As Integer Public strTMXName(16, 12) As String Public strTMXIP(16, 12) As String Public intTMXType(16, 12) As Integer '0=TMX 1=RGB 2=DM-6400 3=DTP 4=Cap-1000 5=DM-6400 Public strTMXUser(16, 12) As String Public strTMXPass(16, 12) As String Type udtTMX intServiceType As Integer '0=ASI 1=IP strChannelName As String 'TMX & SCTE-30 Variables strSpliceName As String intInputCard As Integer intAsiPort As Integer strDestIP As String 'Destination Service dblBasePort As Double 'UDP Port intNumPorts As Integer 'Number Of UDP Ports dblServiceId As Double 'Terayon DM-6400 Variables strInLineID As String strInMuxID As String strInPgmID As String strOutLineID As String strOutMuxID As String strOutPgmID As String 'Cap blnCapInputTypeFile As Boolean 'False If Stream (Default) True If File blnCapCustomGroom As Boolean blnCapPassStreams As Boolean strCapInVideoPid As String strCapInVideoPidType As String strCapInAudioPid(4) As String strCapInAudioPidType(4) As String strCapInSCTEPid As String strCapInSCTEPidType As String strCapInNullPid As String strCapInNullPidType As String strCapOutVideoPid As String strCapOutAudioPid(4) As String strCapOutSCTEPid As String strCapOutNullPid As String byteCapStopMpeg(6) As Byte 'DTP strDTPInHandle As String strDTPInProgram As String strDTPInPmtPid As String strDTPInPcrPid As String strDTPInVideoPid As String strDTPInAudio1Pid As String strDTPInAudio2Pid As String strDTPOutHandle As String strDTPOutProgram As String strDTPOutPmtPid As String strDTPOutPcrPid As String strDTPOutVideoPid As String strDTPOutAudio1Pid As String strDTPOutAudio2Pid As String 'Router Backup intRTRNumber As Integer intRTRSrc As Integer intRTRDes As Integer 'DCM strDCMInBoard As String strDCMInPort As String strDCMInIP As String strDCMInUdp As String strDCMInPgm As String strDCMOutBoard As String strDCMOutPort As String strDCMOutIP As String strDCMOutUdp As String strDCMOutPgm As String End Type Public typTMX(16, conTMXServices, 12) As udtTMX '(Unit,Service,Main=1 Back=2 Main-PIP=3 Backup-PIP=4 Alternate One=5 Alternate Two=6 Alternate Three=7 Alternate Four=8 Alternate Five=9 Alternate Six=10 Alternate Seven=11 Alternate Eight=12) ------------------------------------------------------------------ ------------LOAD BIN FILE------------------------------------------------------ Public Sub Binary_Load_Splicer(intSplicer As Integer) 'Load Splicer From Binary Format On Error Resume Next Dim intFileNum As Integer Dim intX As Integer Dim intUnit As Integer Dim strFile As String Dim strData As String Dim strFileHeader As String Dim intData As Integer Dim intMajor As Integer Dim intServices As Integer Dim blnX As Boolean Dim intFileVersion As Integer 'Build File Name strFile = App.Path + "\Splicer" + CStr(intSplicer) + ".Bin" 'Store Times blnX = GetFileTimes(strFile, typFileSplicer(intSplicer)) 'Check For Error If Err.Number > 0 Then Err.Clear Exit Sub End If 'Get Free File Number intFileNum = FreeFile 'Open Binary Files Open strFile For Binary Access Read As #intFileNum 'Get File Header strFileHeader = String(32, Chr$(32)) Get #intFileNum, , strFileHeader 'Get Major Version intMajor = Val(Mid$(strFileHeader, 1, 1)) 'Check Version If intMajor < 6 Then 'Old 256 Services intServices = 256 Else 'New 512 Services intServices = 512 End If 'Mirror intData = Asc(Mid$(strFileHeader, 11, 1)) Select Case (intData) Case 1, 32 'Enable blnSetSplicerMirror(intSplicer) = True Case Else blnSetSplicerMirror(intSplicer) = False End Select 'Get File Version intFileVersion = Val(Mid$(strFileHeader, 16, 1)) 'Get All Units For intUnit = 1 To 12 'Get Unit Info strData = String(256, Chr$(32)) Get #intFileNum, , strData 'TMX Name strTMXName(intSplicer, intUnit) = TRIMZERO(Mid$(strData, 1, 32)) 'TMX IP strTMXIP(intSplicer, intUnit) = TRIMZERO(Mid$(strData, 33, 15)) 'TMX Type intTMXType(intSplicer, intUnit) = Val(Mid$(strData, 48, 4)) 'TMX User strTMXUser(intSplicer, intUnit) = TRIMZERO(Mid$(strData, 52, 32)) 'TMX Password strTMXPass(intSplicer, intUnit) = TRIMZERO(Mid$(strData, 84, 32)) 'Future 116-256 'Services Settings For intX = 1 To intServices 'Get Service Settings Select Case (intFileVersion) Case 2 ' New Version strData = String(1280, Chr$(32)) Case Else 'Old Version strData = String(1024, Chr$(32)) End Select 'Get Data From File Get #intFileNum, , strData 'Convert From String typTMX(intSplicer, intX, intUnit) = Binary_String_To_Splicer(strData) Next intX Next intUnit 'Close File Close #intFileNum End Sub ------------------------------------------------------------------ ---------------SAVE BIN FILE--------------------------------------------------- Public Sub Binary_Save_Splicer(intSplicer As Integer) 'Save Splicer In Binary Format On Error Resume Next Dim strOut As String 'Output Dim intFileNum As Integer Dim intX As Integer Dim intUnit As Integer Dim strFile As String Dim strFileHeader As String Dim blnX As Boolean 'Build File Name strFile = App.Path + "\Splicer" + CStr(intSplicer) + ".Bin" 'Archive Call File_Archive("Splicer" + CStr(intSplicer) + ".Bin") 'Get Free File Number intFileNum = FreeFile 'Delete Old File Because Binary Won't Replace Kill strFile 'Open Binary Files Open strFile For Binary Access Read Write Lock Write As #intFileNum 'Add File Header strFileHeader = String(32, Chr$(32)) Mid$(strFileHeader, 1, 10) = CStr(App.Major) + "." + CStr(App.Minor) + "." + CStr(App.Revision) 'Mirror If blnSetSplicerMirror(intSplicer) = True Then Mid$(strFileHeader, 11, 1) = Chr$(1) Else Mid$(strFileHeader, 11, 1) = Chr$(0) End If 'Splicer Bin File Version Mid$(strFileHeader, 16, 1) = "2" 'Save Header Put #intFileNum, , strFileHeader 'Put All Units For intUnit = 1 To 12 'Other Data strOut = String(256, Chr$(32)) 'TMX Name Mid$(strOut, 1, 32) = strTMXName(intSplicer, intUnit) 'TMX IP Mid$(strOut, 33, 15) = strTMXIP(intSplicer, intUnit) 'TMX Type Mid$(strOut, 48, 4) = Num_To_String(intTMXType(intSplicer, intUnit), 4) 'TMX User Mid$(strOut, 52, 32) = strTMXUser(intSplicer, intUnit) 'TMX Password Mid$(strOut, 84, 32) = strTMXPass(intSplicer, intUnit) 'Future 116-256 'Put Unit Info Put #intFileNum, , strOut 'Services Settings For intX = 1 To conTMXServices 'Build String strOut = Binary_Splicer_To_String(intSplicer, intX, intUnit) 'Put Unit Services Put #intFileNum, , strOut Next intX Next intUnit 'Close File Close #intFileNum 'Update Server Status So Backup Will DownLoad typeRedundantStatus(1).blnSplicer(intSplicer) = True typeRedundantStatus(2).blnSplicer(intSplicer) = True 'Store Times blnX = GetFileTimes(strFile, typFileSplicer(intSplicer)) End Sub ------------------------------------------------------------------