Exemplo n.º 1
0
        private void updateNextRefreshCallback()
        {
            switch (Setting.PodcastDownloadSchedule)
            {
            case PodcastDownloadSchedule.Manual:
            case PodcastDownloadSchedule.EveryTime:
                if (updateTimer != Clock.NULL_ALARM)
                {
                    Clock.RemoveAlarm(ref updateTimer);
                }
                break;

            case PodcastDownloadSchedule.FifteenMinutes:
                Clock.Update(ref updateTimer, autoRefreshSubscriptions, 1000 * 60 * 15, true);
                break;

            case PodcastDownloadSchedule.HalfHour:
                Clock.Update(ref updateTimer, autoRefreshSubscriptions, 1000 * 60 * 30, true);
                break;

            case PodcastDownloadSchedule.Hourly:
                Clock.Update(ref updateTimer, autoRefreshSubscriptions, 1000 * 60 * 60, true);
                break;
            }
        }
Exemplo n.º 2
0
        private void showMessage(string Message)
        {
            message = Message;
            Clock.Update(ref msgTick, clearMessage, 2500, false);

            this.Invalidate();
        }
Exemplo n.º 3
0
 public void ShowPriorityMessage(string Message)
 {
     priorityMessage  = true;
     temporaryMessage = Message;
     Clock.Update(ref temporaryDisplayRevert, revertTemporaryMessage, 5000, false);
     this.Invalidate();
 }
Exemplo n.º 4
0
 protected override void OnResize(EventArgs e)
 {
     base.OnResize(e);
     if (initialized)
     {
         Clock.Update(ref resizeAlarm, resize, 100, false);
     }
 }
Exemplo n.º 5
0
 private static void resetRestartAlarm()
 {
     if (directories.Count > 0)
     {
         Clock.Update(ref restartAlarm, Start, 3600000, false);
     }
     else
     {
         Clock.RemoveAlarm(ref restartAlarm);
     }
 }
Exemplo n.º 6
0
        private void preventPowerEvent()
        {
            if (Setting.DisableScreensaver)
            {
                if (controller.Playing || !Setting.DisableScreensaverOnlyWhenPlaying)
                {
                    Lib.DoFakeKeystroke();
                }

                Clock.Update(ref powerEventAlarm, preventPowerEvent, 200000, true); // 3.5 min
            }
        }
Exemplo n.º 7
0
 private void repeatVolChange()
 {
     if (volDownMouseDown)
     {
         controller.RequestAction(QActionType.VolumeDownLarge);
         Clock.Update(ref volChangeTimer, repeatVolChange, VOL_ADJUST_RATE, false);
     }
     else if (volUpMouseDown)
     {
         controller.RequestAction(QActionType.VolumeUpLarge);
         Clock.Update(ref volChangeTimer, repeatVolChange, VOL_ADJUST_RATE, false);
     }
 }
Exemplo n.º 8
0
        public void ShowLetter(char Letter)
        {
            if (Letter > '\0')
            {
                Clock.Update(ref scrollHintLetterClearTick, clearScrollHintLetter, 1300, false);

                if (scrollHintLetter != Letter)
                {
                    scrollHintLetter = Letter;
                    this.Invalidate();
                }
            }
        }
Exemplo n.º 9
0
        private void scroll(QScrollBar Sender, int Value)
        {
            int band = (int)(Sender.Tag);

            if (btnFineControl.Value)
            {
                CurrentEqualizer.Values[band] = Value;
            }
            else if (btnAllTogether.Value)
            {
                float oldVal = CurrentEqualizer.Values[band];
                float newVal = Sender.Value;
                float diff   = newVal - oldVal;

                for (int i = 0; i < numBands; i++)
                {
                    CurrentEqualizer.Values[i] = Math.Max(-SCALE_FLOAT, Math.Min(SCALE_FLOAT, CurrentEqualizer.Values[i] + diff));
                    scrollBars[i].Value        = (int)CurrentEqualizer.Values[i];
                }
            }
            else
            {
                float oldVal = CurrentEqualizer.Values[band];

                CurrentEqualizer.Values[band] = Value;

                float newVal = Value;
                float factor = Math.Min(scrollFactor, Math.Abs(4.0f * (newVal - oldVal) / SCALE_FLOAT));

                for (int i = 1; i < numBands; i++)
                {
                    if (band + i < numBands)
                    {
                        CurrentEqualizer.Values[band + i] += ((((CurrentEqualizer.Values[band + i - 1] + newVal) / 2) - CurrentEqualizer.Values[band + i]) * factor);
                    }
                    if (band - i >= 0)
                    {
                        CurrentEqualizer.Values[band - i] += ((((CurrentEqualizer.Values[band - i + 1] + newVal) / 2) - CurrentEqualizer.Values[band - i]) * factor);
                    }
                    factor *= scrollFactor;
                }

                for (int i = 0; i < numBands; i++)
                {
                    scrollBars[i].Value = (int)CurrentEqualizer.Values[i];
                }
            }
            Clock.Update(ref eqChangeTimer, eqChanged, 360, false);
        }
