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_RelativeTime.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//==============================================================================
36class JUCE_API RelativeTime
37{
38public:
39 //==============================================================================
45 explicit RelativeTime (double seconds = 0.0) noexcept;
46
48 RelativeTime (const RelativeTime& other) noexcept;
49
51 RelativeTime& operator= (const RelativeTime& other) noexcept;
52
54 ~RelativeTime() noexcept;
55
56 //==============================================================================
60 static RelativeTime milliseconds (int milliseconds) noexcept;
61
65 static RelativeTime milliseconds (int64 milliseconds) noexcept;
66
70 static RelativeTime seconds (double seconds) noexcept;
71
75 static RelativeTime minutes (double numberOfMinutes) noexcept;
76
80 static RelativeTime hours (double numberOfHours) noexcept;
81
85 static RelativeTime days (double numberOfDays) noexcept;
86
90 static RelativeTime weeks (double numberOfWeeks) noexcept;
91
92 //==============================================================================
96 int64 inMilliseconds() const noexcept;
97
101 double inSeconds() const noexcept { return numSeconds; }
102
106 double inMinutes() const noexcept;
107
111 double inHours() const noexcept;
112
116 double inDays() const noexcept;
117
121 double inWeeks() const noexcept;
122
138 String getDescription (const String& returnValueForZeroTime = "0") const;
139
140 //==============================================================================
146 String getApproximateDescription() const;
147
148 //==============================================================================
150 RelativeTime operator+= (RelativeTime timeToAdd) noexcept;
152 RelativeTime operator-= (RelativeTime timeToSubtract) noexcept;
153
155 RelativeTime operator+= (double secondsToAdd) noexcept;
157 RelativeTime operator-= (double secondsToSubtract) noexcept;
158
159private:
160 //==============================================================================
161 double numSeconds;
162};
163
164//==============================================================================
166JUCE_API bool JUCE_CALLTYPE operator== (RelativeTime t1, RelativeTime t2) noexcept;
168JUCE_API bool JUCE_CALLTYPE operator!= (RelativeTime t1, RelativeTime t2) noexcept;
170JUCE_API bool JUCE_CALLTYPE operator> (RelativeTime t1, RelativeTime t2) noexcept;
172JUCE_API bool JUCE_CALLTYPE operator< (RelativeTime t1, RelativeTime t2) noexcept;
174JUCE_API bool JUCE_CALLTYPE operator>= (RelativeTime t1, RelativeTime t2) noexcept;
176JUCE_API bool JUCE_CALLTYPE operator<= (RelativeTime t1, RelativeTime t2) noexcept;
177
178//==============================================================================
180JUCE_API RelativeTime JUCE_CALLTYPE operator+ (RelativeTime t1, RelativeTime t2) noexcept;
182JUCE_API RelativeTime JUCE_CALLTYPE operator- (RelativeTime t1, RelativeTime t2) noexcept;
183
184} // namespace juce
A relative measure of time.
double inSeconds() const noexcept
Returns the number of seconds this time represents.
The JUCE String class!
Definition juce_String.h:53
#define JUCE_CALLTYPE
This macro defines the C calling convention used as the standard for JUCE calls.
JUCE Namespace.
long long int64
A platform-independent 64-bit integer type.