Beispiel #1
0
        internal void PlayedNow(object s, GenericEventArgs <int> e)
        {
            int qPos = e.EventData == -1 ? Queue.Count : e.EventData;

            Queue.RemoveAt(0);
            MusicPiece playingNow = Queue.ElementAt(qPos);

            Queue.Insert(0, playingNow);
            Queue.RemoveAt(qPos);
            renderQueue();
        }
Beispiel #2
0
        //to Queue
        //public MusicPiece(YoutubeInfo inf, User user)
        //{
        //    InitializeComponent();
        //    this._info = inf;
        //    lblTitle.Content = _info.title;
        //    lblChannelName.Content = _info.channelName;
        //    setImage = _info.thumbnail.Url;
        //    created = DateTime.Now;
        //    lbluserName.Content = user.name;
        //}

        public MusicPiece copy()
        {
            MusicPiece musicPiece = new MusicPiece();

            musicPiece.InitializeComponent();
            musicPiece._info               = this._info;
            musicPiece.lblTitle.Text       = _info.title;
            musicPiece.lblChannelName.Text = _info.channelName;
            musicPiece.setImage            = _info.thumbnail.Url;
            musicPiece.created             = DateTime.Now;
            musicPiece.lbluserName.Text    = lbluserName.Text;
            return(musicPiece);
        }
Beispiel #3
0
        public void entSearch_Completed(object s, EventArgs e)
        {
            var    entSearch            = (Entry)s;
            string text                 = entSearch.Text;
            var    infos                = youtubeProvider.LoadVideosKey(text);
            var    tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += AddToQueue_Tapped;
            searchBoard.Children.Clear();
            foreach (YoutubeInfo yi in infos)
            {
                var musicPiece = new MusicPiece(yi);
                musicPiece.GestureRecognizers.Add(tapGestureRecognizer);
                searchBoard.Children.Add(musicPiece);
            }
        }
Beispiel #4
0
        public async Task getQueue()
        {
            Debug.WriteLine("Get Queue!");
            IList <YoutubeInfo> infos = await serverConnection.getQueueTCP();

            if (infos == null)
            {
                sltQueue.Children.Add(new Label()
                {
                    Text = "Nie dogadałem się z serwerem :/"
                });
            }
            else
            {
                foreach (YoutubeInfo info in infos)
                {
                    var musicPiece = new MusicPiece(info);
                    Queue.Add(musicPiece);
                }
                renderQueue();
            }
        }
Beispiel #5
0
 public PiecePosArgs(MusicPiece musicPiece, int qPos)
 {
     this.MusicPiece = musicPiece;
     MusicPiece.GestureRecognizers.Clear();
     this.QPos = qPos;
 }
Beispiel #6
0
 protected virtual void OnSuccessfulQueued(MusicPiece musicPiece, int qPos)
 {
     SuccessfulQueued?.Invoke(this, new PiecePosArgs(musicPiece, qPos));
 }