#include <juce_win32_HiddenMessageWindow.h>
Public Member Functions | |
DeviceChangeDetector (const wchar_t *const name) | |
virtual void | systemDeviceChanged ()=0 |
void | triggerAsyncDeviceChangeCallback () |
Private Member Functions | |
int | getTimerInterval () const noexcept |
Returns the timer's interval. More... | |
bool | isTimerRunning () const noexcept |
Returns true if the timer is currently running. More... | |
void | startTimer (int intervalInMilliseconds) noexcept |
Starts the timer and sets the length of interval required. More... | |
void | startTimerHz (int timerFrequencyHz) noexcept |
Starts the timer with an interval specified in Hertz. More... | |
void | stopTimer () noexcept |
Stops the timer. More... | |
void | timerCallback () override |
The user-defined callback routine that actually gets called periodically. More... | |
Static Private Member Functions | |
static void | callAfterDelay (int milliseconds, std::function< void()> functionToCall) |
Invokes a lambda after a given number of milliseconds. More... | |
static void | callPendingTimersSynchronously () |
For internal use only: invokes any timers that need callbacks. More... | |
static LRESULT CALLBACK | deviceChangeEventCallback (HWND h, const UINT message, const WPARAM wParam, const LPARAM lParam) |
Private Attributes | |
HiddenMessageWindow | messageWindow |
size_t | positionInQueue = (size_t) -1 |
int | timerPeriodMs = 0 |
|
inline |
References juce::HiddenMessageWindow::getHWND(), and messageWindow.
|
staticinherited |
Invokes a lambda after a given number of milliseconds.
|
staticinherited |
For internal use only: invokes any timers that need callbacks.
Don't call this unless you really know what you're doing!
|
inlinestaticprivate |
References juce::gl::h, juce::gl::message, and triggerAsyncDeviceChangeCallback().
|
inlinenoexceptinherited |
Returns the timer's interval.
Referenced by juce::CarbonViewWrapperComponent::setOurSizeToEmbeddedViewSize().
|
inlinenoexceptinherited |
Returns true if the timer is currently running.
|
noexceptinherited |
Starts the timer and sets the length of interval required.
If the timer is already started, this will reset it, so the time between calling this method and the next timer callback will not be less than the interval length passed in.
intervalInMilliseconds | the interval to use (any value less than 1 will be rounded up to 1) |
Referenced by juce::StandalonePluginHolder::init(), juce::CarbonViewWrapperComponent::setOurSizeToEmbeddedViewSize(), and triggerAsyncDeviceChangeCallback().
|
noexceptinherited |
Starts the timer with an interval specified in Hertz.
This is effectively the same as calling startTimer (1000 / timerFrequencyHz).
Referenced by juce::AnimatedPosition< Behaviour >::endDrag(), juce::AnimatedPosition< Behaviour >::nudge(), and juce::AnimatedPosition< Behaviour >::timerCallback().
|
noexceptinherited |
Stops the timer.
No more timer callbacks will be triggered after this method returns.
Note that if you call this from a background thread while the message-thread is already in the middle of your callback, then this method will cancel any future timer callbacks, but it will return without waiting for the current one to finish. The current callback will continue, possibly still running some of your timer code after this method has returned.
Referenced by juce::AnimatedPosition< Behaviour >::beginDrag(), juce::CarbonViewWrapperComponent::setOurSizeToEmbeddedViewSize(), juce::AnimatedPosition< Behaviour >::setPosition(), timerCallback(), juce::AnimatedPosition< Behaviour >::timerCallback(), and juce::StandalonePluginHolder::~StandalonePluginHolder().
|
pure virtual |
Referenced by timerCallback().
|
inlineoverrideprivatevirtual |
The user-defined callback routine that actually gets called periodically.
It's perfectly ok to call startTimer() or stopTimer() from within this callback to change the subsequent intervals.
Implements juce::Timer.
References juce::Timer::stopTimer(), and systemDeviceChanged().
|
inline |
References juce::Timer::startTimer().
Referenced by deviceChangeEventCallback().
|
private |
Referenced by DeviceChangeDetector().
|
privateinherited |
|
privateinherited |