54 if (startFrame > stopFrame)
59 slice
.start =
static_cast<
double> (startFrame);
60 slice
.stop =
static_cast<
double> (stopFrame);
64 static Slice time (
double startSeconds,
double stopSeconds)
68 if (startSeconds < 0.0 || stopSeconds < 0.0)
71 if (startSeconds > stopSeconds)
76 slice
.start = startSeconds;
77 slice
.stop = stopSeconds;
83 if (startBin > stopBin)
88 slice
.start =
static_cast<
double> (startBin);
89 slice
.stop =
static_cast<
double> (stopBin);
95 if (startHz < 0.0 || stopHz < 0.0)
Thrown when an unexpected container size is encountered.
Thrown when an inappropriate value is encountered.
#define HART_THROW_OR_RETURN(ExceptionType, message, returnValue)
Throws an exception if HART_DO_NOT_THROW_EXCEPTIONS is set, prints a message and returns a specified ...
constexpr double inf
Infinity.
static SampleType floatsEqual(SampleType a, SampleType b, SampleType epsilon=(SampleType) 1e-8)
Compares two floating point numbers within a given tolerance.
Represents a slice of analysis data.
static Slice freq(double startHz, double stopHz)
static Slice bins(size_t startBin, size_t stopBin)
static Slice time(double startSeconds, double stopSeconds)
static Slice frames(size_t startFrame, size_t stopFrame)