diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-26 20:08:10 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-26 20:08:10 +0200 |
commit | 7e5561d02f257f5c2ae54f4d55dee1093cf2ad4b (patch) | |
tree | a447fe2a109da09d9f06c67a0534873f9ac3a27b /layer_video.h | |
parent | eac5ac91ba27ae8e6d24625d6fa170425c51d459 (diff) | |
download | osc-graphics-7e5561d02f257f5c2ae54f4d55dee1093cf2ad4b.tar.gz |
isolated OSC server specific code in OscServer class and allow to register methods in order to localize OSC method handling
i.e. every Layer class is stand-alone now
Diffstat (limited to 'layer_video.h')
-rw-r--r-- | layer_video.h | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/layer_video.h b/layer_video.h index 7130039..4917b40 100644 --- a/layer_video.h +++ b/layer_video.h @@ -4,11 +4,16 @@ #include <SDL.h> #include <SDL_thread.h> +#include <lo/lo.h> + #include <vlc/vlc.h> #include "osc_graphics.h" #include "layer.h" +#define LayerVideo_Info_Name "video" +#define LayerVideo_Info_Types "s" /* url */ + class LayerVideo : public Layer { libvlc_instance_t *vlcinst; libvlc_media_player_t *mp; @@ -23,10 +28,17 @@ class LayerVideo : public Layer { bool pausedv; public: + static void register_layer() {} + LayerVideo(const char *name, SDL_Rect geo = (SDL_Rect){0, 0, 0, 0}, float opacity = 1., const char *url = NULL); + static Layer * + ctor_osc(const char *name, SDL_Rect geo, float opacity, lo_arg **argv) + { + return new LayerVideo(name, geo, opacity, &argv[0]->s); + } ~LayerVideo(); inline void * @@ -43,15 +55,40 @@ public: SDL_UnlockMutex(mutex); } + void frame(SDL_Surface *target); + +private: void geo(SDL_Rect geo); void alpha(float opacity); void url(const char *url = NULL); + OscServer::MethodHandlerId *url_osc_id; + static void + url_osc(LayerVideo *obj, lo_arg **argv) + { + obj->url(&argv[0]->s); + } void rate(float rate); + OscServer::MethodHandlerId *rate_osc_id; + static void + rate_osc(LayerVideo *obj, lo_arg **argv) + { + obj->rate(argv[0]->f); + } void position(float position); + OscServer::MethodHandlerId *position_osc_id; + static void + position_osc(LayerVideo *obj, lo_arg **argv) + { + obj->position(argv[0]->f); + } void paused(bool paused); - - void frame(SDL_Surface *target); + OscServer::MethodHandlerId *paused_osc_id; + static void + paused_osc(LayerVideo *obj, lo_arg **argv) + { + obj->paused(argv[0]->i); + } }; #endif |