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
Aqua Player - frmNewSong.vb

frmNewSong.vb

Caricato da: Totem
Scarica il programma completo

  1. Imports Songs_Collector.frmSong
  2. Public Class frmNewSong
  3.     Public Sub New(ByVal FileName As String, ByVal Mode As String, Optional ByVal SongIndex As Int32 = 0)
  4.         InitializeComponent()
  5.         That.Path = FileName
  6.         That.Nome = IO.Path.GetFileNameWithoutExtension(FileName)
  7.         OMode = Mode
  8.         MainIndex = SongIndex
  9.         If MultimediaType(FileName) = MultimediaFile.VideoFile Then
  10.             Label5.Enabled = False
  11.             Label3.Text = "Regista:"
  12.             txtGroup.Enabled = False
  13.         End If
  14.     End Sub
  15.     Public That As Song
  16.     Public OMode As String
  17.     Public MainIndex As Int32
  18.     Private Sub frmNewSong_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  19.         txtName.Text = frmSong.lstSongs.Items(MainIndex)
  20.         txtPath.Text = That.Path
  21.         Select Case OMode
  22.             Case "ADD"
  23.                 Me.Text = "Aggiungi un brano"
  24.             Case "MOD"
  25.                 Me.Text = "Modifica un brano"
  26.                 txtAuthor.Text = MainDB(MainIndex).Autore
  27.                 txtType.Text = MainDB(MainIndex).Genere
  28.                 txtGroup.Text = MainDB(MainIndex).Gruppo
  29.                 txtYear.Text = MainDB(MainIndex).Anno
  30.                 txtNotes.Text = MainDB(MainIndex).Note
  31.                 nudVal.Value = MainDB(MainIndex).Valutazione
  32.         End Select
  33.     End Sub
  34.     Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
  35.         Dim C As Song = Nothing
  36.         C.Nome = txtName.Text
  37.         C.Path = txtPath.Text
  38.         C.Anno = txtYear.Text
  39.         C.Autore = txtAuthor.Text
  40.         C.Genere = txtType.Text
  41.         C.Gruppo = txtGroup.Text
  42.         C.Note = txtNotes.Text
  43.         C.Valutazione = nudVal.Value
  44.         Select Case OMode
  45.             Case "ADD"
  46.                 MainDB.Add(C)
  47.                 frmSong.lstSongs.Items.Add(C.Nome)
  48.             Case "MOD"
  49.                 MainDB(MainIndex) = C
  50.                 frmSong.lstSongs.Items(MainIndex) = C.Nome
  51.         End Select
  52.         If frmSong.strAutoSave.Checked Then
  53.             Save()
  54.         End If
  55.         Me.Close()
  56.     End Sub
  57. End Class