[vlc-commits] windowed Mac plugin: implement control functions for the toolbar
Felix Paul Kühne
git at videolan.org
Wed Jan 2 13:29:11 CET 2013
npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jan 2 12:58:09 2013 +0100| [cc39dc8fbac239580402aa19b545bb04ff4f7f8a] | committer: Felix Paul Kühne
windowed Mac plugin: implement control functions for the toolbar
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=cc39dc8fbac239580402aa19b545bb04ff4f7f8a
---
npapi/vlcplugin_mac.h | 6 +++---
npapi/vlcplugin_mac.mm | 19 +++++++++++++++++--
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/npapi/vlcplugin_mac.h b/npapi/vlcplugin_mac.h
index 2bd592f..2d89c74 100644
--- a/npapi/vlcplugin_mac.h
+++ b/npapi/vlcplugin_mac.h
@@ -44,9 +44,9 @@ public:
bool resize_windows();
bool destroy_windows();
- void set_toolbar_visible(bool) { /* STUB */ }
- bool get_toolbar_visible() { return false; }
- void update_controls() {/* STUB */}
+ void set_toolbar_visible(bool);
+ bool get_toolbar_visible();
+ void update_controls();
void popup_menu() {/* STUB */}
diff --git a/npapi/vlcplugin_mac.mm b/npapi/vlcplugin_mac.mm
index b4b28d9..be6343a 100644
--- a/npapi/vlcplugin_mac.mm
+++ b/npapi/vlcplugin_mac.mm
@@ -95,6 +95,21 @@ int VlcPluginMac::get_fullscreen()
return r;
}
+void VlcPluginMac::set_toolbar_visible(bool b_value)
+{
+ controllerLayer.opaque = (float)b_value;
+}
+
+bool VlcPluginMac::get_toolbar_visible()
+{
+ return (bool)controllerLayer.opaque;
+}
+
+void VlcPluginMac::update_controls()
+{
+ [controllerLayer setNeedsDisplay];
+}
+
bool VlcPluginMac::create_windows()
{
return true;
@@ -346,8 +361,8 @@ static CGImageRef createImageNamed(NSString *name)
CGRect sliderRect = [self _sliderRect];
CGFloat fraction = 0.0;
-/* if (_movie)
- fraction = [self _currentTime] / [self _duration];*/
+ /* if (_movie)
+ fraction = [self _currentTime] / [self _duration];*/
CGFloat x = fraction * (CGRectGetWidth(sliderRect) - CGImageGetWidth(_knob));
More information about the vlc-commits
mailing list