Commit d0166d2b authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added basic 'vout window nsobject' capabilities with a test window

not fully functional yet
parent 2b9cd401
......@@ -13,12 +13,12 @@
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="2"/>
<integer value="915"/>
<integer value="2416"/>
<integer value="283"/>
<integer value="4596"/>
<integer value="235"/>
<integer value="2730"/>
<integer value="2417"/>
<integer value="4596"/>
<integer value="915"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -882,7 +882,7 @@
<reference key="NSNextResponder" ref="429932428"/>
<int key="NSvFlags">-2147482334</int>
<object class="NSPSMatrix" key="NSDrawMatrix"/>
<string key="NSFrame">{{222, 24}, {155, 12}}</string>
<string key="NSFrame">{{221, 11}, {155, 12}}</string>
<reference key="NSSuperview" ref="429932428"/>
<int key="NSpiFlags">16650</int>
<double key="NSMaxValue">100</double>
......@@ -3084,7 +3084,7 @@
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, 28}, {238, 35}}</string>
<reference key="NSSuperview" ref="351701434"/>
<string key="NSClassName">VLCEmbeddedVoutView</string>
<string key="NSClassName">NSView</string>
<string key="NSExtension">NSView</string>
</object>
</object>
......@@ -6984,6 +6984,14 @@ LCAuLi4</string>
</object>
<int key="connectionID">4625</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_video_view</string>
<reference key="source" ref="284663135"/>
<reference key="destination" ref="627102071"/>
</object>
<int key="connectionID">4626</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
......@@ -10657,9 +10665,9 @@ LCAuLi4</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{243, 631}, {238, 63}}</string>
<string>{{330, 631}, {238, 63}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{243, 631}, {238, 63}}</string>
<string>{{330, 631}, {238, 63}}</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
......@@ -10856,7 +10864,7 @@ LCAuLi4</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDWwAAwagAAA</bytes>
<bytes key="NSTransformStruct">P4AAAL+AAABDXgAAwggAAA</bytes>
</object>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -11213,7 +11221,7 @@ LCAuLi4</string>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">4625</int>
<int key="maxID">4626</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
......@@ -11610,6 +11618,260 @@ LCAuLi4</string>
<string key="minorKey">../../../../../modules/gui/macosx/controls.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCEmbeddedWindow</string>
<string key="superclassName">NSWindow</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">togglePlaylist:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">togglePlaylist:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">togglePlaylist:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>o_background_view</string>
<string>o_backgroundimg_middle</string>
<string>o_backgroundimg_right</string>
<string>o_btn_backward</string>
<string>o_btn_equalizer</string>
<string>o_btn_forward</string>
<string>o_btn_fullscreen</string>
<string>o_btn_next</string>
<string>o_btn_play</string>
<string>o_btn_playlist</string>
<string>o_btn_prev</string>
<string>o_btn_stop</string>
<string>o_btn_volume_down</string>
<string>o_btn_volume_up</string>
<string>o_horizontal_split</string>
<string>o_main_pgbar</string>
<string>o_playlist</string>
<string>o_playlist_table</string>
<string>o_playlist_view</string>
<string>o_scrollfield</string>
<string>o_searchfield</string>
<string>o_sidebar_list</string>
<string>o_status</string>
<string>o_time</string>
<string>o_timeslider</string>
<string>o_vertical_split</string>
<string>o_video_view</string>
<string>o_videosubview</string>
<string>o_view</string>
<string>o_vlc_main</string>
<string>o_volumeslider</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>o_background_view</string>
<string>o_backgroundimg_middle</string>
<string>o_backgroundimg_right</string>
<string>o_btn_backward</string>
<string>o_btn_equalizer</string>
<string>o_btn_forward</string>
<string>o_btn_fullscreen</string>
<string>o_btn_next</string>
<string>o_btn_play</string>
<string>o_btn_playlist</string>
<string>o_btn_prev</string>
<string>o_btn_stop</string>
<string>o_btn_volume_down</string>
<string>o_btn_volume_up</string>
<string>o_horizontal_split</string>
<string>o_main_pgbar</string>
<string>o_playlist</string>
<string>o_playlist_table</string>
<string>o_playlist_view</string>
<string>o_scrollfield</string>
<string>o_searchfield</string>
<string>o_sidebar_list</string>
<string>o_status</string>
<string>o_time</string>
<string>o_timeslider</string>
<string>o_vertical_split</string>
<string>o_video_view</string>
<string>o_videosubview</string>
<string>o_view</string>
<string>o_vlc_main</string>
<string>o_volumeslider</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">o_background_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_backgroundimg_middle</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_backgroundimg_right</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_backward</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_equalizer</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_forward</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_fullscreen</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_next</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_play</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_playlist</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_prev</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_stop</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_volume_down</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_btn_volume_up</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_horizontal_split</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_main_pgbar</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_playlist</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_playlist_table</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_playlist_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_scrollfield</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_searchfield</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_sidebar_list</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_status</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_time</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_timeslider</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_vertical_split</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_video_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_videosubview</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_vlc_main</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_volumeslider</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBDocumentRelativeSource</string>
<string key="minorKey">../../../../../modules/gui/macosx/embeddedwindow.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCFSPanel</string>
<string key="superclassName">NSWindow</string>
......
......@@ -59,6 +59,7 @@
IBOutlet id o_playlist_view;
IBOutlet id o_playlist_table;
IBOutlet id o_vlc_main;
IBOutlet id o_video_view;
NSImage * o_img_play;
NSImage * o_img_play_pressed;
......@@ -82,6 +83,8 @@
- (void)controlTintChanged;
- (id)videoView;
- (void)setTime: (NSString *)o_arg_ime position: (float)f_position;
- (id)getPgbar;
- (void)playStatusUpdated: (int)i_status;
......
......@@ -141,6 +141,8 @@
/* we don't want this window to be restored on relaunch */
if ([self respondsToSelector:@selector(setRestorable:)])
[self setRestorable:NO];
[self makeKeyAndOrderFront: self];
}
- (void)controlTintChanged
......@@ -181,6 +183,11 @@
[super dealloc];
}
- (id)videoView
{
return o_video_view;
}
- (void)setTime:(NSString *)o_arg_time position:(float)f_position
{
[o_time setStringValue: o_arg_time];
......
......@@ -208,6 +208,7 @@ struct intf_sys_t
- (id)info;
- (id)wizard;
- (id)embeddedList;
- (id)getVideoViewAtPositionX: (int *)pi_x Y: (int *)pi_y withWidth: (unsigned int*)pi_width andHeight: (unsigned int*)pi_height;
- (id)coreDialogProvider;
- (id)mainIntfPgbar;
- (id)controllerWindow;
......
......@@ -36,6 +36,7 @@
#include <vlc_url.h>
#include <vlc_modules.h>
#include <vlc_aout_intf.h>
#include <vlc_vout_window.h>
#include <unistd.h> /* execl() */
#import "intf.h"
......@@ -106,6 +107,53 @@ void CloseIntf ( vlc_object_t *p_this )
free( p_intf->p_sys );
}
static int WindowControl( vout_window_t *, int i_query, va_list );
int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
{
intf_thread_t *p_intf = VLCIntf;
if (!p_intf) {
msg_Err( p_wnd, "Mac OS X interface not found" );
return VLC_EGENERIC;
}
msg_Dbg( p_wnd, "looking for video view" );
int i_x = cfg->x;
int i_y = cfg->y;
unsigned i_width = cfg->width;
unsigned i_height = cfg->height;
p_wnd->handle.nsobject = [[VLCMain sharedInstance] getVideoViewAtPositionX: &i_x Y: &i_y withWidth: &i_width andHeight: &i_height];
if ( !p_wnd->handle.nsobject ) {
msg_Err( p_wnd, "got no video view from the interface" );
return VLC_EGENERIC;
}
p_wnd->control = WindowControl;
p_wnd->sys = (vout_window_sys_t *)VLCIntf;
return VLC_SUCCESS;
}
static int WindowControl( vout_window_t *p_wnd, int i_query, va_list args )
{
/* TODO */
if( i_query == VOUT_WINDOW_SET_STATE )
NSLog( @"WindowControl:VOUT_WINDOW_SET_STATE" );
else if( i_query == VOUT_WINDOW_SET_SIZE )
NSLog( @"WindowControl:VOUT_WINDOW_SET_SIZE" );
else if( i_query == VOUT_WINDOW_SET_FULLSCREEN )
NSLog( @"WindowControl:VOUT_WINDOW_SET_FULLSCREEN" );
else
NSLog( @"WindowControl: unknown query" );
return VLC_SUCCESS;
}
void WindowClose( vout_window_t *p_wnd )
{
NSLog( @"Window Close" );
// tell the interface to get rid of the video, TODO
}
/*****************************************************************************
* Run: main loop
*****************************************************************************/
......@@ -1183,6 +1231,22 @@ unsigned int CocoaKeyToVLC( unichar i_key )
return o_wizard;
}
- (id)getVideoViewAtPositionX: (int *)pi_x Y: (int *)pi_y withWidth: (unsigned int*)pi_width andHeight: (unsigned int*)pi_height
{
id videoView = [o_embedded_window videoView];
NSRect videoRect = [videoView frame];
int i_x = (int)videoRect.origin.x;
int i_y = (int)videoRect.origin.y;
unsigned int i_width = (int)videoRect.size.width;
unsigned int i_height = (int)videoRect.size.height;
pi_x = (int *)i_x;
pi_y = (int *)i_y;
pi_width = (unsigned int*)i_width;
pi_height = (unsigned int*)i_height;
msg_Dbg( VLCIntf, "returning videoview with x=%i, y=%i, width=%i, height=%i", i_x, i_y, i_width, i_height );
return videoView;
}
- (id)embeddedList
{
if( o_embedded_list )
......
......@@ -38,6 +38,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout_window.h>
/*****************************************************************************
* External prototypes
......@@ -45,6 +46,9 @@
int OpenIntf ( vlc_object_t * );
void CloseIntf ( vlc_object_t * );
int WindowOpen ( vout_window_t *, const vout_window_cfg_t * );
void WindowClose ( vout_window_t * );
int OpenVideoGL ( vlc_object_t * );
void CloseVideoGL ( vlc_object_t * );
......@@ -117,11 +121,9 @@ vlc_module_begin ()
false )
add_submodule ()
set_description( "Mac OS X OpenGL" )
set_capability( "opengl provider", 100 )
set_category( CAT_VIDEO)
set_subcategory( SUBCAT_VIDEO_VOUT )
// set_callbacks( OpenVideoGL, CloseVideoGL )
set_description( "Mac OS X Video Output Provider" )
set_capability( "vout window nsobject", 100 )
set_callbacks( WindowOpen, WindowClose )
add_integer( "macosx-vdev", 0, VDEV_TEXT, VDEV_LONGTEXT,
false )
......
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