Exemplo n.º 1
0
        private static void OnTimedEvent(object source, ElapsedEventArgs e)
        {
            //Stopwatch sw = new Stopwatch();
            //sw.Start();

            AdControl.decide();
            PauseControl.processTicks();

            //sw.Stop();
            //Console.WriteLine("Elapsed={0} - Window name: {1}", sw.Elapsed,PauseControl.spotifyWindowName);
        }
Exemplo n.º 2
0
 /// Handles the MouseDoubleClick event of the ni control.
 void ni_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if (PauseControl.userDeactivated)
         {
             setPlayingIcon();
             PauseControl.activate();
         }
         else
         {
             setInactiveIcon();
             PauseControl.deactivate();
         }
     }
 }
Exemplo n.º 3
0
 private void pauseCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     if (pauseCheckBox.Checked)
     {
         //Start auto pauser
         //create a option->their string or otherwise map
         Configuration.option_autopause = true;
         FileManager.changeConfig("autopause", "1");
         PauseControl.activate();
     }
     else
     {
         //Stop auto pauser
         Configuration.option_autopause = false;
         FileManager.changeConfig("autopause", "0");
     }
 }
Exemplo n.º 4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            // Show the system tray icon.
            processIcon = new ProcessIcon();

            PauseControl.setInitials();
            FileManager.checkFiles();

            processIcon.Display();


            System.Timers.Timer aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            aTimer.Interval = 250;
            aTimer.Enabled  = true;

            Application.Run();
        }
Exemplo n.º 5
0
 //restarting is done by setting everything to initial state
 public static void restart()
 {
     ticksInactive = 1;
     PauseControl.setInitials();
 }