mirror of
https://github.com/godotengine/godot.git
synced 2025-10-22 09:23:40 +00:00
Bring that Whole New World to the Old Continent too
Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6
.
This commit is contained in:
parent
1d418afe86
commit
f8db8a3faa
1308 changed files with 147754 additions and 174357 deletions
|
@ -29,16 +29,15 @@
|
|||
#ifndef AUDIO_SERVER_JAVASCRIPT_H
|
||||
#define AUDIO_SERVER_JAVASCRIPT_H
|
||||
|
||||
|
||||
#include "servers/audio_server.h"
|
||||
|
||||
class AudioServerJavascript : public AudioServer {
|
||||
class AudioServerJavascript : public AudioServer {
|
||||
|
||||
OBJ_TYPE(AudioServerJavascript,AudioServer);
|
||||
OBJ_TYPE(AudioServerJavascript, AudioServer);
|
||||
|
||||
enum {
|
||||
INTERNAL_BUFFER_SIZE=4096,
|
||||
STREAM_SCALE_BITS=12
|
||||
INTERNAL_BUFFER_SIZE = 4096,
|
||||
STREAM_SCALE_BITS = 12
|
||||
|
||||
};
|
||||
|
||||
|
@ -77,7 +76,6 @@ class AudioServerJavascript : public AudioServer {
|
|||
bool positional;
|
||||
|
||||
bool active;
|
||||
|
||||
};
|
||||
|
||||
mutable RID_Owner<Voice> voice_owner;
|
||||
|
@ -86,19 +84,19 @@ class AudioServerJavascript : public AudioServer {
|
|||
|
||||
struct Stream {
|
||||
bool active;
|
||||
List<Stream*>::Element *E;
|
||||
List<Stream *>::Element *E;
|
||||
AudioStream *audio_stream;
|
||||
EventStream *event_stream;
|
||||
float volume_scale;
|
||||
};
|
||||
|
||||
List<Stream*> active_audio_streams;
|
||||
List<Stream *> active_audio_streams;
|
||||
|
||||
//List<Stream*> event_streams;
|
||||
|
||||
float * internal_buffer;
|
||||
float *internal_buffer;
|
||||
int internal_buffer_channels;
|
||||
int32_t * stream_buffer;
|
||||
int32_t *stream_buffer;
|
||||
|
||||
mutable RID_Owner<Stream> stream_owner;
|
||||
|
||||
|
@ -108,45 +106,41 @@ class AudioServerJavascript : public AudioServer {
|
|||
float event_voice_scale;
|
||||
float fx_volume_scale;
|
||||
|
||||
|
||||
void driver_process_chunk(int p_frames);
|
||||
|
||||
int webaudio_mix_rate;
|
||||
|
||||
|
||||
static AudioServerJavascript *singleton;
|
||||
public:
|
||||
|
||||
public:
|
||||
void mix_to_js(int p_frames);
|
||||
/* SAMPLE API */
|
||||
|
||||
virtual RID sample_create(SampleFormat p_format, bool p_stereo, int p_length);
|
||||
|
||||
virtual void sample_set_description(RID p_sample, const String& p_description);
|
||||
virtual void sample_set_description(RID p_sample, const String &p_description);
|
||||
virtual String sample_get_description(RID p_sample) const;
|
||||
|
||||
virtual SampleFormat sample_get_format(RID p_sample) const;
|
||||
virtual bool sample_is_stereo(RID p_sample) const;
|
||||
virtual int sample_get_length(RID p_sample) const;
|
||||
virtual const void* sample_get_data_ptr(RID p_sample) const;
|
||||
virtual const void *sample_get_data_ptr(RID p_sample) const;
|
||||
|
||||
|
||||
virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer);
|
||||
virtual void sample_set_data(RID p_sample, const DVector<uint8_t> &p_buffer);
|
||||
virtual DVector<uint8_t> sample_get_data(RID p_sample) const;
|
||||
|
||||
virtual void sample_set_mix_rate(RID p_sample,int p_rate);
|
||||
virtual void sample_set_mix_rate(RID p_sample, int p_rate);
|
||||
virtual int sample_get_mix_rate(RID p_sample) const;
|
||||
|
||||
virtual void sample_set_loop_format(RID p_sample,SampleLoopFormat p_format);
|
||||
virtual void sample_set_loop_format(RID p_sample, SampleLoopFormat p_format);
|
||||
virtual SampleLoopFormat sample_get_loop_format(RID p_sample) const;
|
||||
|
||||
virtual void sample_set_loop_begin(RID p_sample,int p_pos);
|
||||
virtual void sample_set_loop_begin(RID p_sample, int p_pos);
|
||||
virtual int sample_get_loop_begin(RID p_sample) const;
|
||||
|
||||
virtual void sample_set_loop_end(RID p_sample,int p_pos);
|
||||
virtual void sample_set_loop_end(RID p_sample, int p_pos);
|
||||
virtual int sample_get_loop_end(RID p_sample) const;
|
||||
|
||||
|
||||
/* VOICE API */
|
||||
|
||||
virtual RID voice_create();
|
||||
|
@ -154,9 +148,9 @@ public:
|
|||
virtual void voice_play(RID p_voice, RID p_sample);
|
||||
|
||||
virtual void voice_set_volume(RID p_voice, float p_volume);
|
||||
virtual void voice_set_pan(RID p_voice, float p_pan, float p_depth=0,float height=0); //pan and depth go from -1 to 1
|
||||
virtual void voice_set_filter(RID p_voice, FilterType p_type, float p_cutoff, float p_resonance, float p_gain=0);
|
||||
virtual void voice_set_chorus(RID p_voice, float p_chorus );
|
||||
virtual void voice_set_pan(RID p_voice, float p_pan, float p_depth = 0, float height = 0); //pan and depth go from -1 to 1
|
||||
virtual void voice_set_filter(RID p_voice, FilterType p_type, float p_cutoff, float p_resonance, float p_gain = 0);
|
||||
virtual void voice_set_chorus(RID p_voice, float p_chorus);
|
||||
virtual void voice_set_reverb(RID p_voice, ReverbRoomType p_room_type, float p_reverb);
|
||||
virtual void voice_set_mix_rate(RID p_voice, int p_mix_rate);
|
||||
virtual void voice_set_positional(RID p_voice, bool p_positional);
|
||||
|
@ -219,7 +213,6 @@ public:
|
|||
virtual double get_mix_time() const; //useful for video -> audio sync
|
||||
virtual double get_output_delay() const;
|
||||
|
||||
|
||||
AudioServerJavascript();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue