Beispiel #1
0
 /// <summary>
 /// thread pour lancer le timer égal au temps du snooze pour relancer le player.
 /// le stop = true a ce moment la
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonSnooze_Click(object sender, EventArgs e)
 {
     player.controls.pause();
     if (this.buttonSnooze.InvokeRequired)
     {
         SetButtonCallbacks d = new SetButtonCallbacks(SetButtonSnoozeVi);
         this.Invoke(d, new object[] { false });
     }
     else
     {
         // It's on the same thread, no need for Invoke
         this.buttonSnooze.Visible = false;
     }
     startcronosnooze = new Thread(new ThreadStart(this.timerSnooze));
     startcronosnooze.Start();
 }
Beispiel #2
0
 /// <summary>
 /// Quando volta a não estar nos critérios do stop
 /// </summary>
 private void StopsoundClearLabel()
 {
     stop = false;
     labelStopSet("__________________", Color.White);
     if (snoozeb)
     {
         if (this.buttonSnooze.InvokeRequired)
         {
             SetButtonCallbacks d = new SetButtonCallbacks(SetButtonSnoozeVi);
             this.Invoke(d, new object[] { false });
         }
         else
         {
             // It's on the same thread, no need for Invoke
             this.buttonSnooze.Visible = false;
         }
         if (activesnooze)
         {
             startcronosnooze.Abort();
         }
     }
     player.controls.stop();
 }
Beispiel #3
0
 /// <summary>
 /// Son en pause
 /// </summary>
 private void timerSnooze()
 {
     activesnooze = true;
     int seconde = 0;
     int finaltime = snoozeminute * 60;
     while (seconde < finaltime)
     {
         Thread.Sleep(1000);
         seconde++;
     }
     player.controls.play();
     if (this.buttonSnooze.InvokeRequired)
     {
         SetButtonCallbacks d = new SetButtonCallbacks(SetButtonSnoozeVi);
         this.Invoke(d, new object[] { true });
     }
     else
     {
         // It's on the same thread, no need for Invoke
         this.buttonSnooze.Visible = true;
     }
     //activesnooze = false;
 }
Beispiel #4
0
        /// <summary>
        /// view button snooze
        /// </summary>
        private void snooze()
        {
            if (snoozeb)
            {
                if (this.buttonSnooze.InvokeRequired)
                {
                    SetButtonCallbacks d = new SetButtonCallbacks(SetButtonSnoozeVi);
                    this.Invoke(d, new object[] { true });
                }
                else
                {
                    // It's on the same thread, no need for Invoke
                    this.buttonSnooze.Visible = true;
                }

                //buttonSnooze.Visible = true;
            }
        }