diff options
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/packed_scene.h | 9 | ||||
-rw-r--r-- | scene/resources/video_stream.cpp | 8 | ||||
-rw-r--r-- | scene/resources/video_stream.h | 35 |
3 files changed, 38 insertions, 14 deletions
diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 6c7fa545d4..0546addd3e 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -32,6 +32,15 @@ #include "resource.h" #include "scene/main/node.h" +//changes: +//1-make the InstanceState a reference inside the resource that can be shared +//2-make the instance "editable" with a flag, save here and load here, no need for property +//3-properly save modifications in sub-scene +//4-add scene inheritance +//5-chain of instance states in editor? (to check what was modified) +//6-saving will be hell + + class PackedScene : public Resource { OBJ_TYPE( PackedScene, Resource ); diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp index b27413bb68..c957fd4c67 100644 --- a/scene/resources/video_stream.cpp +++ b/scene/resources/video_stream.cpp @@ -28,16 +28,12 @@ /*************************************************************************/ #include "video_stream.h" -void VideoStream::_bind_methods() { +void VideoStreamPlayback::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_pending_frame_count"),&VideoStream::get_pending_frame_count); - ObjectTypeDB::bind_method(_MD("pop_frame"),&VideoStream::pop_frame); - ObjectTypeDB::bind_method(_MD("peek_frame"),&VideoStream::peek_frame); - ObjectTypeDB::bind_method(_MD("set_audio_track","idx"),&VideoStream::set_audio_track); }; -VideoStream::VideoStream() { +VideoStreamPlayback::VideoStreamPlayback() { }; diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index 2ad7457ec4..3664275c78 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -33,15 +33,17 @@ #include "scene/resources/texture.h" -class VideoStream : public Resource { +class VideoStreamPlayback : public Resource { - OBJ_TYPE(VideoStream,Resource); + OBJ_TYPE(VideoStreamPlayback,Resource); protected: static void _bind_methods(); public: + typedef int (*AudioMixCallback)(void* p_udata,const int16_t *p_data,int p_frames); + virtual void stop()=0; virtual void play()=0; @@ -58,16 +60,33 @@ public: virtual float get_pos() const=0; virtual void seek_pos(float p_time)=0; - virtual int get_pending_frame_count() const=0; - virtual void pop_frame(Ref<ImageTexture> p_tex)=0; - virtual Image peek_frame() const=0; - virtual void set_audio_track(int p_idx) =0; - virtual void update(float p_time)=0; + //virtual int mix(int16_t* p_bufer,int p_frames)=0; + + virtual Ref<Texture> get_texture()=0; + virtual void update(float p_delta)=0; - VideoStream(); + 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 { + + OBJ_TYPE( VideoStream, Resource ); + OBJ_SAVE_TYPE( VideoStream ); //children are all saved as AudioStream, so they can be exchanged + +public: + + virtual Ref<VideoStreamPlayback> instance_playback()=0; + + VideoStream() {} +}; + + #endif |