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_SOURCE_H
22#define LOVE_AUDIO_NULL_SOURCE_H
23
24// LOVE
25#include "common/Object.h"
26#include "audio/Source.h"
27#include "audio/Filter.h"
28
29namespace love
30{
31namespace audio
32{
33namespace null
34{
35
36class Source : public love::audio::Source
37{
38public:
39 Source();
40 virtual ~Source();
41
42 virtual love::audio::Source *clone();
43 virtual bool play();
44 virtual void stop();
45 virtual void pause();
46 virtual bool isPlaying() const;
47 virtual bool isFinished() const;
48 virtual bool update();
49 virtual void setPitch(float pitch);
50 virtual float getPitch() const;
51 virtual void setVolume(float volume);
52 virtual float getVolume() const;
53 virtual void seek(double offset, Unit unit);
54 virtual double tell(Unit unit);
55 virtual double getDuration(Unit unit);
56 virtual void setPosition(float *v);
57 virtual void getPosition(float *v) const;
58 virtual void setVelocity(float *v);
59 virtual void getVelocity(float *v) const;
60 virtual void setDirection(float *v);
61 virtual void getDirection(float *v) const;
62 virtual void setCone(float innerAngle, float outerAngle, float outerVolume, float outerHighGain);
63 virtual void getCone(float &innerAngle, float &outerAngle, float &outerVolume, float &outerHighGain) const;
64 virtual void setRelative(bool enable);
65 virtual bool isRelative() const;
66 void setLooping(bool looping);
67 bool isLooping() const;
68 virtual void setMinVolume(float volume);
69 virtual float getMinVolume() const;
70 virtual void setMaxVolume(float volume);
71 virtual float getMaxVolume() const;
72 virtual void setReferenceDistance(float distance);
73 virtual float getReferenceDistance() const;
74 virtual void setRolloffFactor(float factor);
75 virtual float getRolloffFactor() const;
76 virtual void setMaxDistance(float distance);
77 virtual float getMaxDistance() const;
78 virtual void setAirAbsorptionFactor(float factor);
79 virtual float getAirAbsorptionFactor() const;
80 virtual int getChannelCount() const;
81
82 virtual int getFreeBufferCount() const;
83 virtual bool queue(void *data, size_t length, int dataSampleRate, int dataBitDepth, int dataChannels);
84
85 virtual bool setFilter(const std::map<Filter::Parameter, float> &params);
86 virtual bool setFilter();
87 virtual bool getFilter(std::map<Filter::Parameter, float> &params);
88
89 virtual bool setEffect(const char *effect);
90 virtual bool setEffect(const char *effect, const std::map<Filter::Parameter, float> &params);
91 virtual bool unsetEffect(const char *effect);
92 virtual bool getEffect(const char *effect, std::map<Filter::Parameter, float> &params);
93 virtual bool getActiveEffects(std::vector<std::string> &list) const;
94
95private:
96
97 float pitch;
98 float volume;
99 float coneInnerAngle;
100 float coneOuterAngle;
101 float coneOuterVolume;
102 float coneOuterHighGain;
103 bool relative;
104 bool looping;
105 float minVolume;
106 float maxVolume;
107 float referenceDistance;
108 float rolloffFactor;
109 float maxDistance;
110 float absorptionFactor;
111
112}; // Source
113
114} // null
115} // audio
116} // love
117
118#endif // LOVE_AUDIO_NULL_SOURCE_H
119