Exemplo n.º 10
0
        private void tempCallback(Track Track)
        {
            if (Track != null && Track.Cover != null)
            {
                temporaryTrack = Track;

                Clock.Update(ref temporaryDisplayRevert, revertTemporaryTrack, 5000, false);

                TemporaryImage = temporaryTrack.Cover;
            }
            else
            {
                temporaryTrack = null;
                TemporaryImage = null;
            }
        }
Exemplo n.º 11
0
 private void invalidate(Item i)
 {
     if (i != null)
     {
         if (renderItem != null)
         {
             renderItem = null;
             this.Invalidate();
         }
         else
         {
             Clock.Update(ref refreshAllDelay, this.refreshAll, 50, false);
             renderItem = i;
             this.Invalidate(i.R);
         }
     }
 }
Exemplo n.º 12
0
        private bool touch()
        {
            if (alive && Clock.TimeRemaining(timer) > 700)
            {
                dontClose = true;

                Clock.Update(ref this.timer, close, 5000, false);

                dontClose = false;

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 13
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            base.OnMouseClick(e);

            Clock.RemoveAlarm(ref volChangeTimer);

            mouseDown = false;

            if (dragging)
            {
                dragging = false;
            }
            else
            {
                if (exitRect.Contains(e.Location))
                {
                    exit();
                }
                else if (backRect.Contains(e.Location))
                {
                    back();
                }
                else if (playPauseRect.Contains(e.Location))
                {
                    playPause();
                }
                else if (nextRect.Contains(e.Location))
                {
                    next();
                }
                else if (muteRect.Contains(e.Location))
                {
                    mute();
                }
                else if (e.Location.X > timeRect.X)
                {
                    if (!this.radio)
                    {
                        Clock.Update(ref showInfoTimer, showInfo, 300, false);
                    }
                }
            }
        }
Exemplo n.º 14
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            mouseDown    = true;
            lastPoint    = e.Location;
            initialPoint = this.Location;

            volUpMouseDown   = false;
            volDownMouseDown = false;
            if (volUpRect.Contains(e.Location))
            {
                volUpMouseDown = true;
                controller.RequestAction(QActionType.VolumeUpLarge);
                Clock.Update(ref volChangeTimer, repeatVolChange, VOL_ADJUST_RATE, false);
            }
            else if (volDownRect.Contains(e.Location))
            {
                volDownMouseDown = true;
                controller.RequestAction(QActionType.VolumeDownLarge);
                Clock.Update(ref volChangeTimer, repeatVolChange, VOL_ADJUST_RATE, false);
            }
        }
Exemplo n.º 15
0
 protected override void OnResize(EventArgs e)
 {
     base.OnResize(e);
     Clock.Update(ref setupDelay, setupItems, 100, false);
     System.Diagnostics.Debug.WriteLine("resize");
 }
Exemplo n.º 16
0
 private void volUpdate(object sender, EventArgs e)
 {
     showVol = true;
     Clock.Update(ref volTimer, noVol, 2000, false);
     this.Invalidate(timeRect);
 }
Exemplo n.º 17
0
 private void txtFilter_TextChanged(object sender, EventArgs e)
 {
     Clock.Update(ref textTimer, processTextChange, 140, false);
 }