camel, ich hab dein ProgEdit mal mit in mein Projekt einbezogen und liefer es mit aus.
Es ist kein Editor, es dient zum Anlegen von geplanten Aufnahmen mit ProgDVB und ich nutze ProgEdit um an die Channelnamen der ProgDVB-Favoriten zu kommen.
Kannst ja bei Interesse nen Blick drauf werfen:
http://progdvbtimer.sourceforge.net
Ich hätte Interesse mal einen Blick auf die ProgEdit-Sourcen zu werfen, da ich mich mal selbst versucht hab das Auslesen der Channel aus den Hex-Files zu implementieren... vergebens.
Kannst mir die bitte mailen?
Danke
ich hab mnir mal dein project bisserl angeschaut.
wenn ich dich richtig verstehe, dann wär es schön für dich wenn ein kleiner programmteil aus der channel.dat die "caption" vom klanal ausliest ...
hier der source code teil für das auslesen der channel.dat:
(vbasic) musst halt noch für dich umsetzen.....
wunder dich nicht über meinen code:)
Function OpenChannel() As Boolean
Dim nFS As FileStream
Dim buffer(3) As Byte
Dim strbuffer(127) As Byte
Dim i As Integer
Dim c As Integer
Dim struct_counter As Integer
Try
nFS = New FileStream(t_FileName.Text, FileMode.Open)
Catch ex As Exception
MsgBox("File not found or no full acces to this file!")
Return False
Exit Function
End Try
'Read Header
nFS.Read(buffer, 0, 4)
Header.m_ID = BitConverter.ToUInt32(buffer, 0)
If Convert.ToInt32(Header.m_ID) <> &H22DFBC3B Then
MsgBox("File has an error - Wrong or unknown header-ID in file!", MsgBoxStyle.Critical)
Return False
Exit Function
End If
'switch for doublewchannelchecking
nothing_has_been_changed = False
nFS.Read(buffer, 0, 4)
Header.m_Version = BitConverter.ToUInt32(buffer, 0)
nFS.Read(buffer, 0, 4)
Header.m_HeaderSize = BitConverter.ToUInt32(buffer, 0)
nFS.Read(buffer, 0, 4)
Header.m_FileLength = BitConverter.ToUInt32(buffer, 0)
nFS.Read(buffer, 0, 4)
Header.m_ItemCount = BitConverter.ToUInt32(buffer, 0)
ReDim Channel(Convert.ToInt32(Header.m_ItemCount))
For c = 1 To Convert.ToInt32(Header.m_ItemCount)
If nFS.Length = nFS.Position Then Exit For
'struct_counter checker
struct_counter = 0
'Read Channel
ReDim buffer(3)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_StructSize = BitConverter.ToInt16(buffer, 0)
'Read IDStruct
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_ID.m_TID = BitConverter.ToUInt32(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_ID.m_SID = BitConverter.ToUInt32(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_ID.m_SatPosition = BitConverter.ToUInt16(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_ID.m_LNB = BitConverter.ToUInt16(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_ID.m_NID = BitConverter.ToUInt32(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_ID.m_PCR = BitConverter.ToUInt16(buffer, 0)
nFS.Read(buffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_ID.m_Freq = BitConverter.ToInt32(buffer, 0)
nFS.Read(strbuffer, 0, 128)
struct_counter = struct_counter + 128
Channel(c).m_Caption = UnicodeLib.GetString(strbuffer)
ReDim strbuffer(127)
nFS.Read(strbuffer, 0, 64)
struct_counter = struct_counter + 64
Channel(c).m_ServiceLabel = UnicodeLib.GetString(strbuffer)
nFS.Read(strbuffer, 0, 64)
struct_counter = struct_counter + 64
Channel(c).m_ProviderLabel = UnicodeLib.GetString(strbuffer)
nFS.Read(strbuffer, 0, 64)
struct_counter = struct_counter + 64
Channel(c).m_NetworkName = UnicodeLib.GetString(strbuffer)
ReDim buffer(3)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_VideoPid = BitConverter.ToUInt16(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_TeletextPid = BitConverter.ToUInt16(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_ID.m_PCR = BitConverter.ToUInt16(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_PMT_PID = BitConverter.ToUInt16(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_ECM_PID = BitConverter.ToUInt16(buffer, 0)
'das ist der crypted channel - SERVICE STATUS!!!! oder doch nicht ?
ReDim buffer(3)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
'Channel(c).m_bAdultChannel = BitConverter.ToBoolean(buffer, 0)
'sadasd(Channel(c).m_Service_Type = buffer(0))
Channel(c).m_Crypted = buffer(0)
'Read LngStreams
ReDim Channel(c).m_LngStreams(40)
For i = 0 To 39
If nFS.Length = nFS.Position Then Exit For
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_LngStreams(i).m_StreamType = Convert.ToChar(buffer(0))
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_LngStreams(i).m_SubType = buffer(0)
nFS.Read(strbuffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_LngStreams(i).m_Language = UnicodeLib.GetString(strbuffer)
ReDim buffer(3)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_LngStreams(i).m_compostion_page_id_PageNumber = BitConverter.ToInt16(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_LngStreams(i).m_ancillary_page_id_MagazineNumber = BitConverter.ToInt16(buffer, 0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_LngStreams(i).m_Pid = BitConverter.ToInt16(buffer, 0)
'ac3 auslesen
'If Mid(Channel(c).m_LngStreams(i).m_Language, 2, 3) = "3ta" Then
If Mid(Channel(c).m_LngStreams(i).m_Language, 2, 1) = "3" Then
Channel(c).m_AC3_PID = BitConverter.ToUInt16(buffer, 0)
End If
Next
ReDim buffer(3)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_LngStreamCount = buffer(0)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_CurrentAudio = buffer(0)
'error von Progdvb handling
If Channel(c).m_CurrentAudio > 39 Then
Channel(c).m_CurrentAudio = 0
End If
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_CurrentSubtitle = Convert.ToChar(buffer(0))
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_ChannelMask = buffer(0)
nFS.Read(buffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_SybleRate = BitConverter.ToInt32(buffer, 0)
nFS.Read(buffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_Qam = BitConverter.ToUInt32(buffer, 0)
nFS.Read(buffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_Polar = BitConverter.ToInt32(buffer, 0)
ReDim buffer(3)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_Quality = buffer(0)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_Level = buffer(0)
nFS.Read(buffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_ChannelNumber = BitConverter.ToInt32(buffer, 0)
nFS.Read(buffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_IsCanUpdate = BitConverter.ToBoolean(buffer, 0)
nFS.Read(buffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_Ratio = BitConverter.ToUInt32(buffer, 0)
'ier sollte sein:
'bool m_AdultChannel;
'bool m_bIsAvcVideo; bei alten versionen einfach leer
'bool m_bIsDVB_S2; bei alten versionen einfach leer
'char m_FEC; // auto,1/2,2/3,3/4,4/5,5/6,6/7,7/8,8/9,9/10
ReDim buffer(3)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_bAdultChannel = BitConverter.ToBoolean(buffer, 0)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_bIsAvcVideo = BitConverter.ToBoolean(buffer, 0)
'support für neue version 4.83-5.xx
If Channel(c).m_StructSize >= 884 Then
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_UnusedFlags1 = BitConverter.ToUInt16(buffer, 0)
Else
ReDim buffer(3)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_bIsDVB_S2 = BitConverter.ToBoolean(buffer, 0)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_FEC = buffer(0)
End If
'ALT
''Channel(c).m_bAdultChannel = BitConverter.ToBoolean(buffer, 0)
'nFS.Read(buffer, 0, 4)
'struct_counter = struct_counter + 4
''Channel(c).m_bAdultChannel = BitConverter.ToBoolean(buffer, 0)
'Channel(c).m_Ratio = BitConverter.ToUInt32(buffer, 0)
'neu ab version 114 (> ProgDVB 4.7.x)
If Channel(c).m_StructSize >= struct_counter + 4 Then
nFS.Read(buffer, 0, 4)
struct_counter = struct_counter + 4
Channel(c).m_DeviceID_m_SubID = BitConverter.ToUInt32(buffer, 0)
End If
If Channel(c).m_StructSize >= struct_counter + 1 Then
ReDim buffer(3)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_DeviceID_m_Type = BitConverter.ToUInt16(buffer, 0)
End If
If Channel(c).m_StructSize >= struct_counter + 8 Then
'strbuffer = Nothing
ReDim strbuffer(127)
nFS.Read(strbuffer, 0, 8)
struct_counter = struct_counter + 8
Channel(c).m_DeviceID_m_DllID = UnicodeLib.GetString(strbuffer)
End If
'support für neue version 4.83-5.xx - das wird verdreht mit oberen bereich
If Channel(c).m_StructSize >= 884 Then
ReDim buffer(3)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_bIsDVB_S2 = BitConverter.ToBoolean(buffer, 0)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_FEC = buffer(0)
'4er array für die ip-adresse
ReDim buffer(3)
'ReDim Channel(c).m_MulticastGroup(4)
'For i = 0 To 3
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
'Channel(c).m_MulticastGroup(i) = buffer(0)
Channel(c).m_MulticastGroup1 = buffer(0)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_MulticastGroup2 = buffer(0)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_MulticastGroup3 = buffer(0)
nFS.Read(buffer, 0, 1)
struct_counter = struct_counter + 1
Channel(c).m_MulticastGroup4 = buffer(0)
nFS.Read(buffer, 0, 2)
struct_counter = struct_counter + 2
Channel(c).m_Port = BitConverter.ToUInt16(buffer, 0)
'Next
End If
'only
If Channel(c).m_StructSize > struct_counter Then
ReDim Channel(c).m_Prog(Channel(c).m_StructSize - struct_counter)
nFS.Read(Channel(c).m_Prog, 0, (Channel(c).m_StructSize - struct_counter))
'nFS.Position = nFS.Position + (Channel(c).m_StructSize - struct_counter)
End If
'berechnen + checken/schreiben von m_ServiceStatus
do_check_ServiceStatus(False, True, True, c)
'Channel(c).m_ServiceStatus = buffer(0)
If (c Mod 100 = 0) Or (c = Convert.ToInt32(Header.m_ItemCount)) Then
lbl_Items.Text = c
l_fileposition.Text = "/ " & nFS.Position
l_fileposition.Refresh()
lbl_Items.Refresh()
End If
If nFS.Length = nFS.Position Then Exit For
Next
lbl_Items.Text = c
l_fileposition.Text = "/ " & nFS.Position
l_fileposition.Refresh()
lbl_Items.Refresh()
'camel - korr 1.115 l_structure.Text = Channel(c).m_StructSize.ToString
l_structure.Text = Channel(c).m_StructSize.ToString
l_structure.Refresh()
l_ID.Text = "ID:" & Header.m_ID.ToString
l_structure.Text = Channel(1).m_StructSize.ToString
l_Version.Text = Header.m_Version.ToString
l_headersize.Text = Header.m_HeaderSize.ToString
l_ID.Refresh()
l_structure.Refresh()
l_Version.Refresh()
l_headersize.Refresh()
nFS.Close()
Return True
End Function