diff options
| author | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
| commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
| tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /modules/opus/audio_stream_opus.h | |
| parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
| download | godot-5dbf180.tar.gz godot-5dbf180.tar.zst godot-5dbf180.zip | |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'modules/opus/audio_stream_opus.h')
| -rw-r--r-- | modules/opus/audio_stream_opus.h | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/modules/opus/audio_stream_opus.h b/modules/opus/audio_stream_opus.h index 5093456cc..f1bee121b 100644 --- a/modules/opus/audio_stream_opus.h +++ b/modules/opus/audio_stream_opus.h @@ -40,10 +40,10 @@ class AudioStreamPlaybackOpus : public AudioStreamPlayback { - GDCLASS(AudioStreamPlaybackOpus,AudioStreamPlayback) + GDCLASS(AudioStreamPlaybackOpus, AudioStreamPlayback) enum { - MIN_MIX=1024 + MIN_MIX = 1024 }; FileAccess *f; @@ -78,19 +78,19 @@ class AudioStreamPlaybackOpus : public AudioStreamPlayback { float loop_restart_time; public: - Error set_file(const String& p_file); + Error set_file(const String &p_file); - virtual void play(float p_from=0); + virtual void play(float p_from = 0); virtual void stop(); virtual bool is_playing() const { return playing; } - virtual void set_loop_restart_time(float p_time) { loop_restart_time=p_time; } + virtual void set_loop_restart_time(float p_time) { loop_restart_time = p_time; } - virtual void set_paused(bool p_paused) { paused=p_paused; } + virtual void set_paused(bool p_paused) { paused = p_paused; } virtual bool is_paused() const { return paused; } - virtual void set_loop(bool p_enable) { loops=p_enable; } - virtual bool has_loop() const {return loops; } + virtual void set_loop(bool p_enable) { loops = p_enable; } + virtual bool has_loop() const { return loops; } virtual float get_length() const; @@ -106,35 +106,33 @@ public: virtual int get_minimum_buffer_size() const; - virtual int mix(int16_t* p_bufer,int p_frames); + virtual int mix(int16_t *p_bufer, int p_frames); AudioStreamPlaybackOpus(); ~AudioStreamPlaybackOpus(); }; +class AudioStreamOpus : public AudioStream { -class AudioStreamOpus: public AudioStream { - - GDCLASS(AudioStreamOpus,AudioStream) + GDCLASS(AudioStreamOpus, AudioStream) String file; -public: +public: Ref<AudioStreamPlayback> instance_playback() { - Ref<AudioStreamPlaybackOpus> pb = memnew( AudioStreamPlaybackOpus ); + Ref<AudioStreamPlaybackOpus> pb = memnew(AudioStreamPlaybackOpus); pb->set_file(file); return pb; } - void set_file(const String& p_file) { file=p_file; } - + void set_file(const String &p_file) { file = p_file; } }; -class ResourceFormatLoaderAudioStreamOpus: public ResourceFormatLoader { +class ResourceFormatLoaderAudioStreamOpus : public ResourceFormatLoader { public: - virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL); virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String& p_type) const; + virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; }; |
