summaryrefslogtreecommitdiff
path: root/modules/webm
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 14:29:06 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:54:55 +0200
commit07bc4e2f96f8f47991339654ff4ab16acc19d44f (patch)
tree43cdc7cfe8239c23065616a931de3769d2db1e86 /modules/webm
parent0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (diff)
Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
Diffstat (limited to 'modules/webm')
-rw-r--r--modules/webm/video_stream_webm.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp
index 897900249e..47c54b61e9 100644
--- a/modules/webm/video_stream_webm.cpp
+++ b/modules/webm/video_stream_webm.cpp
@@ -147,6 +147,7 @@ void VideoStreamPlaybackWebm::stop() {
time = 0.0;
playing = false;
}
+
void VideoStreamPlaybackWebm::play() {
stop();
@@ -163,6 +164,7 @@ bool VideoStreamPlaybackWebm::is_playing() const {
void VideoStreamPlaybackWebm::set_paused(bool p_paused) {
paused = p_paused;
}
+
bool VideoStreamPlaybackWebm::is_paused() const {
return paused;
}
@@ -170,6 +172,7 @@ bool VideoStreamPlaybackWebm::is_paused() const {
void VideoStreamPlaybackWebm::set_loop(bool p_enable) {
//Empty
}
+
bool VideoStreamPlaybackWebm::has_loop() const {
return false;
}
@@ -183,6 +186,7 @@ float VideoStreamPlaybackWebm::get_length() const {
float VideoStreamPlaybackWebm::get_playback_position() const {
return video_pos;
}
+
void VideoStreamPlaybackWebm::seek(float p_time) {
//Not implemented
}
@@ -319,11 +323,13 @@ void VideoStreamPlaybackWebm::set_mix_callback(VideoStreamPlayback::AudioMixCall
mix_callback = p_callback;
mix_udata = p_userdata;
}
+
int VideoStreamPlaybackWebm::get_channels() const {
if (audio)
return webm->getChannels();
return 0;
}
+
int VideoStreamPlaybackWebm::get_mix_rate() const {
if (audio)
return webm->getSampleRate();
@@ -386,6 +392,7 @@ Ref<VideoStreamPlayback> VideoStreamWebm::instance_playback() {
void VideoStreamWebm::set_file(const String &p_file) {
file = p_file;
}
+
String VideoStreamWebm::get_file() {
return file;
}