Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
GN Media Player - Media_Player.vb

Media_Player.vb

Caricato da: GN
Scarica il programma completo

  1. Imports Microsoft.DirectX.AudioVideoPlayback
  2. Public Class Media_Player
  3.     Dim InRiproduzioneVideo As Video
  4.     Dim InRiproduzioneAudio As Audio
  5.     Dim RiproduzioneVideo As Boolean
  6.     Private Sub Chiudi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Chiudi.Click
  7.         Application.Exit()
  8.     End Sub
  9.  
  10.     Private Sub RiduciAicona_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RiduciAicona.Click
  11.         Me.WindowState = FormWindowState.Minimized
  12.     End Sub
  13.  
  14.     Private Sub Titolo_MouseCaptureChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Titolo.MouseCaptureChanged
  15.         Me.Location = Control.MousePosition
  16.     End Sub
  17.     Private Sub ApriVideoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ApriVideoToolStripMenuItem.Click
  18.         Try
  19.             Try
  20.                 InRiproduzioneVideo.Stop()
  21.             Catch ex As Exception
  22.             End Try
  23.             Try
  24.                 InRiproduzioneAudio.Stop()
  25.             Catch ex As Exception
  26.             End Try
  27.             Apri.ShowDialog()
  28.             FileAperto.Text = "Apertura del file in corso..."
  29.             InRiproduzioneVideo = Video.FromFile(Apri.FileName, True)
  30.             Play.Text = "||"
  31.             RiproduzioneVideo = True
  32.             FileAperto.Text = Apri.FileName
  33.             Tempo.Start()
  34.         Catch ex As Exception
  35.             MsgBox("Il file che si sta tentando di aprire non è un file video valido o non è compatibile con GN Media Player")
  36.         End Try
  37.     End Sub
  38.  
  39.     Private Sub Play_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Play.Click
  40.         If RiproduzioneVideo = True Then
  41.             If InRiproduzioneVideo.Playing = True Then
  42.                 InRiproduzioneVideo.Pause()
  43.                 Play.Text = "|>"
  44.             ElseIf InRiproduzioneVideo.Paused = True Then
  45.                 InRiproduzioneVideo.Play()
  46.                 Play.Text = "||"
  47.             End If
  48.         Else
  49.             If InRiproduzioneAudio.Playing = True Then
  50.                 InRiproduzioneAudio.Pause()
  51.                 Play.Text = "|>"
  52.             ElseIf InRiproduzioneAudio.Paused = True Then
  53.                 InRiproduzioneAudio.Play()
  54.                 Play.Text = "||"
  55.             End If
  56.         End If
  57.     End Sub
  58.  
  59.     Private Sub Interrompi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Interrompi.Click
  60.         If RiproduzioneVideo = True Then
  61.             InRiproduzioneVideo.Stop()
  62.             Play.Text = "|>"
  63.         Else
  64.             InRiproduzioneAudio.Stop()
  65.             Play.Text = "|>"
  66.         End If
  67.     End Sub
  68.  
  69.     Private Sub ApriAudioToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ApriAudioToolStripMenuItem.Click
  70.         Try
  71.             Try
  72.                 InRiproduzioneVideo.Stop()
  73.             Catch ex As Exception
  74.             End Try
  75.             Try
  76.                 InRiproduzioneAudio.Stop()
  77.             Catch ex As Exception
  78.             End Try
  79.             Apri.ShowDialog()
  80.             InRiproduzioneAudio = Audio.FromFile(Apri.FileName, True)
  81.             Play.Text = "||"
  82.             RiproduzioneVideo = False
  83.             FileAperto.Text = Apri.FileName
  84.             Tempo.Start()
  85.         Catch ex As Exception
  86.             MsgBox("Il file che si sta tentando di aprire non è un file audio valido o non è compatibile con GN Media Player")
  87.         End Try
  88.     End Sub
  89.  
  90.     Private Sub Tempo_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tempo.Tick
  91.         If RiproduzioneVideo = True Then
  92.             If InRiproduzioneVideo.CurrentPosition = InRiproduzioneVideo.Duration Then
  93.                 InRiproduzioneVideo.Stop()
  94.                 Play.Text = "|>"
  95.             End If
  96.         Else
  97.             If InRiproduzioneAudio.CurrentPosition = InRiproduzioneAudio.Duration Then
  98.                 InRiproduzioneAudio.Stop()
  99.                 Play.Text = "|>"
  100.             End If
  101.         End If
  102.     End Sub
  103.  
  104.     Private Sub InformazioniSuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InformazioniSuToolStripMenuItem.Click
  105.         AboutBox.ShowDialog()
  106.     End Sub
  107. End Class