summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-01-26 11:24:14 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-01-26 11:29:07 +0100
commitbb6c0d3e8bb1982bce3e1c219c1a4a2d187227f0 (patch)
treeee58635301c11a4e5e46d99030e54cff3e4ca9ba /scene
parent55cc46a0523df8df85aa6ffec6b58ff86e5ab1af (diff)
doc: Complete documentation for VideoStreams
Also quick clean up of the matching C++ files.
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/audio_stream_sample.cpp3
-rw-r--r--scene/resources/audio_stream_sample.h6
-rw-r--r--scene/resources/material.h2
-rw-r--r--scene/resources/texture.h3
-rw-r--r--scene/resources/video_stream.cpp39
-rw-r--r--scene/resources/video_stream.h11
6 files changed, 9 insertions, 55 deletions
diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp
index bfc7f407eb..e8cb40154e 100644
--- a/scene/resources/audio_stream_sample.cpp
+++ b/scene/resources/audio_stream_sample.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "audio_stream_sample.h"
+
#include "core/io/marshalls.h"
#include "core/os/file_access.h"
@@ -656,8 +657,8 @@ AudioStreamSample::AudioStreamSample() {
data = NULL;
data_bytes = 0;
}
-AudioStreamSample::~AudioStreamSample() {
+AudioStreamSample::~AudioStreamSample() {
if (data) {
AudioServer::get_singleton()->audio_data_free(data);
data = NULL;
diff --git a/scene/resources/audio_stream_sample.h b/scene/resources/audio_stream_sample.h
index d5d8f073fb..adcac14ea8 100644
--- a/scene/resources/audio_stream_sample.h
+++ b/scene/resources/audio_stream_sample.h
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef AUDIOSTREAMSAMPLE_H
-#define AUDIOSTREAMSAMPLE_H
+#ifndef AUDIO_STREAM_SAMPLE_H
+#define AUDIO_STREAM_SAMPLE_H
#include "servers/audio/audio_stream.h"
@@ -153,4 +153,4 @@ public:
VARIANT_ENUM_CAST(AudioStreamSample::Format)
VARIANT_ENUM_CAST(AudioStreamSample::LoopMode)
-#endif // AUDIOSTREAMSample_H
+#endif // AUDIO_STREAM_SAMPLE_H
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 3c2a7c928a..c2501a258f 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -42,7 +42,7 @@ class Material : public Resource {
GDCLASS(Material, Resource);
RES_BASE_EXTENSION("material")
- OBJ_SAVE_TYPE(Material)
+ OBJ_SAVE_TYPE(Material);
RID material;
Ref<Material> next_pass;
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index fcd8547d07..fa698d387b 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -45,7 +45,8 @@
class Texture : public Resource {
GDCLASS(Texture, Resource);
- OBJ_SAVE_TYPE(Texture); //children are all saved as Texture, so they can be exchanged
+ OBJ_SAVE_TYPE(Texture); // Saves derived classes with common type so they can be interchanged.
+
protected:
static void _bind_methods();
diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp
deleted file mode 100644
index 81b4477c9a..0000000000
--- a/scene/resources/video_stream.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*************************************************************************/
-/* video_stream.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "video_stream.h"
-
-void VideoStreamPlayback::_bind_methods(){
-
-};
-
-VideoStreamPlayback::VideoStreamPlayback(){
-
-};
diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h
index d8aee2eac3..444bb698ae 100644
--- a/scene/resources/video_stream.h
+++ b/scene/resources/video_stream.h
@@ -37,9 +37,6 @@ class VideoStreamPlayback : public Resource {
GDCLASS(VideoStreamPlayback, Resource);
-protected:
- static void _bind_methods();
-
public:
typedef int (*AudioMixCallback)(void *p_udata, const float *p_data, int p_frames);
@@ -61,28 +58,22 @@ public:
virtual void set_audio_track(int p_idx) = 0;
- //virtual int mix(int16_t* p_buffer,int p_frames)=0;
-
virtual Ref<Texture> get_texture() const = 0;
virtual void update(float p_delta) = 0;
virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata) = 0;
virtual int get_channels() const = 0;
virtual int get_mix_rate() const = 0;
-
- VideoStreamPlayback();
};
class VideoStream : public Resource {
GDCLASS(VideoStream, Resource);
- OBJ_SAVE_TYPE(VideoStream); //children are all saved as AudioStream, so they can be exchanged
+ OBJ_SAVE_TYPE(VideoStream); // Saves derived classes with common type so they can be interchanged.
public:
virtual void set_audio_track(int p_track) = 0;
virtual Ref<VideoStreamPlayback> instance_playback() = 0;
-
- VideoStream() {}
};
#endif