void checkFocus()
    {
        startTimer (jmin (1731, getTimerInterval() * 2));

        TopLevelWindow* active = nullptr;

        if (Process::isForegroundProcess())
        {
            active = currentActive;

            Component* const c = Component::getCurrentlyFocusedComponent();
            TopLevelWindow* tlw = dynamic_cast <TopLevelWindow*> (c);

            if (tlw == nullptr && c != nullptr)
                tlw = c->findParentComponentOfClass<TopLevelWindow>();

            if (tlw != nullptr)
                active = tlw;
        }

        if (active != currentActive)
        {
            currentActive = active;

            for (int i = windows.size(); --i >= 0;)
            {
                TopLevelWindow* const tlw = windows.getUnchecked (i);
                tlw->setWindowActive (isWindowActive (tlw));

                i = jmin (i, windows.size() - 1);
            }

            Desktop::getInstance().triggerFocusCallback();
        }
    }
Esempio n. 2
0
void AudioProcessorValueTreeState::timerCallback()
{
    auto anythingUpdated = flushParameterValuesToValueTree();

    startTimer (anythingUpdated ? 1000 / 50
                                : jlimit (50, 500, getTimerInterval() + 20));
}
Esempio n. 3
0
void ProcessorParameterPropertyComp::timerCallback()
{
  if (paramHasChanged)
  {
    refresh();
    startTimer (1000 / 50);
  }
  else
  {
    startTimer (jmin (1000 / 4, getTimerInterval() + 10));
  }
}
 void timerCallback()
 {
     if (paramHasChanged)
     {
         refresh();
         startTimer (1000 / 50);
     }
     else
     {
         startTimer (jmin (1000 / 4, getTimerInterval() + 10));
     }
 }
Esempio n. 5
0
    void checkFocus()
    {
        startTimer (jmin (1731, getTimerInterval() * 2));

        TopLevelWindow* newActive = findCurrentlyActiveWindow();

        if (newActive != currentActive)
        {
            currentActive = newActive;

            for (int i = windows.size(); --i >= 0;)
                if (TopLevelWindow* tlw = windows[i])
                    tlw->setWindowActive (isWindowActive (tlw));

            Desktop::getInstance().triggerFocusCallback();
        }
    }
void LaunchSpinnerTimer::timerCallback() {
  if (launcherComponent) {
    auto lsp = launcherComponent->launchSpinner.get();
    const auto& lspImg = launcherComponent->launchSpinnerImages;
    
    // change image
    i++;
    if (i == lspImg.size()) { i = 0; }
    lsp->setImage(lspImg[i]);
    
    // check timeout
    t += getTimerInterval();
    if (t > timeout) {
      t = 0;
      lsp->setVisible(false);
      stopTimer();
    }
  }
}
void ZenAudioProcessorValueTreeState::timerCallback()
{
	const int numParams = processor.getParameters().size();
	bool anythingUpdated = false;

	for (int i = 0; i < numParams; ++i)
	{
		AudioProcessorParameter* const ap = processor.getParameters().getUnchecked(i);
		jassert(dynamic_cast<ZenParameter*> (ap) != nullptr);

		ZenParameter* p = static_cast<ZenParameter*> (ap);

		if (p->needsUpdate.compareAndSetBool(0, 1))
		{
			p->copyValueToValueTree();
			anythingUpdated = true;
		}
	}

	startTimer(anythingUpdated ? 1000 / 50
		: jlimit(50, 500, getTimerInterval() + 20));
}