You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
826 B
44 lines
826 B
#ifndef __GLOBALS_H__
|
|
#define __GLOBALS_H__
|
|
|
|
#define SAMPLE_RATE 48000
|
|
|
|
struct frame {
|
|
float left;
|
|
float right;
|
|
|
|
inline frame operator+(const frame& rhs) {
|
|
return {
|
|
.left = left + rhs.left,
|
|
.right = right + rhs.right
|
|
};
|
|
}
|
|
|
|
inline frame operator+=(const frame& rhs) {
|
|
this->left += rhs.left;
|
|
this->right += rhs.right;
|
|
return *this;
|
|
}
|
|
|
|
inline frame operator*(float rhs) {
|
|
return {
|
|
.left = left * rhs,
|
|
.right = right * rhs
|
|
};
|
|
}
|
|
|
|
inline frame operator+=(float rhs) {
|
|
this->left += rhs;
|
|
this->right += rhs;
|
|
return *this;
|
|
}
|
|
|
|
|
|
inline frame operator*=(float rhs) {
|
|
this->left *= rhs;
|
|
this->right *= rhs;
|
|
return *this;
|
|
}
|
|
};
|
|
|
|
#endif |