Hallo ihr lieben,
ich möchte unter Windows 10 einen DVD Player programmieren und ich habe gehört dass das Direct X auch wie z.B. das VLC Player Control könnte aber ich weis nicht wie bzw. was ich da beachten muss. Ich habe ein Code mir diesbezüglich aus dem Internet besorgt aber ich weis (noch) nicht einmal ob das überhaupt Direct X kann.
Könntet ihr mir das mal bitte diese Frage ENDLICH die ich mir stelle, eventuell beantworten?
MFG
ich möchte unter Windows 10 einen DVD Player programmieren und ich habe gehört dass das Direct X auch wie z.B. das VLC Player Control könnte aber ich weis nicht wie bzw. was ich da beachten muss. Ich habe ein Code mir diesbezüglich aus dem Internet besorgt aber ich weis (noch) nicht einmal ob das überhaupt Direct X kann.
VB.NET-Quellcode
- Imports System.IO
- Public Class tmDVD
- Dim Volume As Boolean = True
- Private WithEvents AudioDatei As Audio
- Private WithEvents VideoDatei As Video
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- ToolStripStatusLabel3.Enabled = False
- With Me.TrackBar2
- .Maximum = 7500
- .Minimum = 0
- .LargeChange = 1000
- .SmallChange = 100
- .TickFrequency = 1000
- .Value = .Maximum
- End With
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Try
- Me.Timer1.Enabled = True
- AudioDatei.Play()
- ZeitTimer.Start()
- Catch ex As Exception
- End Try
- Try
- Me.Timer2.Enabled = True
- VideoDatei = New Video(TextBox1.Text)
- VideoDatei.Owner = Panel1
- VideoDatei.Play()
- ZeitTimer.Start()
- Catch ex As Exception
- End Try
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Try
- AudioDatei.Pause()
- Catch ex As Exception
- End Try
- Try
- VideoDatei.Pause()
- Catch ex As Exception
- End Try
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- Try
- AudioDatei.Stop()
- Catch ex As Exception
- End Try
- Try
- VideoDatei.Stop()
- Catch ex As Exception
- End Try
- End Sub
- Private Sub DateiÖffnenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateiÖffnenToolStripMenuItem.Click
- Try
- If Me.OpenFileDialog1.ShowDialog() <> DialogResult.OK Then
- Return
- End If
- Dim FileName As String = Me.OpenFileDialog1.FileName
- If Not AudioDatei Is Nothing Then
- AudioDatei.Dispose()
- End If
- ' Laden der ausgewählten Audiodatei.
- AudioDatei = New Audio(FileName)
- With Me.TrackBar1
- .Minimum = 0
- .Maximum = CInt(AudioDatei.Duration)
- .LargeChange = .Maximum \ 10
- .SmallChange = .Maximum \ 100
- End With
- Dim Song As String, artist As String
- Dim datei As String, fs As FileStream, br As BinaryReader
- datei = OpenFileDialog1.FileName
- fs = New FileStream(datei, FileMode.Open, FileAccess.Read)
- br = New BinaryReader(fs)
- Dim file As New FileInfo(datei)
- Dim tagposition As Integer = (file.Length - 128)
- fs.Position = tagposition + 3
- Song = br.ReadChars(30)
- ToolStripStatusLabel1.Text = Song
- fs.Position = tagposition + 33
- artist = br.ReadChars(30)
- ToolStripStatusLabel1.Text = artist
- ToolStripStatusLabel3.Enabled = True
- Catch ex As Exception
- OpenFileDialog1.ShowDialog()
- TextBox1.Text = OpenFileDialog1.FileName
- End Try
- End Sub
- Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
- Try
- Dim SourceControl As TrackBar = DirectCast(sender, TrackBar)
- Me.ToolTip1.SetToolTip(SourceControl, CStr(SourceControl.Value) & " s")
- AudioDatei.CurrentPosition = SourceControl.Value
- Catch ex As Exception
- End Try
- Try
- Dim SourceControl As TrackBar = DirectCast(sender, TrackBar)
- Me.ToolTip1.SetToolTip(SourceControl, CStr(SourceControl.Value) & " s")
- VideoDatei.CurrentPosition = SourceControl.Value
- Catch ex As Exception
- End Try
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- Try
- Me.TrackBar1.Value = CInt(AudioDatei.CurrentPosition)
- Catch ex As Exception
- End Try
- End Sub
- Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
- Try
- If Volume = True Then
- AudioDatei.Volume = -7500
- Volume = False
- Button6.BackgroundImage = ImageList1.Images(0)
- Button6.BackgroundImageLayout = ImageLayout.Center
- TrackBar2.Enabled = False
- Else
- AudioDatei.Volume = 0
- Volume = True
- Button6.BackgroundImage = ImageList1.Images(1)
- Button6.BackgroundImageLayout = ImageLayout.Center
- TrackBar2.Enabled = True
- End If
- Catch ex As Exception
- End Try
- Try
- If Volume = True Then
- VideoDatei.Audio.Volume = -7500
- Volume = False
- Button6.BackgroundImage = ImageList1.Images(0)
- Button6.BackgroundImageLayout = ImageLayout.Center
- TrackBar2.Enabled = False
- Else
- VideoDatei.Audio.Volume = 0
- Volume = True
- Button6.BackgroundImage = ImageList1.Images(1)
- Button6.BackgroundImageLayout = ImageLayout.Center
- TrackBar2.Enabled = True
- End If
- Catch ex As Exception
- End Try
- End Sub
- Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll
- Try
- Dim SourceControl As TrackBar = DirectCast(sender, TrackBar)
- AudioDatei.Volume = -SourceControl.Maximum + SourceControl.Value
- Catch ex As Exception
- End Try
- Try
- Dim SourceControl As TrackBar = DirectCast(sender, TrackBar)
- VideoDatei.Audio.Volume = -SourceControl.Maximum + SourceControl.Value
- Catch ex As Exception
- End Try
- End Sub
- Private Sub ZeitTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ZeitTimer.Tick
- Try
- Dim Länge As String = TimeSpan.FromSeconds(AudioDatei.Duration).Minutes.ToString("00") & ":" & CStr(TimeSpan.FromSeconds(AudioDatei.Duration).Seconds.ToString("00"))
- Dim CurrentPos As String = TimeSpan.FromSeconds(AudioDatei.CurrentPosition).Minutes.ToString("00") & ":" & (TimeSpan.FromSeconds(AudioDatei.CurrentPosition).Seconds.ToString("00"))
- Label1.Text = CurrentPos & " / " & Länge & " "
- Catch ex As Exception
- End Try
- Try
- Dim Länge As String = TimeSpan.FromSeconds(VideoDatei.Duration).Minutes.ToString("00") & ":" & CStr(TimeSpan.FromSeconds(AudioDatei.Duration).Seconds.ToString("00"))
- Dim CurrentPos As String = TimeSpan.FromSeconds(VideoDatei.CurrentPosition).Minutes.ToString("00") & ":" & (TimeSpan.FromSeconds(AudioDatei.CurrentPosition).Seconds.ToString("00"))
- Label1.Text = CurrentPos & " / " & Länge & " "
- Catch ex As Exception
- End Try
- End Sub
- Private Sub DateiInfosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateiInfosToolStripMenuItem.Click
- Form2.Show()
- End Sub
- Private Sub EinstellungenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EinstellungenToolStripMenuItem.Click
- Form3.Show()
- End Sub
- Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
- Try
- Me.TrackBar1.Value = CInt(VideoDatei.CurrentPosition)
- Catch ex As Exception
- End Try
- End Sub
- End Class
Könntet ihr mir das mal bitte diese Frage ENDLICH die ich mir stelle, eventuell beantworten?
MFG
Wie man mich kontaktieren kann:
thiemo-melhorn.de
thiemo-melhorn.de