pandemonium_engine_minimal/scene/resources/video_stream.h

51 lines
1.3 KiB
C++

#ifndef VIDEO_STREAM_H
#define VIDEO_STREAM_H
/* video_stream.h */
#include "scene/resources/texture.h"
class VideoStreamPlayback : public Resource {
GDCLASS(VideoStreamPlayback, Resource);
public:
typedef int (*AudioMixCallback)(void *p_udata, const float *p_data, int p_frames);
virtual void stop() = 0;
virtual void play() = 0;
virtual bool is_playing() const = 0;
virtual void set_paused(bool p_paused) = 0;
virtual bool is_paused() const = 0;
virtual void set_loop(bool p_enable) = 0;
virtual bool has_loop() const = 0;
virtual float get_length() const = 0;
virtual float get_playback_position() const = 0;
virtual void seek(float p_time) = 0;
virtual void set_audio_track(int p_idx) = 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;
};
class VideoStream : public Resource {
GDCLASS(VideoStream, Resource);
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;
};
#endif