| 1 | /** |
| 2 | * Copyright (c) 2006-2023 LOVE Development Team |
| 3 | * |
| 4 | * This software is provided 'as-is', without any express or implied |
| 5 | * warranty. In no event will the authors be held liable for any damages |
| 6 | * arising from the use of this software. |
| 7 | * |
| 8 | * Permission is granted to anyone to use this software for any purpose, |
| 9 | * including commercial applications, and to alter it and redistribute it |
| 10 | * freely, subject to the following restrictions: |
| 11 | * |
| 12 | * 1. The origin of this software must not be misrepresented; you must not |
| 13 | * claim that you wrote the original software. If you use this software |
| 14 | * in a product, an acknowledgment in the product documentation would be |
| 15 | * appreciated but is not required. |
| 16 | * 2. Altered source versions must be plainly marked as such, and must not be |
| 17 | * misrepresented as being the original software. |
| 18 | * 3. This notice may not be removed or altered from any source distribution. |
| 19 | **/ |
| 20 | |
| 21 | #ifndef LOVE_AUDIO_NULL_AUDIO_H |
| 22 | #define LOVE_AUDIO_NULL_AUDIO_H |
| 23 | |
| 24 | // LOVE |
| 25 | #include "audio/Audio.h" |
| 26 | |
| 27 | #include "RecordingDevice.h" |
| 28 | #include "Source.h" |
| 29 | |
| 30 | namespace love |
| 31 | { |
| 32 | namespace audio |
| 33 | { |
| 34 | namespace null |
| 35 | { |
| 36 | |
| 37 | class Audio : public love::audio::Audio |
| 38 | { |
| 39 | public: |
| 40 | |
| 41 | Audio(); |
| 42 | virtual ~Audio(); |
| 43 | |
| 44 | // Implements Module. |
| 45 | const char *getName() const; |
| 46 | |
| 47 | // Implements Audio. |
| 48 | love::audio::Source *newSource(love::sound::Decoder *decoder); |
| 49 | love::audio::Source *newSource(love::sound::SoundData *soundData); |
| 50 | love::audio::Source *newSource(int sampleRate, int bitDepth, int channels, int buffers); |
| 51 | int getActiveSourceCount() const; |
| 52 | int getMaxSources() const; |
| 53 | bool play(love::audio::Source *source); |
| 54 | bool play(const std::vector<love::audio::Source*> &sources); |
| 55 | void stop(love::audio::Source *source); |
| 56 | void stop(const std::vector<love::audio::Source*> &sources); |
| 57 | void stop(); |
| 58 | void pause(love::audio::Source *source); |
| 59 | void pause(const std::vector<love::audio::Source*> &sources); |
| 60 | std::vector<love::audio::Source*> pause(); |
| 61 | void setVolume(float volume); |
| 62 | float getVolume() const; |
| 63 | |
| 64 | void getPosition(float *v) const; |
| 65 | void setPosition(float *v); |
| 66 | void getOrientation(float *v) const; |
| 67 | void setOrientation(float *v); |
| 68 | void getVelocity(float *v) const; |
| 69 | void setVelocity(float *v); |
| 70 | |
| 71 | void setDopplerScale(float scale); |
| 72 | float getDopplerScale() const; |
| 73 | //void setMeter(float scale); |
| 74 | //float getMeter() const; |
| 75 | |
| 76 | const std::vector<love::audio::RecordingDevice*> &getRecordingDevices(); |
| 77 | |
| 78 | DistanceModel getDistanceModel() const; |
| 79 | void setDistanceModel(DistanceModel distanceModel); |
| 80 | |
| 81 | bool setEffect(const char *, std::map<Effect::Parameter, float> ¶ms); |
| 82 | bool unsetEffect(const char *); |
| 83 | bool getEffect(const char *, std::map<Effect::Parameter, float> ¶ms); |
| 84 | bool getActiveEffects(std::vector<std::string> &list) const; |
| 85 | int getMaxSceneEffects() const; |
| 86 | int getMaxSourceEffects() const; |
| 87 | bool isEFXsupported() const; |
| 88 | |
| 89 | void pauseContext(); |
| 90 | void resumeContext(); |
| 91 | |
| 92 | private: |
| 93 | float volume; |
| 94 | DistanceModel distanceModel; |
| 95 | std::vector<love::audio::RecordingDevice*> capture; |
| 96 | |
| 97 | }; // Audio |
| 98 | |
| 99 | } // null |
| 100 | } // audio |
| 101 | } // love |
| 102 | |
| 103 | #endif // LOVE_AUDIO_NULL_AUDIO_H |
| 104 | |