Пример #1
0
 /// <summary>
 /// Clear all current data.
 /// </summary>
 private void ClearAll()
 {
     SongTags.Clear();
     Songs.Clear();
     ImportList.Clear();
     CurrentPlayList.Clear();
 }
Пример #2
0
    protected void DeleteTrack_Click(object sender, EventArgs e)
    {
        if (CurrentPlayList.Rows.Count == 0)
        {
            MessageUserControl.ShowInfo("You must have a playlist with entries before trying to remove the track.");
        }
        else
        {
            int selectedrowindex = CurrentPlayList.SelectedIndex;

            if (selectedrowindex > -1)
            {
                int customerid  = GetUserCustomerId();
                int trackid     = int.Parse((CurrentPlayList.Rows[selectedrowindex].FindControl("TrackId") as Label).Text);
                int tracknumber = int.Parse((CurrentPlayList.Rows[selectedrowindex].FindControl("TrackNumber") as Label).Text);
                //MessageUserControl.ShowInfo("track is >" + (CurrentPlayList.Rows[selectedrowindex].FindControl("TrackId") as Label).Text + "<");
                MessageUserControl.TryRun(() =>
                {
                    PlaylistTrackController sysmgr = new PlaylistTrackController();
                    sysmgr.RemovePlaylistTrack(PlayListName.Text, trackid, tracknumber, customerid);
                    List <TracksForPlaylist> results = sysmgr.Get_PlaylistTracks(PlayListName.Text, customerid);
                    CurrentPlayList.DataSource       = results;
                    CurrentPlayList.SelectedIndex    = -1;
                    CurrentPlayList.DataBind();
                });
            }
        }
    }
        public void Dispose()
        {
            AVTransport.Dispose();
            RenderingControl.Dispose();
            ConnectionManager.Dispose();

            this.AV_LastChange.Dispose();
            this.AV_LastChange = null;
            this.RC_LastChange.Dispose();
            this.RC_LastChange = null;
            if (CurrentPlayList != null)
            {
                CurrentPlayList.Dispose();
            }
            this.CurrentPlayList = null;

            this.OnCurrentMetaDataChanged = null;

            this.OnMediaResourceChanged = null;
            this.OnMute = null;
            this.OnNumberOfTracksChanged = null;

            this.OnPositionChanged = null;
            this.OnReady           = null;
            this.OnRemoved         = null;

            this.OnTrackChanged    = null;
            this.OnTrackURIChanged = null;
            this.OnVolume          = null;

            if (OnRemoved != null)
            {
                OnRemoved(this);
            }
        }
Пример #4
0
 public void PlayMusicFiles(List <MusicFile> musicFiles, bool newPlaylist)
 {
     if (newPlaylist)
     {
         Stop();
         CurrentPlayList = _player.playlistCollection.newPlaylist("newSongs");
         musicFiles.ForEach(mFile => CurrentPlayList.appendItem(_player.newMedia(mFile.Url)));
         _player.currentPlaylist = CurrentPlayList;
         _player.controls.play();
     }
     else
     {
         musicFiles.ForEach(mFile => CurrentPlayList.appendItem(_player.newMedia(mFile.Url)));
     }
 }
Пример #5
0
    protected void MoveTrack(int selectedrowindex, string direction)
    {
        int customerid  = GetUserCustomerId();
        int trackid     = int.Parse((CurrentPlayList.Rows[selectedrowindex].FindControl("TrackId") as Label).Text);
        int tracknumber = int.Parse((CurrentPlayList.Rows[selectedrowindex].FindControl("TrackNumber") as Label).Text);

        MessageUserControl.TryRun(() =>
        {
            PlaylistTrackController sysmgr = new PlaylistTrackController();
            sysmgr.MoveTrack(PlayListName.Text, trackid, tracknumber, customerid, direction);
            List <TracksForPlaylist> results = sysmgr.Get_PlaylistTracks(PlayListName.Text, customerid);
            CurrentPlayList.DataSource       = results;
            if (direction.Equals("up"))
            {
                CurrentPlayList.SelectedIndex = selectedrowindex - 1;
            }
            else
            {
                CurrentPlayList.SelectedIndex = selectedrowindex + 1;
            }
            CurrentPlayList.DataBind();
        });
    }
Пример #6
0
    protected void PlayListFetch_Click(object sender, EventArgs e)
    {
        int customerid = GetUserCustomerId();

        if (customerid > 0)
        {
            MessageUserControl.TryRun(() =>
            {
                if (string.IsNullOrEmpty(PlayListName.Text))
                {
                    throw new Exception("Enter a playlist name.");
                }
                else
                {
                    PlaylistTrackController sysmgr   = new PlaylistTrackController();
                    List <TracksForPlaylist> results = sysmgr.Get_PlaylistTracks(PlayListName.Text, customerid);
                    CurrentPlayList.DataSource       = results;
                    CurrentPlayList.DataBind();
                    CurrentPlayList.SelectedIndex = -1;
                }
            });
        }
    }
Пример #7
0
    protected void TrackSearchList_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        int customerid = GetUserCustomerId();

        if (customerid > 0)  //is the user a customer
        {
            ListViewDataItem rowcontents  = e.Item as ListViewDataItem;
            string           playlistname = PlayListName.Text;
            if (string.IsNullOrEmpty(PlayListName.Text))
            {
                MessageUserControl.ShowInfo("Please enter a playlist name.");
            }
            else
            {
                MessageUserControl.TryRun(() =>
                {
                    //the trackid is attached to each ListView row via the CommandArgument parameter

                    //this method does not make the value visible to the user (or in view source unless
                    //   the hacker decompressed the hidden data)

                    //access to the trackid is done via the ListViewCommandEventsArgs e and is treated
                    //as an object, thus it needs to be cast to a string for the Parse to work

                    PlaylistTrackController sysmgr = new PlaylistTrackController();
                    sysmgr.AddTrackToPlayList(playlistname, int.Parse(e.CommandArgument.ToString()), customerid);
                    List <TracksForPlaylist> results = sysmgr.Get_PlaylistTracks(playlistname, customerid);
                    CurrentPlayList.DataSource       = results;
                    CurrentPlayList.DataBind();
                });
            }
        }
        else
        {
            MessageUserControl.ShowInfo("Please use your customer account to manage playlists.");
        }
    }