Exemplo n.º 1
0
        public frmEditSong(Song song_)
        {
            InitializeComponent();
            song = song_;

            lblCurrentlyEditing.Text = song.Title + " - " + song.Artist;

            txtTitle.Text = song.Title;
            txtArtist.Text = song.Artist;
            txtAlbum.Text = song.Album;
        }
Exemplo n.º 2
0
        public static void UpdateMusic(Song track)
        {
            string title = null;
            string artist = null;
            const string album = "Radio Horizonte";

                title = track.Title;
                artist = track.Artist;

            var buffer = String.Format("\\0Music\\0{0}\\0{{0}} - {{1}}\\0{1}\\0{2}\\0{3}\\0\\0\0", "0", title, artist, album);

            COPYDATASTRUCT data;
            data.dwData = 0x0547;
            data.lpData = VarPtr(buffer);
            data.cbData = buffer.Length * 2;

            var hWnd = 0;
            do
            {
                hWnd = FindWindowEx(0, hWnd, "MsnMsgrUIManager", null);
                SendMessage(hWnd, WM_COPYDATA, 0, VarPtr(data));
            } while (hWnd != 0);
        }
Exemplo n.º 3
0
        private void LoadSongs()
        {
            // Fill in the listview with all music files after loading the current folders
            if (currentFolders.Count > 0)
            {
                int count = 0;
                foreach (string fPath in currentFolders)
                {
                    string[] musicFiles = Directory.GetFiles(fPath);

                    foreach (string musicFile in musicFiles)
                    {
                        if (Path.GetExtension(musicFile) == ".mp3" || Path.GetExtension(musicFile) == ".wmv" || Path.GetExtension(musicFile) == ".MP3")
                        {
                            TagLib.File mFile = TagLib.File.Create(musicFile);

                            Song songFile = new Song(musicFile, mFile.Tag.Title, mFile.Tag.FirstAlbumArtist, mFile.Tag.Album);

                            listSongs.Add(songFile);
                            listMusic.Items.Add(songFile.Title);
                            listMusic.Items[count].SubItems.Add(songFile.Artist);
                            listMusic.Items[count].SubItems.Add(songFile.Album);

                            count++;
                        }
                        else
                        {
                           // Console.WriteLine("Error: " + Path.GetExtension(musicFile));
                           // Console.WriteLine("Invalid file: " + musicFile);
                        }
                    }

                }
            }
            else
            {
                Console.WriteLine("Current folders count <= 0");
            }
        }