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/vorbis/audio_stream_ogg_vorbis.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/vorbis/audio_stream_ogg_vorbis.h')
| -rw-r--r-- | modules/vorbis/audio_stream_ogg_vorbis.h | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h index bc2bfa2ae..a13e934f2 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.h +++ b/modules/vorbis/audio_stream_ogg_vorbis.h @@ -38,18 +38,18 @@ class AudioStreamPlaybackOGGVorbis : public AudioStreamPlayback { - GDCLASS(AudioStreamPlaybackOGGVorbis,AudioStreamPlayback); + GDCLASS(AudioStreamPlaybackOGGVorbis, AudioStreamPlayback); enum { - MIN_MIX=1024 + MIN_MIX = 1024 }; FileAccess *f; ov_callbacks _ov_callbacks; float length; - static size_t _ov_read_func(void *p_dst,size_t p_data, size_t p_count, void *_f); - static int _ov_seek_func(void *_f,ogg_int64_t offs, int whence); + static size_t _ov_read_func(void *p_dst, size_t p_data, size_t p_count, void *_f); + static int _ov_seek_func(void *_f, ogg_int64_t offs, int whence); static int _ov_close_func(void *_f); static long _ov_tell_func(void *_f); @@ -63,7 +63,6 @@ class AudioStreamPlaybackOGGVorbis : public AudioStreamPlayback { int stream_srate; int current_section; - bool paused; bool loops; int repeats; @@ -75,17 +74,14 @@ class AudioStreamPlaybackOGGVorbis : public AudioStreamPlayback { bool stream_valid; 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; - 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); virtual bool is_paused(bool p_paused) const; @@ -106,37 +102,34 @@ public: virtual int get_mix_rate() const { return stream_srate; } virtual int get_minimum_buffer_size() const { return 0; } - virtual int mix(int16_t* p_bufer,int p_frames); + virtual int mix(int16_t *p_bufer, int p_frames); AudioStreamPlaybackOGGVorbis(); ~AudioStreamPlaybackOGGVorbis(); }; - class AudioStreamOGGVorbis : public AudioStream { - GDCLASS(AudioStreamOGGVorbis,AudioStream); + GDCLASS(AudioStreamOGGVorbis, AudioStream); String file; -public: +public: Ref<AudioStreamPlayback> instance_playback() { - Ref<AudioStreamPlaybackOGGVorbis> pb = memnew( AudioStreamPlaybackOGGVorbis ); + Ref<AudioStreamPlaybackOGGVorbis> pb = memnew(AudioStreamPlaybackOGGVorbis); 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 ResourceFormatLoaderAudioStreamOGGVorbis : 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; }; - #endif // AUDIO_STREAM_OGG_H |
