LMMS
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//==============================================================================
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
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 //==============================================================================
162};
163
164//==============================================================================
177
178//==============================================================================
183
184} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_RelativeTime.h:37
int64 inMilliseconds() const noexcept
Definition juce_RelativeTime.cpp:40
static RelativeTime minutes(double numberOfMinutes) noexcept
Definition juce_RelativeTime.cpp:34
double numSeconds
Definition juce_RelativeTime.h:161
static RelativeTime milliseconds(int milliseconds) noexcept
Definition juce_RelativeTime.cpp:31
double inSeconds() const noexcept
Definition juce_RelativeTime.h:101
static RelativeTime hours(double numberOfHours) noexcept
Definition juce_RelativeTime.cpp:35
static RelativeTime days(double numberOfDays) noexcept
Definition juce_RelativeTime.cpp:36
static RelativeTime weeks(double numberOfWeeks) noexcept
Definition juce_RelativeTime.cpp:37
static RelativeTime seconds(double seconds) noexcept
Definition juce_RelativeTime.cpp:33
RelativeTime(double seconds=0.0) noexcept
Definition juce_RelativeTime.cpp:26
Definition juce_String.h:53
#define JUCE_CALLTYPE
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
long long int64
Definition juce_MathsFunctions.h:54
#define const
Definition zconf.h:137