parent
120cf39ba0
commit
a53f735155
@ -0,0 +1,116 @@ |
||||
Entity |
||||
{ |
||||
type : 10 |
||||
scale : 1.000 1.000 1.000 |
||||
door_state : 0 |
||||
door_open_position : -7.0000 |
||||
rotation : 0.000 0.000 0.000 1.000 |
||||
door_close_position : 0.0000 |
||||
door_speed : 6.0000 |
||||
position : -9.000 1.000 -6.000 |
||||
flags : 1 |
||||
door_mask : 3 |
||||
name : Door |
||||
archetype : door_blue |
||||
bounding_box_min : -0.500 -0.500 -0.500 |
||||
bounding_box_max : 0.500 0.500 0.500 |
||||
} |
||||
|
||||
Entity |
||||
{ |
||||
type : 9 |
||||
scale : 7.000 11.000 14.000 |
||||
rotation : 0.000 0.000 0.000 1.000 |
||||
trigger_mask : 1 |
||||
position : 0.000 5.000 0.000 |
||||
flags : 9 |
||||
trigger_type : 1 |
||||
name : Door_Trigger |
||||
bounding_box_min : -0.500 -0.500 -0.500 |
||||
bounding_box_max : 0.500 0.500 0.500 |
||||
} |
||||
|
||||
Entity |
||||
{ |
||||
type : 7 |
||||
scale : 1.000 1.000 1.000 |
||||
volume : 1.0000 |
||||
rolloff_factor : 0.9500 |
||||
rotation : 0.000 0.000 0.000 1.000 |
||||
loop : false |
||||
sound_min_distance : 0.0000 |
||||
position : 0.000 0.000 0.000 |
||||
flags : 9 |
||||
source_filename : sounds/door_locked.wav |
||||
sound_type : 1 |
||||
sound_max_distance : 30.0000 |
||||
name : Door_Sound |
||||
bounding_box_min : -0.500 -0.500 -0.500 |
||||
sound_attenuation_type : 2 |
||||
paused : true |
||||
bounding_box_max : 0.500 0.500 0.500 |
||||
} |
||||
|
||||
Entity |
||||
{ |
||||
type : 6 |
||||
scale : 7.000 12.000 0.200 |
||||
material : 0 |
||||
rotation : 0.000 0.000 0.000 1.000 |
||||
diffuse_color : 0.055 0.863 0.839 1.000 |
||||
geometry : cube.symbres |
||||
specular : 0.4000 |
||||
diffuse_texture : default.tga |
||||
diffuse : 1.0000 |
||||
position : 0.012 4.500 0.000 |
||||
flags : 9 |
||||
specular_strength : 62.0000 |
||||
name : Door_Mesh |
||||
uv_scale : 0.300 0.200 |
||||
} |
||||
|
||||
Entity |
||||
{ |
||||
type : 6 |
||||
scale : 1.000 1.000 1.000 |
||||
material : 1 |
||||
rotation : 0.000 0.000 0.000 1.000 |
||||
diffuse_color : 0.870 0.320 0.400 1.000 |
||||
geometry : cube.symbres |
||||
diffuse_texture : white.tga |
||||
position : 4.000 7.500 0.000 |
||||
flags : 9 |
||||
name : Door_Key_Indicator_Red |
||||
uv_scale : 0.300 0.200 |
||||
} |
||||
|
||||
Entity |
||||
{ |
||||
type : 6 |
||||
scale : 1.000 1.000 1.000 |
||||
material : 1 |
||||
rotation : 0.000 0.000 0.000 1.000 |
||||
diffuse_color : 0.530 0.670 0.280 1.000 |
||||
geometry : cube.symbres |
||||
diffuse_texture : white.tga |
||||
position : 4.000 5.500 0.000 |
||||
flags : 9 |
||||
name : Door_Key_Indicator_Green |
||||
uv_scale : 0.300 0.200 |
||||
} |
||||
|
||||
Entity |
||||
{ |
||||
type : 6 |
||||
scale : 1.000 1.000 1.000 |
||||
material : 1 |
||||
rotation : 0.000 0.000 0.000 1.000 |
||||
diffuse_color : 0.100 0.100 0.100 1.000 |
||||
geometry : cube.symbres |
||||
diffuse_texture : white.tga |
||||
position : 4.000 3.500 0.000 |
||||
flags : 9 |
||||
name : Door_Key_Indicator_Blue |
||||
uv_scale : 0.300 0.200 |
||||
} |
||||
|
@ -0,0 +1,70 @@ |
||||
/*
|
||||
AY module for SoLoud audio engine |
||||
Copyright (c) 2020 Jari Komppa |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
|
||||
3. This notice may not be removed or altered from any source |
||||
distribution. |
||||
*/ |
||||
|
||||
#ifndef AY_H |
||||
#define AY_H |
||||
|
||||
#include "soloud.h" |
||||
|
||||
class ChipPlayer; |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
class Ay; |
||||
class File; |
||||
class AyInstance : public AudioSourceInstance |
||||
{ |
||||
public: |
||||
Ay *mParent; |
||||
ChipPlayer *mChip; |
||||
int mPos; |
||||
|
||||
AyInstance(Ay *aParent); |
||||
~AyInstance(); |
||||
virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); |
||||
virtual bool hasEnded(); |
||||
virtual result rewind(); |
||||
virtual float getInfo(unsigned int aInfoKey); |
||||
}; |
||||
|
||||
class Ay : public AudioSource |
||||
{ |
||||
public: |
||||
bool mYm; |
||||
int mChipspeed; |
||||
int mCpuspeed; |
||||
int mLooppos; |
||||
int mLength; |
||||
unsigned short* mOps; |
||||
public: |
||||
Ay(); |
||||
~Ay(); |
||||
result load(const char *aFilename); |
||||
result loadFile(File *aFile); |
||||
result loadMem(const unsigned char* aMem, unsigned int aLength, bool aCopy, bool aTakeOwnership); |
||||
virtual AudioSourceInstance *createInstance(); |
||||
}; |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,82 @@ |
||||
/*
|
||||
SoLoud audio engine |
||||
Copyright (c) 2013-2020 Jari Komppa |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
|
||||
3. This notice may not be removed or altered from any source |
||||
distribution. |
||||
*/ |
||||
|
||||
#ifndef SOLOUD_EQFILTER_H |
||||
#define SOLOUD_EQFILTER_H |
||||
|
||||
#include "soloud.h" |
||||
#include "soloud_fftfilter.h" |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
class EqFilter; |
||||
|
||||
class EqFilterInstance : public FFTFilterInstance |
||||
{ |
||||
enum FILTERATTRIBUTE |
||||
{ |
||||
WET = 0, |
||||
BAND1 = 1, |
||||
BAND2 = 2, |
||||
BAND3 = 3, |
||||
BAND4 = 4, |
||||
BAND5 = 5, |
||||
BAND6 = 6, |
||||
BAND7 = 7, |
||||
BAND8 = 8 |
||||
}; |
||||
EqFilter *mParent; |
||||
public: |
||||
virtual void fftFilterChannel(float *aFFTBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); |
||||
EqFilterInstance(EqFilter *aParent); |
||||
}; |
||||
|
||||
class EqFilter : public FFTFilter |
||||
{ |
||||
public: |
||||
enum FILTERATTRIBUTE |
||||
{ |
||||
WET = 0, |
||||
BAND1 = 1, |
||||
BAND2 = 2, |
||||
BAND3 = 3, |
||||
BAND4 = 4, |
||||
BAND5 = 5, |
||||
BAND6 = 6, |
||||
BAND7 = 7, |
||||
BAND8 = 8 |
||||
}; |
||||
virtual int getParamCount(); |
||||
virtual const char* getParamName(unsigned int aParamIndex); |
||||
virtual unsigned int getParamType(unsigned int aParamIndex); |
||||
virtual float getParamMax(unsigned int aParamIndex); |
||||
virtual float getParamMin(unsigned int aParamIndex); |
||||
float mVolume[8]; |
||||
result setParam(unsigned int aBand, float aVolume); |
||||
virtual FilterInstance *createInstance(); |
||||
EqFilter(); |
||||
}; |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,83 @@ |
||||
/*
|
||||
SoLoud audio engine |
||||
Copyright (c) 2013-2020 Jari Komppa |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
|
||||
3. This notice may not be removed or altered from any source |
||||
distribution. |
||||
*/ |
||||
|
||||
#ifndef SOLOUD_FREEVERBFILTER_H |
||||
#define SOLOUD_FREEVERBFILTER_H |
||||
|
||||
#include "soloud.h" |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
class FreeverbFilter; |
||||
namespace FreeverbImpl |
||||
{ |
||||
class Revmodel; |
||||
} |
||||
|
||||
class FreeverbFilterInstance : public FilterInstance |
||||
{ |
||||
enum FILTERPARAM { |
||||
WET = 0, |
||||
FREEZE, |
||||
ROOMSIZE, |
||||
DAMP, |
||||
WIDTH |
||||
};
|
||||
|
||||
FreeverbFilter *mParent; |
||||
FreeverbImpl::Revmodel *mModel; |
||||
public: |
||||
virtual void filter(float* aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); |
||||
virtual ~FreeverbFilterInstance(); |
||||
FreeverbFilterInstance(FreeverbFilter *aParent); |
||||
}; |
||||
|
||||
class FreeverbFilter : public Filter |
||||
{ |
||||
public: |
||||
enum FILTERPARAM { |
||||
WET = 0, |
||||
FREEZE, |
||||
ROOMSIZE, |
||||
DAMP, |
||||
WIDTH |
||||
}; |
||||
virtual int getParamCount(); |
||||
virtual const char* getParamName(unsigned int aParamIndex); |
||||
virtual unsigned int getParamType(unsigned int aParamIndex); |
||||
virtual float getParamMax(unsigned int aParamIndex); |
||||
virtual float getParamMin(unsigned int aParamIndex); |
||||
|
||||
float mMode; |
||||
float mRoomSize; |
||||
float mDamp; |
||||
float mWidth; |
||||
virtual FreeverbFilterInstance *createInstance(); |
||||
FreeverbFilter(); |
||||
result setParams(float aMode, float aRoomSize, float aDamp, float aWidth); |
||||
virtual ~FreeverbFilter(); |
||||
}; |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,53 @@ |
||||
/*
|
||||
SoLoud audio engine |
||||
Copyright (c) 2020 Jari Komppa |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
|
||||
3. This notice may not be removed or altered from any source |
||||
distribution. |
||||
*/ |
||||
|
||||
#ifndef SOLOUD_MISC_H |
||||
#define SOLOUD_MISC_H |
||||
|
||||
#include "soloud.h" |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
namespace Misc |
||||
{ |
||||
// Generate a waveform.
|
||||
float generateWaveform(int aWaveform, float p); |
||||
|
||||
// WELL512 random
|
||||
class Prg |
||||
{ |
||||
public: |
||||
// random generator
|
||||
Prg(); |
||||
unsigned int mState[16]; |
||||
unsigned int mIndex; |
||||
unsigned int rand(); |
||||
float rand_float(); |
||||
void srand(int aSeed); |
||||
}; |
||||
|
||||
}; |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,74 @@ |
||||
/*
|
||||
SoLoud audio engine |
||||
Copyright (c) 2020 Jari Komppa |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
|
||||
3. This notice may not be removed or altered from any source |
||||
distribution. |
||||
*/ |
||||
|
||||
#ifndef SOLOUD_NOISE_H |
||||
#define SOLOUD_NOISE_H |
||||
|
||||
#include "soloud.h" |
||||
#include "soloud_misc.h" |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
class Noise; |
||||
|
||||
class NoiseInstance : public AudioSourceInstance |
||||
{ |
||||
public: |
||||
NoiseInstance(Noise *aParent); |
||||
~NoiseInstance(); |
||||
|
||||
virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); |
||||
virtual bool hasEnded(); |
||||
|
||||
public: |
||||
float mOctaveScale[10]; |
||||
Misc::Prg mPrg; |
||||
}; |
||||
|
||||
class Noise : public AudioSource |
||||
{ |
||||
public: |
||||
|
||||
enum NOISETYPES |
||||
{ |
||||
WHITE = 0, |
||||
PINK, |
||||
BROWNISH, |
||||
BLUEISH |
||||
}; |
||||
|
||||
Noise(); |
||||
|
||||
void setOctaveScale(float aOct0, float aOct1, float aOct2, float aOct3, float aOct4, float aOct5, float aOct6, float aOct7, float aOct8, float aOct9); |
||||
void setType(int aType); |
||||
|
||||
virtual ~Noise(); |
||||
|
||||
public: |
||||
virtual AudioSourceInstance *createInstance(); |
||||
float mOctaveScale[10]; |
||||
}; |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,72 @@ |
||||
/*
|
||||
SoLoud audio engine |
||||
Copyright (c) 2013-2018 Jari Komppa |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
|
||||
3. This notice may not be removed or altered from any source |
||||
distribution. |
||||
*/ |
||||
|
||||
#ifndef SOLOUD_QUEUE_H |
||||
#define SOLOUD_QUEUE_H |
||||
|
||||
#include "soloud.h" |
||||
|
||||
#define SOLOUD_QUEUE_MAX 32 |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
class Queue; |
||||
|
||||
class QueueInstance : public AudioSourceInstance |
||||
{ |
||||
Queue *mParent; |
||||
public: |
||||
QueueInstance(Queue *aParent); |
||||
virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); |
||||
virtual bool hasEnded(); |
||||
virtual ~QueueInstance(); |
||||
}; |
||||
|
||||
class Queue : public AudioSource |
||||
{ |
||||
public: |
||||
Queue(); |
||||
virtual QueueInstance *createInstance(); |
||||
// Play sound through the queue
|
||||
result play(AudioSource &aSound); |
||||
// Number of audio sources queued for replay
|
||||
unsigned int getQueueCount(); |
||||
// Is this audio source currently playing?
|
||||
bool isCurrentlyPlaying(AudioSource &aSound); |
||||
// Set params by reading them from an audio source
|
||||
result setParamsFromAudioSource(AudioSource &aSound); |
||||
// Set params manually
|
||||
result setParams(float aSamplerate, unsigned int aChannels = 2); |
||||
|
||||
public: |
||||
unsigned int mReadIndex, mWriteIndex, mCount; |
||||
AudioSourceInstance *mSource[SOLOUD_QUEUE_MAX]; |
||||
QueueInstance *mInstance; |
||||
handle mQueueHandle; |
||||
void findQueueHandle(); |
||||
|
||||
}; |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,72 @@ |
||||
/*
|
||||
SoLoud audio engine |
||||
Copyright (c) 2020 Jari Komppa |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
|
||||
3. This notice may not be removed or altered from any source |
||||
distribution. |
||||
*/ |
||||
|
||||
#ifndef SOLOUD_ROBOTIZEFILTER_H |
||||
#define SOLOUD_ROBOTIZEFILTER_H |
||||
|
||||
#include "soloud.h" |
||||
#include "soloud_filter.h" |
||||
#include "soloud_misc.h" |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
class RobotizeFilter; |
||||
|
||||
class RobotizeFilterInstance : public FilterInstance |
||||
{ |
||||
enum FILTERATTRIBUTE |
||||
{ |
||||
WET = 0, |
||||
FREQ, |
||||
WAVE |
||||
}; |
||||
RobotizeFilter *mParent; |
||||
public: |
||||
virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); |
||||
RobotizeFilterInstance(RobotizeFilter *aParent); |
||||
}; |
||||
|
||||
class RobotizeFilter : public Filter |
||||
{ |
||||
public: |
||||
enum FILTERATTRIBUTE |
||||
{ |
||||
WET = 0, |
||||
FREQ, |
||||
WAVE |
||||
}; |
||||
float mFreq; |
||||
int mWave; |
||||
virtual int getParamCount(); |
||||
virtual const char* getParamName(unsigned int aParamIndex); |
||||
virtual unsigned int getParamType(unsigned int aParamIndex); |
||||
virtual float getParamMax(unsigned int aParamIndex); |
||||
virtual float getParamMin(unsigned int aParamIndex); |
||||
void setParams(float aFreq, int aWaveform); |
||||
virtual FilterInstance *createInstance(); |
||||
RobotizeFilter(); |
||||
}; |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,84 @@ |
||||
/*
|
||||
SoLoud audio engine |
||||
Copyright (c) 2013-2018 Jari Komppa |
||||
|
||||
vizsn speech synthesizer (c) by Ville-Matias Heikkilä, |
||||
released under WTFPL, http://www.wtfpl.net/txt/copying/
|
||||
(in short, "do whatever you want to") |
||||
|
||||
Integration and changes to work with SoLoud by Jari Komppa, |
||||
released under same license. |
||||
*/ |
||||
|
||||
#ifndef SOLOUD_VIZSN_H |
||||
#define SOLOUD_VIZSN_H |
||||
|
||||
#include "soloud.h" |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
class Vizsn; |
||||
|
||||
struct VizsnResonator |
||||
{ |
||||
public: |
||||
float a, b, c, p1, p2; |
||||
|
||||
float resonate(float i); |
||||
float antiresonate(float i); |
||||
VizsnResonator(); |
||||
}; |
||||
|
||||
struct VizsnBank |
||||
{ |
||||
VizsnResonator r[10]; |
||||
float pitch; |
||||
float frica, voice, aspir, bypas, breth; |
||||
VizsnBank(); |
||||
}; |
||||
|
||||
class VizsnInstance : public AudioSourceInstance |
||||
{ |
||||
public: |
||||
VizsnInstance(Vizsn *aParent); |
||||
~VizsnInstance(); |
||||
|
||||
virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); |
||||
virtual bool hasEnded(); |
||||
|
||||
public: |
||||
Vizsn *mParent; |
||||
VizsnBank mBank0, mBank1, mBank0to1; |
||||
int mNper, mNmod, mNopen; |
||||
int mEchobuf[1024], mPtr; |
||||
int mCurrentVoiceType; |
||||
float mPitch; |
||||
char *mS; |
||||
float mBuf[2048]; |
||||
unsigned int mBufwrite; |
||||
unsigned int mBufread; |
||||
float vcsrc(int aPitch, int aVoicetype); |
||||
float noisrc(); |
||||
float genwave(); |
||||
void setphone(VizsnBank *aB, char aP, float aPitch); |
||||
void slidePrepare(int aNumtix); |
||||
void slideTick(); |
||||
int mA; |
||||
int mB; |
||||
int mOrgv; |
||||
float mGlotlast; |
||||
}; |
||||
|
||||
class Vizsn : public AudioSource |
||||
{ |
||||
public: |
||||
char *mText; |
||||
Vizsn(); |
||||
virtual ~Vizsn(); |
||||
void setText(char *aText); |
||||
public: |
||||
virtual AudioSourceInstance *createInstance(); |
||||
}; |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,63 @@ |
||||
/*
|
||||
SoLoud audio engine |
||||
Copyright (c) 2013-2018 Jari Komppa |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
|
||||
3. This notice may not be removed or altered from any source |
||||
distribution. |
||||
*/ |
||||
|
||||
#ifndef SOLOUD_WAVESHAPERFILTER_H |
||||
#define SOLOUD_WAVESHAPERFILTER_H |
||||
|
||||
#include "soloud.h" |
||||
|
||||
namespace SoLoud |
||||
{ |
||||
class WaveShaperFilter; |
||||
|
||||
class WaveShaperFilterInstance : public FilterInstance |
||||
{
|
||||
WaveShaperFilter *mParent; |
||||
public: |
||||
virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); |
||||
virtual ~WaveShaperFilterInstance(); |
||||
WaveShaperFilterInstance(WaveShaperFilter *aParent); |
||||
}; |
||||
|
||||
class WaveShaperFilter : public Filter |
||||
{ |
||||
public: |
||||
enum FILTERPARAMS { |
||||
WET = 0, |
||||
AMOUNT |
||||
}; |
||||
float mAmount; |
||||
virtual WaveShaperFilterInstance *createInstance(); |
||||
result setParams(float aAmount); |
||||
WaveShaperFilter(); |
||||
virtual ~WaveShaperFilter(); |
||||
virtual int getParamCount(); |
||||
virtual const char* getParamName(unsigned int aParamIndex); |
||||
virtual unsigned int getParamType(unsigned int aParamIndex); |
||||
virtual float getParamMax(unsigned int aParamIndex); |
||||
virtual float getParamMin(unsigned int aParamIndex); |
||||
}; |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,115 @@ |
||||
/*
|
||||
* zx7 decompress by Jari Komppa, under public domain / unlicense |
||||
* |
||||
* Heavily based on zx7 decompressor by Einar Saukas.
|
||||
* Einar Saukas requests that you mention the use of dx7, but |
||||
* this is not enforced by any way. |
||||
* |
||||
* Note that compressor has a different license! |
||||
*/ |
||||
|
||||
#ifndef ZX7DECOMPRESS_H |
||||
#define ZX7DECOMPRESS_H |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
struct zx7_io |
||||
{ |
||||
unsigned char* input_data; |
||||
unsigned char* output_data; |
||||
size_t input_index; |
||||
size_t output_index; |
||||
int bit_mask; |
||||
int bit_value; |
||||
}; |
||||
|
||||
static int zx7_read_byte(struct zx7_io *io) { |
||||
return io->input_data[io->input_index++]; |
||||
} |
||||
|
||||
static int zx7_read_bit(struct zx7_io *io) { |
||||
io->bit_mask >>= 1; |
||||
if (io->bit_mask == 0) { |
||||
io->bit_mask = 128; |
||||
io->bit_value = zx7_read_byte(io); |
||||
} |
||||
return io->bit_value & io->bit_mask ? 1 : 0; |
||||
} |
||||
|
||||
static int zx7_read_elias_gamma(struct zx7_io *io) { |
||||
int i = 0; |
||||
int value = 0; |
||||
|
||||
while (!zx7_read_bit(io)) { |
||||
i++; |
||||
} |
||||
if (i > 15) { |
||||
return -1; |
||||
} |
||||
value = 1; |
||||
while (i--) { |
||||
value = value << 1 | zx7_read_bit(io); |
||||
} |
||||
return value; |
||||
} |
||||
|
||||
static int zx7_read_offset(struct zx7_io *io) { |
||||
int value = 0; |
||||
int i = 0; |
||||
|
||||
value = zx7_read_byte(io); |
||||
if (value < 128) { |
||||
return value; |
||||
} else { |
||||
i = zx7_read_bit(io); |
||||
i = i << 1 | zx7_read_bit(io); |
||||
i = i << 1 | zx7_read_bit(io); |
||||
i = i << 1 | zx7_read_bit(io); |
||||
return (value & 127 | i << 7) + 128; |
||||
} |
||||
} |
||||
|
||||
static void zx7_write_byte(struct zx7_io *io, int value) { |
||||
io->output_data[io->output_index++] = value; |
||||
} |
||||
|
||||
static void zx7_write_bytes(struct zx7_io *io, int offset, int length) { |
||||
int i; |
||||
while (length-- > 0) { |
||||
i = io->output_index - offset; |
||||
zx7_write_byte(io, io->output_data[i]); |
||||
} |
||||
} |
||||
|
||||
static int zx7_decompress(unsigned char *input_data, unsigned char *output_data) { |
||||
struct zx7_io io; |
||||
int length; |
||||
|
||||
io.input_data = input_data; |
||||
io.output_data = output_data; |
||||
io.input_index = 0; |
||||
io.output_index = 0; |
||||
io.bit_mask = 0; |
||||
io.bit_value = 0; |
||||
|
||||
zx7_write_byte(&io, zx7_read_byte(&io)); |
||||
while (1) { |
||||
if (!zx7_read_bit(&io)) { |
||||
zx7_write_byte(&io, zx7_read_byte(&io)); |
||||
} else { |
||||
length = zx7_read_elias_gamma(&io) + 1; |
||||
if (length == 0) { |
||||
return io.input_index; |
||||
} |
||||
zx7_write_bytes(&io, zx7_read_offset(&io) + 1, length); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif // ZX7DECOMPRESS_H
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue