Example #1
0
        private void AlbumList_Play_Click(object sender, MouseButtonEventArgs e)
        {
            var              s          = album_list.SelectedItem as Albums;
            string           album      = s.Album;
            List <string>    paths      = new List <string>();
            SQLiteConnection connection = new SQLiteConnection("Data Source=database.db;Version=3;New=False;Compress=True;");

            connection.Open();
            SQLiteCommand command = connection.CreateCommand();

            command.CommandText = "select Title, duration from music where album='" + album + "';";
            SQLiteDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                string title = reader.GetString(0);
                paths.Add(Mp3Info.GetFilePath(title));
            }
            if ((App.Current as App).paths != null)
            {
                (App.Current as App).paths.Clear();
            }
            (App.Current as App).paths      = paths;
            (App.Current as App).startIndex = 0;
            nowPlaying_Page page = new nowPlaying_Page(true);

            NavigationService.Navigate(page);
        }
Example #2
0
        private void song_list_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            /*var s = song_list.SelectedItem as Songs;
             * string path = Mp3Info.GetFilePath(s.Title, recievedAlbum,0);
             * (App.Current as App).nowPlaying_path = path;
             * nowPlaying_Page page = new nowPlaying_Page(false);
             * NavigationService.Navigate(page);
             */
            List <string> paths = new List <string>();

            foreach (var item in song_list.Items)
            {
                var s = item as Songs;
                paths.Add(Mp3Info.GetFilePath(s.Title, recievedAlbum, 0));
            }
            if ((App.Current as App).paths != null)
            {
                (App.Current as App).paths.Clear();
            }
            (App.Current as App).paths      = paths;
            (App.Current as App).startIndex = song_list.SelectedIndex;
            nowPlaying_Page page = new nowPlaying_Page(true);

            NavigationService.Navigate(page);
        }
Example #3
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     if (App.Current.Properties["startupFiles"] != null)
     {
         nowPlaying_Page page = new nowPlaying_Page(true);
         NavigationService.Navigate(page);
         App.Current.Properties["startupFiles"] = null;
     }
 }
Example #4
0
 private void searchEntry_TextBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (searchEntry_TextBox.SelectedIndex >= 0)
     {
         string title = searchEntry_TextBox.SelectedItem.ToString();
         string path  = Mp3Info.GetFilePath(title);
         //(App.Current as App).paths.Clear();
         (App.Current as App).paths = new List <string>();
         (App.Current as App).paths.Add(path);
         (App.Current as App).startIndex = 0;
         //(App.Current as App).nowPlaying_path = path;
         nowPlaying_Page page = new nowPlaying_Page(true);
         NavigationService.Navigate(page);
         searchEntry_TextBox.Text = "";
     }
     else
     {
         //searchEntry_TextBox.Items.Clear();
         searchEntry_TextBox.IsDropDownOpen = false;
     }
 }
Example #5
0
 private void Page_load(object sender, RoutedEventArgs e)
 {
     if (App.Current.Properties["startupFiles"] != null)
     {
         nowPlaying_Page page = new nowPlaying_Page(true);
         NavigationService.Navigate(page);
         App.Current.Properties["startupFiles"] = null;
     }
     else if (!File.Exists("database.db"))
     {
         Task t = Task.Factory.StartNew(() => d.createDatabase())
                  .ContinueWith(ignore => loadArtists())
                  .ContinueWith(ignore => loadSongs())
                  .ContinueWith(ignore => loadGenre())
                  .ContinueWith(ignore => loadAlbums());
     }
     else
     {
         loadArtists();
         loadSongs();
         loadGenre();
         loadAlbums();
     }
 }
Example #6
0
        private void expand_Button_Click(object sender, RoutedEventArgs e)
        {
            nowPlaying_Page page = new nowPlaying_Page(false);

            NavigationService.Navigate(page);
        }