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.cpp | |
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.cpp')
-rw-r--r-- | layer_video.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layer_video.cpp b/layer_video.cpp index ec9e258..bcedda0 100644 --- a/layer_video.cpp +++ b/layer_video.cpp @@ -43,6 +43,13 @@ LayerVideo::LayerVideo(const char *name, SDL_Rect geo, float opacity, "--no-xlib" /* tell VLC to not use Xlib */ }; + url_osc_id = register_method("url", "s", (OscServer::MethodHandlerCb)url_osc); + rate_osc_id = register_method("rate", "f", (OscServer::MethodHandlerCb)rate_osc); + position_osc_id = register_method("position", "f", + (OscServer::MethodHandlerCb)position_osc); + paused_osc_id = register_method("paused", "i", + (OscServer::MethodHandlerCb)paused_osc); + LayerVideo::geo(geo); LayerVideo::alpha(opacity); LayerVideo::rate(1.); @@ -223,6 +230,11 @@ LayerVideo::frame(SDL_Surface *target) LayerVideo::~LayerVideo() { + unregister_method(url_osc_id); + unregister_method(rate_osc_id); + unregister_method(position_osc_id); + unregister_method(paused_osc_id); + if (mp) libvlc_media_player_release(mp); libvlc_release(vlcinst); |