StorageFrame

portability/boost
zetaPRIME 2019-06-23 17:59:55 -04:00
parent 0b2d4d99f0
commit 61db0ebd85
1 changed files with 9 additions and 2 deletions

View File

@ -1,8 +1,7 @@
#pragma once
namespace Xybrid::Data {
class AudioFrame {
public:
struct AudioFrame {
// stored as double here for operational precision
double l = 0;
double r = 0;
@ -33,4 +32,12 @@ namespace Xybrid::Data {
static AudioFrame gainBalanceMult(double gain, double balance);
inline AudioFrame gainBalance(double gain, double balance) const { return *this*gainBalanceMult(gain, balance); }
};
struct StorageFrame {
float l = 0;
float r = 0;
inline StorageFrame() = default;
inline StorageFrame(const AudioFrame& o) : l(static_cast<float>(o.l)), r(static_cast<float>(o.r)) { }
inline operator AudioFrame() const { return AudioFrame(l, r); }
};
}