OpenShot Audio Library | OpenShotAudio 0.3.2
Loading...
Searching...
No Matches
juce_RelativeTime.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2017 - ROLI Ltd.
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 //==============================================================================
153
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
double inSeconds() const noexcept