Ejemplo n.º 1
0
        public void DownloadBeginning(GrooveAPI.GrooveAPI_Song song)
        {
            if (!_inDownloadMode)
            {
                dgvQueue.Columns.RemoveAt(0);

                DataGridViewTextBoxColumn clmnProg = new DataGridViewTextBoxColumn();
                clmnProg.HeaderText = "Progress";
                clmnProg.Name = "clmnProg";
                dgvQueue.Columns.Insert(0, clmnProg);

                _inDownloadMode = true;
            }
        }
Ejemplo n.º 2
0
        public void AddSong(GrooveAPI.GrooveAPI_Song song)
        {
            DataGridViewRow row = new DataGridViewRow();

            object[] args = new object[5];

            args[0] = " ";
            args[1] = song.Name.Artist;
            args[2] = song.Name.Album;
            args[3] = song.Name.Song;
            args[4] = song.ID.Song;

            row.CreateCells(dgvQueue, args);
            dgvQueue.Rows.Add(row);

            _songs.Add(song);
        }
Ejemplo n.º 3
0
 void API_RunWorkerCompleted(object sender, GrooveAPI.APIWorkerCompletedEventArgs e)
 {
     if (e.Type == GrooveAPI.WorkerType.GAPI_TYPE_DOWNLOADER)
     {
         btnDownloadQueue.Text = "Download";
         dq.ProgressReset();
     }
     else if (e.Type == GrooveAPI.WorkerType.GAPI_TYPE_SEARCHER && GrooveAPI.Information.CurrentResults.Count > 0)
     {
         results.Focus();
     }
     else if (e.Type == GrooveAPI.WorkerType.GAPI_TYPE_CONNECTOR)
     {
         tbQuery.Enabled = true;
         tbQuery.Text = "";
         tbQuery.Focus();
     }
 }
Ejemplo n.º 4
0
        public void DownloadComplete(GrooveAPI.GrooveAPI_Song song)
        {
            if (Program.DownloadsCancelled || song.ID.Song == 0)
            {
                if (_inDownloadMode)
                {
                    dgvQueue.Columns.RemoveAt(0);
                    dgvQueue.Columns.Insert(0, clmnRemove);
                    _inDownloadMode = false;
                }
                return;
            }

            DataGridViewRow remove = null;
            int index = 0;
            foreach (DataGridViewRow row in dgvQueue.Rows)
            {
                if ((int)row.Cells[4].Value == song.ID.Song)
                {
                    remove = row;
                    break;
                }
                index++;
            }
            if (remove != null)
            {
                dgvQueue.Rows.Remove(remove);
                _songs.RemoveAt(index);
            }
            if (dgvQueue.Rows.Count == 0)
            {
                dgvQueue.Columns.RemoveAt(0);
                dgvQueue.Columns.Insert(0, clmnRemove);
                _inDownloadMode = false;
            }
        }
Ejemplo n.º 5
0
 private void results_SongChange(object sender, ChangeType type, GrooveAPI.GrooveAPI_Song song)
 {
     dq.AddSong(song);
 }
Ejemplo n.º 6
0
 private void OnSongRemove(GrooveAPI.GrooveAPI_Song song)
 {
     if(SongChange != null)
         SongChange(this, ChangeType.CT_REMOVE, song);
 }
Ejemplo n.º 7
0
 public void ProgressUpdate(GrooveAPI.GrooveAPI_Song song, int bytesRead, int totalBytes)
 {
     foreach(DataGridViewRow row in dgvQueue.Rows)
     {
         if((int)row.Cells[4].Value == song.ID.Song)
             row.Cells[0].Value = _GetByteString(bytesRead, totalBytes);
     }
 }