JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_MultiTimer.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
45class JUCE_API MultiTimer
46{
47protected:
48 //==============================================================================
53 MultiTimer() noexcept;
54
60 MultiTimer (const MultiTimer&) noexcept;
61
62public:
63 //==============================================================================
65 virtual ~MultiTimer();
66
67 //==============================================================================
74 virtual void timerCallback (int timerID) = 0;
75
76 //==============================================================================
90 void startTimer (int timerID, int intervalInMilliseconds) noexcept;
91
101 void stopTimer (int timerID) noexcept;
102
103 //==============================================================================
107 bool isTimerRunning (int timerID) const noexcept;
108
113 int getTimerInterval (int timerID) const noexcept;
114
115
116 //==============================================================================
117private:
118 SpinLock timerListLock;
119 OwnedArray<Timer> timers;
120
121 Timer* getCallback (int) const noexcept;
122 MultiTimer& operator= (const MultiTimer&);
123};
124
125} // namespace juce
A type of timer class that can run multiple timers with different frequencies, all of which share a s...
virtual void timerCallback(int timerID)=0
The user-defined callback routine that actually gets called by each of the timers that are running.
An array designed for holding objects.
A simple spin-lock class that can be used as a simple, low-overhead mutex for uncontended situations.
Makes repeated callbacks to a virtual method at a specified time interval.
Definition juce_Timer.h:52
JUCE Namespace.