Beispiel #1
0
 private void btnAddPlaylist_Click(object sender, EventArgs e)
 {
     try
     {
         int            id          = Program.currentProject.FindLastPlaylistID();
         MusicPlaylist  newPlaylist = new MusicPlaylist(id);
         frmAddPlaylist newPllstDlg = new frmAddPlaylist(newPlaylist, true, null);
         if (newPllstDlg.ShowDialog(this) == DialogResult.OK)
         {
             Program.currentProject.AddPlaylist(newPlaylist);
             if (newPllstDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SavePlaylistsNonEnglishData(newPllstDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
Beispiel #2
0
 private void btnNewLang_Click(object sender, EventArgs e)
 {
     try
     {
         // fetch which additional langs already filled for current playlist
         string[] existlangs = new string[nonEngAdditionalData.Count];
         int      i          = 0;
         foreach (var item in nonEngAdditionalData)
         {
             existlangs[i++] = item.Key;
         }
         // if all additional langs already filled, no action occurred
         if (existlangs.Length == Enum.GetValues(typeof(Languages)).Length)
         {
             return;
         }
         frmAddNewLanguage newDlg = new frmAddNewLanguage(!EnglishMoreDataExist(), existlangs);
         if (newDlg.ShowDialog(this) == DialogResult.OK)
         {
             MusicPlaylist p = new MusicPlaylist(playlistToComplete.id);
             p.title       = newDlg.InsertedTitle;
             p.artist      = newDlg.InsertedArtists;
             p.description = newDlg.InsertedDescription;
             if (nonEngAdditionalData.ContainsKey(newDlg.SelectedLanguage))
             {
                 nonEngAdditionalData.Remove(newDlg.SelectedLanguage);
             }
             nonEngAdditionalData.Add(newDlg.SelectedLanguage, p);
         }
         UpdateLangsPanel();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
Beispiel #3
0
 internal void AddPlaylist(MusicPlaylist _newPlaylist)
 {
     this.playlists.library.Add(_newPlaylist);
 }
Beispiel #4
0
 internal MusicPlaylist[] GetPlaylistsCollection()
 {
     MusicPlaylist[] retVal = new MusicPlaylist[this.playlists.library.Count];
     this.playlists.library.CopyTo(retVal);
     return(retVal);
 }
Beispiel #5
0
 internal void LoadMusicFileInfos(string _fullPath, string _fileName)
 {
     this.tracks = MusicPlaylist.DeserializeFilesFromJSON(_fullPath, _fileName);
 }