mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Implement audio filters
Use Source:setFilter(type, params...) to set a filter. Use Source:setFilter() to detach the current filter. Use Source:getFilter() to get the currently set filter (or nil). Squashed from pull request 27, and the clean-pr27 branch in love-experiments. --HG-- branch : minor
This commit is contained in:
@@ -25,8 +25,11 @@
|
||||
#include "common/config.h"
|
||||
#include "common/Object.h"
|
||||
#include "audio/Source.h"
|
||||
#include "audio/Filter.h"
|
||||
#include "sound/SoundData.h"
|
||||
#include "sound/Decoder.h"
|
||||
#include "Audio.h"
|
||||
#include "Filter.h"
|
||||
|
||||
// STL
|
||||
#include <vector>
|
||||
@@ -141,6 +144,10 @@ public:
|
||||
virtual float getMaxDistance() const;
|
||||
virtual int getChannels() const;
|
||||
|
||||
virtual bool setFilter(love::audio::Filter::Type type, std::vector<float> ¶ms);
|
||||
virtual bool setFilter();
|
||||
virtual bool getFilter(love::audio::Filter::Type &type, std::vector<float> ¶ms);
|
||||
|
||||
virtual int getFreeBufferCount() const;
|
||||
virtual bool queue(void *data, size_t length, int dataSampleRate, int dataBitDepth, int dataChannels);
|
||||
virtual bool queueAtomic(void *data, ALsizei length);
|
||||
@@ -214,6 +221,8 @@ private:
|
||||
int unusedBufferTop = -1;
|
||||
ALsizei bufferedBytes = 0;
|
||||
|
||||
Filter *filter = nullptr;
|
||||
|
||||
}; // Source
|
||||
|
||||
} // openal
|
||||
|
||||
Reference in New Issue
Block a user