aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-22 06:49:37 -0800
committerChris Robinson <[email protected]>2018-11-22 06:49:37 -0800
commit9d73e03aaa6d51d6b787b0d576760f782fc3394f (patch)
tree5fa306fa15d385db3d72098ac870dcd204b4ce7b /OpenAL32
parentb3b42201828bb737c55c20bd46af10b40d10ef85 (diff)
Use unique_ptr for bs2b
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h3
-rw-r--r--OpenAL32/Include/bs2b.h22
2 files changed, 11 insertions, 14 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index de602d35..3fdd4e02 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -210,6 +210,7 @@ struct EffectState;
struct Uhj2Encoder;
struct BFormatDec;
struct AmbiUpsampler;
+struct bs2b;
#define DEFAULT_OUTPUT_RATE (44100)
@@ -678,7 +679,7 @@ struct ALCdevice_struct {
std::unique_ptr<BFormatDec> AmbiDecoder;
/* Stereo-to-binaural filter */
- struct bs2b *Bs2b{nullptr};
+ std::unique_ptr<bs2b> Bs2b;
/* First-order ambisonic upsampler for higher-order output */
std::unique_ptr<AmbiUpsampler> AmbiUp;
diff --git a/OpenAL32/Include/bs2b.h b/OpenAL32/Include/bs2b.h
index 13cdf9a6..e235e765 100644
--- a/OpenAL32/Include/bs2b.h
+++ b/OpenAL32/Include/bs2b.h
@@ -24,6 +24,8 @@
#ifndef BS2B_H
#define BS2B_H
+#include "almalloc.h"
+
/* Number of crossfeed levels */
#define BS2B_CLEVELS 3
@@ -42,10 +44,6 @@
/* Default sample rate (Hz) */
#define BS2B_DEFAULT_SRATE 44100
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
struct bs2b {
int level; /* Crossfeed level */
int srate; /* Sample rate (Hz) */
@@ -67,6 +65,8 @@ struct bs2b {
float lo;
float hi;
} last_sample[2];
+
+ DEF_NEWDEL(bs2b)
};
/* Clear buffers and set new coefficients with new crossfeed level and sample
@@ -74,21 +74,17 @@ struct bs2b {
* level - crossfeed level of *LEVEL values.
* srate - sample rate by Hz.
*/
-void bs2b_set_params(struct bs2b *bs2b, int level, int srate);
+void bs2b_set_params(bs2b *bs2b, int level, int srate);
/* Return current crossfeed level value */
-int bs2b_get_level(struct bs2b *bs2b);
+int bs2b_get_level(bs2b *bs2b);
/* Return current sample rate value */
-int bs2b_get_srate(struct bs2b *bs2b);
+int bs2b_get_srate(bs2b *bs2b);
/* Clear buffer */
-void bs2b_clear(struct bs2b *bs2b);
-
-void bs2b_cross_feed(struct bs2b *bs2b, float *RESTRICT Left, float *RESTRICT Right, int SamplesToDo);
+void bs2b_clear(bs2b *bs2b);
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* __cplusplus */
+void bs2b_cross_feed(bs2b *bs2b, float *RESTRICT Left, float *RESTRICT Right, int SamplesToDo);
#endif /* BS2B_H */