IFO-Dateien

  • VB.NET

SSL ist deaktiviert! Aktivieren Sie SSL für diese Sitzung, um eine sichere Verbindung herzustellen.

Es gibt 4 Antworten in diesem Thema. Der letzte Beitrag () ist von Thiemo1991.

    Hallo, ihr lieben,

    wie kann ich IFO-Dateien von einer DVD auslesen bzw. überprüfen ob das eine IFO-Datei ist? Ich brauche diese Info da ich sonst nicht mein Programm (tmPlayer) mit einer DVD Wiedergabe über DirectShow, weiter programmieren kann. Ich habe dazu Google befragt aber diesbezüglich nichts gefunden.

    MFG
    Mit dien Quellcode würde es anscheinend funktionieren aber ich weis nur nicht wie. Könnt ihr mir sagen wie es mit diesem Code funktioniert?

    VB.NET-Quellcode

    1. Imports System.IO
    2. Partial Public Class tmDVD
    3. Inherits Form
    4. 'for your info, this only works on x86 projects
    5. 'due to the library itself
    6. Private video As Video
    7. Private videoPaths As String()
    8. Private folderPath As String = "C:\Users\Dell XPS\Desktop\Videos\"
    9. Private selectedIndex As Integer = 0
    10. Private formSize As Size
    11. Private pnlSize As Size
    12. Public Sub New()
    13. InitializeComponent()
    14. End Sub
    15. Private Sub Form1_Load(sender As Object, e As EventArgs)
    16. formSize = New Size(Me.Width, Me.Height)
    17. pnlSize = New Size(pnlVideo.Width, pnlVideo.Height)
    18. videoPaths = Directory.GetFiles(folderPath, "*.wmv")
    19. If videoPaths IsNot Nothing Then
    20. For Each path As String In videoPaths
    21. Dim vid As String = path.Replace(folderPath, String.Empty)
    22. vid = vid.Replace(".wmv", String.Empty)
    23. lstVideos.Items.Add(vid)
    24. Next
    25. End If
    26. lstVideos.SelectedIndex = selectedIndex
    27. End Sub
    28. Private Sub lstVideos_SelectedIndexChanged(sender As Object, e As EventArgs)
    29. Try
    30. video.[Stop]()
    31. video.Dispose()
    32. Catch
    33. End Try
    34. Dim index As Integer = lstVideos.SelectedIndex
    35. selectedIndex = index
    36. video = New Video(videoPaths(index), False)
    37. video.Owner = pnlVideo
    38. pnlVideo.Size = pnlSize
    39. video.Play()
    40. tmrVideo.Enabled = True
    41. btnPlayPause.Text = "Pause"
    42. 'AddHandler video.Ending, AddressOf Video_Ending
    43. lblVideo.Text = lstVideos.Text
    44. End Sub
    45. 'Private Sub Video_Ending(sender As Object, e As EventArgs)
    46. ' Task.Factory.StartNew(Function()
    47. ' System.Threading.Thread.Sleep(2000)
    48. ' If InvokeRequired Then
    49. ' Me.Invoke(New Action(Function()
    50. ' NextVideo()
    51. ' End Function))
    52. ' End If
    53. ' End Function)
    54. 'End Sub
    55. Private Sub NextVideo()
    56. Dim index As Integer = lstVideos.SelectedIndex
    57. index += 1
    58. If index > videoPaths.Length - 1 Then
    59. index = 0
    60. End If
    61. selectedIndex = index
    62. lstVideos.SelectedIndex = index
    63. End Sub
    64. Private Sub btnNext_Click(sender As Object, e As EventArgs)
    65. NextVideo()
    66. End Sub
    67. Private Sub btnPrevious_Click(sender As Object, e As EventArgs)
    68. PreviousVideo()
    69. End Sub
    70. Private Sub PreviousVideo()
    71. Dim index As Integer = lstVideos.SelectedIndex
    72. index -= 1
    73. If index = -1 Then
    74. index = videoPaths.Length - 1
    75. End If
    76. selectedIndex = index
    77. lstVideos.SelectedIndex = index
    78. End Sub
    79. Private Sub btnPlayPause_Click(sender As Object, e As EventArgs)
    80. If Not video.Playing Then
    81. video.Play()
    82. tmrVideo.Enabled = True
    83. btnPlayPause.Text = "Pause"
    84. ElseIf video.Playing Then
    85. video.Pause()
    86. tmrVideo.Enabled = False
    87. btnPlayPause.Text = "Play"
    88. End If
    89. End Sub
    90. Private Sub btnFullscreen_Click(sender As Object, e As EventArgs)
    91. FormBorderStyle = FormBorderStyle.None
    92. WindowState = FormWindowState.Maximized
    93. video.Owner = Me
    94. End Sub
    95. Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs)
    96. If e.KeyCode = Keys.Escape Then
    97. 'exit full screen when escape is pressed
    98. FormBorderStyle = FormBorderStyle.Sizable
    99. WindowState = FormWindowState.Normal
    100. Me.Size = formSize
    101. video.Owner = pnlVideo
    102. pnlVideo.Size = pnlSize
    103. End If
    104. End Sub
    105. Private Sub trackVolume_Scroll(sender As Object, e As EventArgs)
    106. video.Audio.Volume = trackVolume.Value
    107. End Sub
    108. Private Sub btnVolume_Click(sender As Object, e As EventArgs)
    109. trackVolume.Visible = Not trackVolume.Visible
    110. End Sub
    111. Private Sub tmrVideo_Tick(sender As Object, e As EventArgs)
    112. Dim currentTime As Integer = Convert.ToInt32(video.CurrentPosition)
    113. Dim maxTime As Integer = Convert.ToInt32(video.Duration)
    114. lblVideoPosition.Text = String.Format("{0:00}:{1:00}:{2:00}", currentTime / 3600, (currentTime / 60) Mod 60, currentTime Mod 60) + " / " + String.Format("{0:00}:{1:00}:{2:00}", maxTime / 3600, (maxTime / 60) Mod 60, maxTime Mod 60)
    115. End Sub
    116. End Class