Commit 9e2759bc authored by Felix Paul Kühne's avatar Felix Paul Kühne

* implemented a ctrl-click menu for the vouts (refs #302)

- currently loaded through rightMouseUp because rightMouseDown, etc. don't register any NSRightMouseDowns. If anybody got an idea why, I would be willing to change this of cause, since the current way is quite slower in the user's experience.
- the Snapshot item doesn't work yet (it triggers the fullscreen-event)
- localisation support is complete

Any comments and wanteds for further items are welcome :)
parent 9bee423b
...@@ -330,6 +330,7 @@ ...@@ -330,6 +330,7 @@
"o_timefield" = id; "o_timefield" = id;
"o_timeslider" = id; "o_timeslider" = id;
"o_volumeslider" = id; "o_volumeslider" = id;
"o_vout_menu" = id;
"o_window" = id; "o_window" = id;
}; };
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
......
...@@ -3,17 +3,19 @@ ...@@ -3,17 +3,19 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>90 147 478 430 0 0 1024 746 </string> <string>185 59 478 430 0 0 1440 878 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1617</key> <key>1617</key>
<string>788 586 109 149 0 0 1440 878 </string> <string>788 586 109 149 0 0 1440 878 </string>
<key>2197</key> <key>2197</key>
<string>172 420 596 143 0 0 1024 746 </string> <string>422 532 596 143 0 0 1440 878 </string>
<key>2709</key> <key>2709</key>
<string>305 626 508 82 0 0 1024 746 </string> <string>305 626 508 82 0 0 1024 746 </string>
<key>2730</key>
<string>694 440 105 68 0 0 1440 878 </string>
<key>29</key> <key>29</key>
<string>76 675 438 44 0 0 1024 746 </string> <string>130 802 438 44 0 0 1440 878 </string>
<key>915</key> <key>915</key>
<string>777 479 187 249 0 0 1440 878 </string> <string>777 479 187 249 0 0 1440 878 </string>
</dict> </dict>
...@@ -23,6 +25,7 @@ ...@@ -23,6 +25,7 @@
<array/> <array/>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>2416</integer>
<integer>21</integer> <integer>21</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan dot org> * Derk-Jan Hartman <hartman at videolan dot org>
* Felix Khne <fkuehne at videolan dot org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -270,6 +271,18 @@ struct intf_sys_t ...@@ -270,6 +271,18 @@ struct intf_sys_t
IBOutlet id o_dmi_previous; IBOutlet id o_dmi_previous;
IBOutlet id o_dmi_mute; IBOutlet id o_dmi_mute;
/* vout menu */
IBOutlet id o_vout_menu;
IBOutlet id o_vmi_play;
IBOutlet id o_vmi_stop;
IBOutlet id o_vmi_prev;
IBOutlet id o_vmi_next;
IBOutlet id o_vmi_volup;
IBOutlet id o_vmi_voldown;
IBOutlet id o_vmi_mute;
IBOutlet id o_vmi_fullscreen;
IBOutlet id o_vmi_snapshot;
bool b_small_window; bool b_small_window;
mtime_t i_end_scroll; mtime_t i_end_scroll;
...@@ -295,6 +308,7 @@ struct intf_sys_t ...@@ -295,6 +308,7 @@ struct intf_sys_t
- (id)getInteractionList; - (id)getInteractionList;
- (id)getMainIntfPgbar; - (id)getMainIntfPgbar;
- (id)getControllerWindow; - (id)getControllerWindow;
- (id)getVoutMenu;
- (void)terminate; - (void)terminate;
- (NSString *)localizedString:(char *)psz; - (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz; - (char *)delocalizeString:(NSString *)psz;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan.org> * Derk-Jan Hartman <hartman at videolan.org>
* Felix Khne <fkuehne at videolan dot org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -615,6 +616,17 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -615,6 +616,17 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_dmi_next setTitle: _NS("Next")]; [o_dmi_next setTitle: _NS("Next")];
[o_dmi_previous setTitle: _NS("Previous")]; [o_dmi_previous setTitle: _NS("Previous")];
[o_dmi_mute setTitle: _NS("Mute")]; [o_dmi_mute setTitle: _NS("Mute")];
/* vout menu */
[o_vmi_play setTitle: _NS("Play")];
[o_vmi_stop setTitle: _NS("Stop")];
[o_vmi_prev setTitle: _NS("Previous")];
[o_vmi_next setTitle: _NS("Next")];
[o_vmi_volup setTitle: _NS("Volume Up")];
[o_vmi_voldown setTitle: _NS("Volume Down")];
[o_vmi_mute setTitle: _NS("Mute")];
[o_vmi_fullscreen setTitle: _NS("Fullscreen")];
[o_vmi_snapshot setTitle: _NS("Snapshot")];
/* error panel */ /* error panel */
[o_error setTitle: _NS("Error")]; [o_error setTitle: _NS("Error")];
...@@ -929,6 +941,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -929,6 +941,11 @@ static VLCMain *_o_sharedMainInstance = nil;
return nil; return nil;
} }
- (id)getVoutMenu
{
return o_vout_menu;
}
- (void)manage - (void)manage
{ {
playlist_t * p_playlist; playlist_t * p_playlist;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* Derk-Jan Hartman <hartman at videolan dot org> * Derk-Jan Hartman <hartman at videolan dot org>
* Eric Petit <titer@m0k.org> * Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot org> * Benjamin Pracht <bigben at videolan dot org>
* Felix Khne <fkuehne at videolan dot org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
#include "intf.h" #include "intf.h"
#include "vout.h" #include "vout.h"
#import "controls.h"
/***************************************************************************** /*****************************************************************************
* DeviceCallback: Callback triggered when the video-device variable is changed * DeviceCallback: Callback triggered when the video-device variable is changed
...@@ -474,6 +475,12 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -474,6 +475,12 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
} }
} }
break; break;
case NSRightMouseDown:
{
msg_Dbg( p_vout, "received NSRightMouseDown (generic method)" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
}
break;
default: default:
[super mouseDown: o_event]; [super mouseDown: o_event];
...@@ -507,17 +514,14 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -507,17 +514,14 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)rightMouseDown:(NSEvent *)o_event - (void)rightMouseDown:(NSEvent *)o_event
{ {
vlc_value_t val;
if( p_vout ) if( p_vout )
{ {
switch( [o_event type] ) switch( [o_event type] )
{ {
case NSRightMouseDown: case NSRightMouseDown:
{ {
var_Get( p_vout, "mouse-button-down", &val ); msg_Dbg( p_vout, "received NSRightMouseDown (specific method)" );
val.i_int |= 4; [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
var_Set( p_vout, "mouse-button-down", val );
} }
break; break;
...@@ -580,17 +584,16 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -580,17 +584,16 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)rightMouseUp:(NSEvent *)o_event - (void)rightMouseUp:(NSEvent *)o_event
{ {
vlc_value_t val;
if( p_vout ) if( p_vout )
{ {
switch( [o_event type] ) switch( [o_event type] )
{ {
case NSRightMouseUp: case NSRightMouseUp:
{ {
var_Get( p_vout, "mouse-button-down", &val ); /* FIXME: this is the appropriate place, but we can't receive
val.i_int &= ~4; * NSRightMouseDown some how */
var_Set( p_vout, "mouse-button-down", val ); msg_Dbg( p_vout, "received NSRightMouseUp" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment