Esempio n. 1
0
        public void showViaToast(ToastForm myForm, String track, String artist)
        {
            myForm.setArtist(artist);
            myForm.setTrack(track);
            myForm.setAlbum("");
            myForm.setAlbumImage(spotifytoaster.Properties.Resources.album_missing);

            // Attempt to load additional information about the track
            if (albumInfo.loadAlbumInfo(artist, track))
            {
                // Set Album Title if we have one
                if (null != albumInfo.getAlbumTitle())
                {
                    myForm.setAlbum(albumInfo.getAlbumTitle());
                }

                // Set Album Image URL if we have one
                if (null != albumInfo.getAlbumImageURL())
                {
                    myForm.setAlbumImageUrl(albumInfo.getAlbumImageURL());
                }

                // Add Track Number to the title if we have one
                if (null != albumInfo.getTrackNumber())
                {
                    myForm.setTrack(albumInfo.getTrackNumber() + ". " + track);
                }
            }

            myForm.Show();
        }
Esempio n. 2
0
    //Constructor for NameChangeTracker
    public NameChangeTracker(ToastForm myForm)
    {
        NameChangeTracker.myForm = myForm;
        psi = new ProcessInformation();
        tmd = new TrackMetadata();
        notify = new Notify();
        //Console.WriteLine(psi.getSpotifyPID());

        // Listen for name change changes for spotify(check pid!=0).
        hWinEventHook = SetWinEventHook(0x0800c, 0x800c, IntPtr.Zero, procDelegate, Convert.ToUInt32(psi.getSpotifyPID()), 0, 0);
        // Listen for create window event across all processes/threads on current desktop.(check pid=0)
        hWinEventHook_start = SetWinEventHook(0x00008000, 0x00008000, IntPtr.Zero, procDelegate_start, 0, 0, 0);
    }