LMMS
Loading...
Searching...
No Matches
juce_Timer.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//==============================================================================
52{
53protected:
54 //==============================================================================
58 Timer() noexcept;
59
65 Timer (const Timer&) noexcept;
66
67public:
68 //==============================================================================
70 virtual ~Timer();
71
72 //==============================================================================
78 virtual void timerCallback() = 0;
79
80 //==============================================================================
90 void startTimer (int intervalInMilliseconds) noexcept;
91
95 void startTimerHz (int timerFrequencyHz) noexcept;
96
107 void stopTimer() noexcept;
108
109 //==============================================================================
112
117
118 //==============================================================================
120 static void JUCE_CALLTYPE callAfterDelay (int milliseconds, std::function<void()> functionToCall);
121
122 //==============================================================================
126 static void JUCE_CALLTYPE callPendingTimersSynchronously();
127
128private:
129 class TimerThread;
130 friend class TimerThread;
131 size_t positionInQueue = (size_t) -1;
133
134 Timer& operator= (const Timer&) = delete;
135};
136
137} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Timer.cpp:29
void stopTimer() noexcept
Definition juce_Timer.cpp:357
int getTimerInterval() const noexcept
Definition juce_Timer.h:116
Timer() noexcept
Definition juce_Timer.cpp:316
void startTimerHz(int timerFrequencyHz) noexcept
Definition juce_Timer.cpp:349
bool isTimerRunning() const noexcept
Definition juce_Timer.h:111
size_t positionInQueue
Definition juce_Timer.h:131
int timerPeriodMs
Definition juce_Timer.h:132
void startTimer(int intervalInMilliseconds) noexcept
Definition juce_Timer.cpp:332
virtual void timerCallback()=0
#define JUCE_CALLTYPE
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
#define const
Definition zconf.h:137