Commit 89be0ac8 authored by Jon Lech Johansen's avatar Jon Lech Johansen

* MacOS X vout improvements

  * MacOS X intf now returns, allowing vlc to terminate properly
  * Added a new make target: package-macosx
parent de32203b
...@@ -458,6 +458,25 @@ package-beos: ...@@ -458,6 +458,25 @@ package-beos:
# Clean up # Clean up
rm -Rf tmp rm -Rf tmp
package-macosx:
# Check that tmp isn't in the way
@if test -e tmp; then \
echo "Error: please remove ./tmp, it is in the way"; false; \
else \
echo "OK."; mkdir tmp; \
fi
# Copy relevant files
cp -R vlc.app tmp/
cp AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
README README.libdvdcss FAQ TODO tmp/
# Create disk image
./macosx-dmg 0 "vlc-${VLC_QUICKVERSION}" tmp/*
# Clean up
rm -Rf tmp
libdvdcss-snapshot: snapshot-common libdvdcss-snapshot: snapshot-common
# Remove vlc sources and icons, doc, debian directory... # Remove vlc sources and icons, doc, debian directory...
rm -Rf tmp/vlc/src tmp/vlc/share tmp/vlc/plugins tmp/vlc/doc rm -Rf tmp/vlc/src tmp/vlc/share tmp/vlc/plugins tmp/vlc/doc
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
openFile = id; openFile = id;
pause = id; pause = id;
play = id; play = id;
quit = id;
speedslider_update = id; speedslider_update = id;
stop = id;
timeslider_update = id; timeslider_update = id;
}; };
CLASS = Intf_Controller; CLASS = Intf_Controller;
...@@ -22,6 +24,7 @@ ...@@ -22,6 +24,7 @@
o_stepr = id; o_stepr = id;
o_stop = id; o_stop = id;
o_timeslider = id; o_timeslider = id;
o_window = id;
}; };
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
...@@ -31,7 +34,6 @@ ...@@ -31,7 +34,6 @@
OUTLETS = {o_table = id; }; OUTLETS = {o_table = id; };
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = VlcQuickDrawView; LANGUAGE = ObjC; SUPERCLASS = NSQuickDrawView; }
); );
IBVersion = 1; IBVersion = 1;
} }
\ No newline at end of file
...@@ -3,14 +3,21 @@ ...@@ -3,14 +3,21 @@
<plist version="0.9"> <plist version="0.9">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>87 157 428 240 0 0 1280 938 </string> <string>120 494 428 240 0 0 1600 1178 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>110 456 257 44 0 0 1600 1178 </string>
<key>460</key>
<string>120 456 104 66 0 0 1600 1178 </string>
</dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>219.0</string> <string>248.0</string>
<key>IBMainMenuLocation</key> <key>IBOpenObjects</key>
<string>288 493 104 66 0 0 1280 938 </string> <array>
<integer>21</integer>
</array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>5L14</string> <string>5P48</string>
<key>IBUserGuides</key>
<dict/>
</dict> </dict>
</plist> </plist>
...@@ -67,14 +67,16 @@ ...@@ -67,14 +67,16 @@
F512122B0170635601A80A1F, F512122B0170635601A80A1F,
F512122C0170635601A80A1F, F512122C0170635601A80A1F,
F512122D0170635601A80A1F, F512122D0170635601A80A1F,
F512122F0170635601A80A1F,
F51212300170635601A80A1F, F51212300170635601A80A1F,
F51212310170635601A80A1F, F51212310170635601A80A1F,
F51212320170635601A80A1F, F51212320170635601A80A1F,
F510A6CC01738ED001A80A1F, F510A6CC01738ED001A80A1F,
F510A6CD01738ED001A80A1F, F510A6CD01738ED001A80A1F,
F53A3B49018DECF201A80A1F, F6799746020DCC2A01A80112,
F53A3B4A018DECF201A80A1F, F6799747020DCC2A01A80112,
F6799748020DCC2A01A80112,
F6799749020DCC2A01A80112,
F679974A020DCC2A01A80112,
); );
isa = PBXGroup; isa = PBXGroup;
name = Files; name = Files;
...@@ -113,12 +115,6 @@ ...@@ -113,12 +115,6 @@
path = plugins/macosx/intf_controller.h; path = plugins/macosx/intf_controller.h;
refType = 4; refType = 4;
}; };
F512122F0170635601A80A1F = {
isa = PBXFileReference;
name = intf_main.c;
path = plugins/macosx/intf_main.c;
refType = 4;
};
F51212300170635601A80A1F = { F51212300170635601A80A1F = {
isa = PBXFileReference; isa = PBXFileReference;
name = macosx.c; name = macosx.c;
...@@ -330,16 +326,44 @@ ...@@ -330,16 +326,44 @@
settings = { settings = {
}; };
}; };
F53A3B49018DECF201A80A1F = { //F50
//F51
//F52
//F53
//F54
//F60
//F61
//F62
//F63
//F64
F6799746020DCC2A01A80112 = {
isa = PBXFileReference;
name = intf_macosx.c;
path = plugins/macosx/intf_macosx.c;
refType = 4;
};
F6799747020DCC2A01A80112 = {
isa = PBXFileReference;
name = vout_qdview.c;
path = plugins/macosx/vout_qdview.c;
refType = 4;
};
F6799748020DCC2A01A80112 = {
isa = PBXFileReference;
name = vout_qdview.h;
path = plugins/macosx/vout_qdview.h;
refType = 4;
};
F6799749020DCC2A01A80112 = {
isa = PBXFileReference; isa = PBXFileReference;
name = intf_qdview.h; name = vout_window.c;
path = plugins/macosx/intf_qdview.h; path = plugins/macosx/vout_window.c;
refType = 4; refType = 4;
}; };
F53A3B4A018DECF201A80A1F = { F679974A020DCC2A01A80112 = {
isa = PBXFileReference; isa = PBXFileReference;
name = intf_qdview.c; name = vout_window.h;
path = plugins/macosx/intf_qdview.c; path = plugins/macosx/vout_window.h;
refType = 4; refType = 4;
}; };
}; };
......
#!/bin/sh
#
# Posted to the projectbuilder-users list by Mike Ferris
# Modified for vlc by Jon Lech Johansen
#
set -e
# Requires at least three args
if [ $# -lt 3 ] ; then
echo "usage: $0 size name file ..." 1>&2
exit 1
fi
# Grab size and name
imgSize=$1
shift
imgName=$1
shift
if [ $((${imgSize} < 5)) != 0 ] ; then
imgSize=5;
fi
# Create the image and format it
rm -f "${imgName}.dmg"
echo; echo "Creating ${imgSize} MB disk image named ${imgName}"
hdiutil create "${imgName}.dmg" -megabytes "${imgSize}" -layout NONE -quiet
dev=`hdid -nomount "${imgName}.dmg" | grep '/dev/disk[0-9]*' | cut -d " " -f 1`
/sbin/newfs_hfs -w -v "${imgName}" -b 4096 "${dev}" > /dev/null
hdiutil eject "${dev}" -quiet
# Mount the image and copy stuff
dev=`hdid "${imgName}.dmg" | grep '/dev/disk[0-9]*' | cut -d " " -f 1`
echo "Copying contents to ${imgName}:"
while [ $# -gt 0 ] ; do
echo " ${1}"
/Developer/Tools/CpMac -r "${1}" "/Volumes/${imgName}"
shift
done
hdiutil eject "${dev}" -quiet
# Compress the image
echo "Compressing ${imgName} disk image"
mv "${imgName}.dmg" "${imgName}.orig.dmg"
hdiutil convert "${imgName}.orig.dmg" -format UDZO -o "${imgName}" -quiet
rm "${imgName}.orig.dmg"
# Done
echo; echo "Disk image creation completed:"
ls -la "${imgName}.dmg"; echo
macosx_SOURCES = macosx.c intf_main.c intf_controller.c aout_macosx.c vout_macosx.c intf_vlc_wrapper.c intf_qdview.c macosx_SOURCES = macosx.c aout_macosx.c vout_macosx.c vout_window.c vout_qdview.c intf_macosx.c intf_controller.c intf_vlc_wrapper.c
This diff is collapsed.
/***************************************************************************** /*****************************************************************************
* intf_controller.h : MacOS X plugin for vlc * intf_controller.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $$ * $Id: intf_controller.h,v 1.3 2002/02/18 01:34:44 jlj Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* *
...@@ -21,54 +21,56 @@ ...@@ -21,54 +21,56 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#import <Cocoa/Cocoa.h> #include "intf_vlc_wrapper.h"
#import "intf_vlc_wrapper.h"
#import "intf_qdview.h"
@interface Intf_PlaylistDS : NSObject { @interface Intf_PlaylistDS : NSObject
Intf_VlcWrapper* o_vlc ; {
NSMutableArray* o_playlist ; Intf_VlcWrapper *o_vlc;
NSMutableArray *o_playlist;
IBOutlet NSTableView *o_table ; IBOutlet NSTableView *o_table;
} }
- (void ) awakeFromNib ; - (void)awakeFromNib;
- (void) readPlaylist ; - (void)readPlaylist;
- (int)numberOfRowsInTableView:(NSTableView *)o_table;
- (id)tableView:(NSTableView *)o_table objectValueForTableColumn:(NSTableColumn *)o_column row:(int)i_row;
- (void)tableView:(NSTableView *)o_table setObjectValue:o_value forTableColumn:(NSTableColumn *)o_column row:(int)i_index;
- (int) numberOfRowsInTableView:(NSTableView*)o_table ;
- (id) tableView:(NSTableView*)o_table objectValueForTableColumn:(NSTableColumn*)o_column row:(int)i_row ;
- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex ;
@end @end
@interface Intf_Controller : NSObject <VlcWrapper_Delegate> { @interface Intf_Controller : NSObject
Intf_VlcWrapper* o_vlc ; {
Intf_VlcWrapper *o_vlc;
IBOutlet NSWindow *o_window;
IBOutlet NSButton *o_play;
IBOutlet NSButton *o_pause;
IBOutlet NSButton *o_stop;
IBOutlet NSButton *o_stepr;
IBOutlet NSButton *o_stepf;
IBOutlet NSSlider *o_timeslider;
IBOutlet NSTextField *o_currenttime;
IBOutlet NSMenuItem *o_menu_fs;
NSWindow *o_window ; IBOutlet Intf_PlaylistDS *o_playlistds;
bool b_window_is_fullscreen ;
IBOutlet NSButton *o_play ;
IBOutlet NSButton *o_pause ;
IBOutlet NSButton *o_stop ;
IBOutlet NSButton *o_stepr ;
IBOutlet NSButton *o_stepf ;
IBOutlet NSSlider *o_timeslider ;
IBOutlet NSTextField *o_currenttime ;
IBOutlet NSMenuItem *o_menu_fullscreen ;
IBOutlet Intf_PlaylistDS *o_playlistds ;
} }
//Initialization & Event-Management /* Initialization & Event-Management */
- (void) awakeFromNib ; - (void)awakeFromNib;
- (void) manage:(NSTimer *)timer ; - (void)applicationDidFinishLaunching:(NSNotification *)o_notification;
- (void)applicationDidBecomeActive:(NSNotification*)aNotification ; - (void)manage;
- (void)applicationDidResignActive:(NSNotification*)aNotification ; - (void)terminate;
/* Functions atteched to user interface */
- (IBAction)openFile:(id)sender;
- (IBAction)pause:(id)sender;
- (IBAction)play:(id)sender;
- (IBAction)stop:(id)sender;
- (IBAction)timeslider_update:(id)slider;
- (IBAction)speedslider_update:(id)slider;
- (IBAction)fullscreen_toggle:(id)sender;
- (IBAction)quit:(id)sender;
//Functions atteched to user interface
- (IBAction) openFile:(id)sender ;
- (IBAction) pause:(id)sender ;
- (IBAction) play:(id)sender ;
- (IBAction) timeslider_update:(id)slider ;
- (IBAction) speedslider_update:(id)slider ;
- (IBAction) fullscreen_toggle:(id)sender ;
@end @end
/***************************************************************************** /*****************************************************************************
* intf_main.c: MacOS X interface plugin * intf_macosx.c: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf_macosx.c,v 1.11 2002/02/18 01:34:44 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* *
* 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
...@@ -30,10 +32,9 @@ ...@@ -30,10 +32,9 @@
#include <videolan/vlc.h> #include <videolan/vlc.h>
#include "macosx.h"
#include "interface.h" #include "interface.h"
#include "intf_main.h"
#include "macosx.h"
/***************************************************************************** /*****************************************************************************
* Local prototypes. * Local prototypes.
...@@ -62,12 +63,13 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -62,12 +63,13 @@ static int intf_Open( intf_thread_t *p_intf )
if( p_intf->p_sys == NULL ) if( p_intf->p_sys == NULL )
{ {
return( 1 ); return( 1 );
}; }
p_intf->p_sys->o_pool =[[NSAutoreleasePool alloc] init]; p_intf->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
p_intf->p_sys->o_port = [[NSPort port] retain];
[NSApplication sharedApplication]; [[NSApplication sharedApplication] autorelease];
[NSBundle loadNibNamed:@"MainMenu" owner:NSApp]; [NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
return( 0 ); return( 0 );
} }
...@@ -77,9 +79,12 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -77,9 +79,12 @@ static int intf_Open( intf_thread_t *p_intf )
*****************************************************************************/ *****************************************************************************/
static void intf_Close( intf_thread_t *p_intf ) static void intf_Close( intf_thread_t *p_intf )
{ {
/* Destroy structure */ /* write cached user defaults to disk */
[NSApp terminate:NSApp] ; [[NSUserDefaults standardUserDefaults] synchronize];
[p_intf->p_sys->o_pool release] ;
[p_intf->p_sys->o_port release];
[p_intf->p_sys->o_pool release];
free( p_intf->p_sys ); free( p_intf->p_sys );
} }
...@@ -88,5 +93,5 @@ static void intf_Close( intf_thread_t *p_intf ) ...@@ -88,5 +93,5 @@ static void intf_Close( intf_thread_t *p_intf )
*****************************************************************************/ *****************************************************************************/
static void intf_Run( intf_thread_t *p_intf ) static void intf_Run( intf_thread_t *p_intf )
{ {
[NSApp run] ; [NSApp run];
} }
//
// intf_qdview.c
// vlc
//
// Created by fgp on Mon Oct 29 2001.
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
#import "intf_qdview.h"
NSString *VlcQuickDrawViewDidResize = @"VlcQuickDrawViewDidDraw" ;
@implementation VlcQuickDrawView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
return self;
}
- (void)drawRect:(NSRect)rect {
[super drawRect:rect] ;
[[NSNotificationCenter defaultCenter] postNotificationName:VlcQuickDrawViewDidResize object:self] ;
}
@end
//
// intf_qdview.h
// vlc
//
// Created by fgp on Mon Oct 29 2001.
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
extern NSString *VlcQuickDrawViewDidResize ;
@interface VlcQuickDrawView : NSQuickDrawView {
}
@end
This diff is collapsed.
/***************************************************************************** /*****************************************************************************
* intf_vlc_wrapper.h : MacOS X plugin for vlc * intf_vlc_wrapper.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $$ * $Id: intf_vlc_wrapper.h,v 1.3 2002/02/18 01:34:44 jlj Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* *
* 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
...@@ -21,52 +22,51 @@ ...@@ -21,52 +22,51 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#import <Cocoa/Cocoa.h> typedef enum intf_speed_e
{
typedef enum intf_speed_e {SPEED_SLOW=0, SPEED_NORMAL, SPEED_FAST} intf_speed_t ; SPEED_SLOW = 0,
@protocol VlcWrapper_Delegate SPEED_NORMAL,
- (void) requestQDPortFullscreen:(bool)b_fullscreen ; SPEED_FAST
- (void) releaseQDPort ; } intf_speed_t;
- (void) resizeQDPortFullscreen:(bool)b_fullscreen ;
@end
/* Intf_VlcWrapper is a singleton class
(only one instance at any time) */
// Intf_VlcWrapper is a singleton class (there is only one instance at any time) @interface Intf_VlcWrapper : NSObject
@interface Intf_VlcWrapper : NSObject { {
id<VlcWrapper_Delegate> o_delegate ; id o_delegate;
intf_speed_t e_speed ; intf_speed_t e_speed;
unsigned int i_width, i_height ;
} }
// Initialization,.... /* Initialization */
+ (Intf_VlcWrapper*) instance ; + (Intf_VlcWrapper *)instance;
- (Intf_VlcWrapper*) initWithDelegate:(id)o_delegate ; - (Intf_VlcWrapper *)initWithDelegate:(id)o_delegate;
- (bool) manage ; - (bool)manage;
- (void)quit;
//Function for the GUI. /* Vout requests */
- (void) setQDPort:(CGrafPtr)p_qdport ; - (void)handlePortMessage:(NSPortMessage *)o_msg;
- (void) sizeChangeQDPort ; - (NSPort *)sendPort;
- (NSSize) videoSize ;
// Playback control /* Playback control */
- (void) setSpeed:(intf_speed_t)e_speed ; - (void)setSpeed:(intf_speed_t)e_speed;
- (NSString*) getTimeAsString ; - (NSString *)getTimeAsString;
- (float) getTimeAsFloat ; - (float)getTimeAsFloat;
- (void) setTimeAsFloat:(float)i_offset ; - (void)setTimeAsFloat:(float)i_offset;
// Playlist control /* Playlist control */
- (NSArray*) playlistAsArray ; - (NSArray *)playlistAsArray;
- (int) playlistLength ; - (int)playlistLength;
- (NSString*) playlistItem:(int) i_pos ; - (NSString *)playlistItem:(int)i_pos;
- (bool) playlistPlayCurrent ; - (bool)playlistPlayCurrent;
- (void) playlistPause ; - (void)playlistPause;
- (void) playlistStop ; - (void)playlistStop;
- (void) playlistPlayNext ; - (void)playlistPlayNext;
- (void) playlistPlayPrev ; - (void)playlistPlayPrev;
- (void) playlistPlayItem:(int)i_item ; - (void)playlistPlayItem:(int)i_item;
- (void) playlistAdd:(NSString*)o_filename ; - (void)playlistAdd:(NSString *)o_filename;
- (void) clearPlaylist ; - (void)clearPlaylist;
@end - (bool)playlistPlaying;
@end
/***************************************************************************** /*****************************************************************************
* macosx.c : MacOS X plugin for vlc * macosx.c: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: macosx.c,v 1.12 2002/01/21 00:52:07 sam Exp $ * $Id: macosx.c,v 1.13 2002/02/18 01:34:44 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu> * Eugenio Jarosiewicz <ej0@cise.ufl.edu>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* *
* 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
......
/***************************************************************************** /*****************************************************************************
* macosx.h : MacOS X plugin for vlc * macosx.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: macosx.h,v 1.4 2002/02/15 13:32:53 sam Exp $ * $Id: macosx.h,v 1.5 2002/02/18 01:34:44 jlj Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* *
* 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
...@@ -21,27 +24,55 @@ ...@@ -21,27 +24,55 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#include "vout_window.h"
#include "vout_qdview.h"
/***************************************************************************** /*****************************************************************************
* The vout struct as access from both, the output and the interface module * intf_sys_t: description and status of the interface
*****************************************************************************/ *****************************************************************************/
#include <QuickTime/QuickTime.h> typedef struct intf_sys_s
{
#define OSX_INTF_VOUT_QDPORT_CHANGE 0x0001 NSPort *o_port;
#define OSX_INTF_VOUT_SIZE_CHANGE 0x0002 NSAutoreleasePool *o_pool;
#define OSX_VOUT_INTF_REQUEST_QDPORT 0x0004 } intf_sys_t;
#define OSX_VOUT_INTF_RELEASE_QDPORT 0x0008
/* This struct is included as the _FIRST_ member in intf_sys_t */
/* That way the video output can cast the intf_sys_t to osx_com_t */
/* and doesn't need the definition of intf_sys_t */
#ifndef OSX_COM_TYPE
#define OSX_COM_TYPE osx_com_t
#define OSX_COM_STRUCT osx_com_s
#endif
typedef struct OSX_COM_STRUCT {
unsigned int i_changes ;
CGrafPtr p_qdport ;
struct vout_thread_s *p_vout; /*****************************************************************************
} OSX_COM_TYPE ; * vout_sys_t: MacOS X video output method descriptor
*****************************************************************************/
typedef struct vout_sys_s
{
VLCWindow *o_window;
NSRect s_rect;
int b_pos_saved;
boolean_t b_mouse_moved;
boolean_t b_mouse_pointer_visible;
mtime_t i_time_mouse_last_moved;
CodecType i_codec;
CGrafPtr p_qdport;
ImageSequence i_seq;
MatrixRecordPtr p_matrix;
DecompressorComponent img_dc;
ImageDescriptionHandle h_img_descr;
} vout_sys_t;
/*****************************************************************************
* vout_req_t: MacOS X video output request
*****************************************************************************/
#define VOUT_REQ_CREATE_WINDOW 0x00000001
#define VOUT_REQ_DESTROY_WINDOW 0x00000002
typedef struct vout_req_s
{
int i_type;
int i_result;
NSConditionLock *o_lock;
struct vout_thread_s *p_vout;
} vout_req_t;
This diff is collapsed.
/*****************************************************************************
* vout_qdview.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_qdview.c,v 1.1 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <videolan/vlc.h>
#include "video.h"
#include "video_output.h"
#include "macosx.h"
/*****************************************************************************
* VLCView implementation
*****************************************************************************/
@implementation VLCView
- (id)initWithVout:(struct vout_thread_s *)_p_vout
{
if( [super init] == nil )
return nil;
p_vout = _p_vout;
return self;
}
- (void)drawRect:(NSRect)rect
{
[super drawRect: rect];
p_vout->i_changes |= VOUT_SIZE_CHANGE;
}
@end
/***************************************************************************** /*****************************************************************************
* intf_main.h: MacOS X interface plugin * vout_qdview.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: vout_qdview.h,v 1.1 2002/02/18 01:34:44 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* Florian G. Pflug <fgp@phlo.org> * Jon Lech Johansen <jon-vl@nanocrew.net>
* *
* 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
...@@ -21,16 +22,11 @@ ...@@ -21,16 +22,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
/* OS specific */ @interface VLCView : NSQuickDrawView
#import <Cocoa/Cocoa.h>
/*****************************************************************************
* intf_sys_t: description and status of the interface
*****************************************************************************/
typedef struct intf_sys_s
{ {
osx_com_t osx_communication ; struct vout_thread_s *p_vout;
}
NSAutoreleasePool *o_pool ; - (id)initWithVout:(struct vout_thread_s *)_p_vout;
} intf_sys_t;
@end
/*****************************************************************************
* vout_window.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_window.c,v 1.1 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <videolan/vlc.h>
#include "video.h"
#include "video_output.h"
#include "interface.h"
#include "macosx.h"
/*****************************************************************************
* VLCWindow implementation
*****************************************************************************/
@implementation VLCWindow
- (void)setVout:(struct vout_thread_s *)_p_vout
{
p_vout = _p_vout;
}
- (BOOL)canBecomeKeyWindow
{
return( YES );
}
- (void)becomeKeyWindow
{
[super becomeKeyWindow];
p_vout->p_sys->b_mouse_moved = 0;
p_vout->p_sys->i_time_mouse_last_moved = mdate();
}
- (void)resignKeyWindow
{
[super resignKeyWindow];
p_vout->p_sys->b_mouse_moved = 1;
p_vout->p_sys->i_time_mouse_last_moved = 0;
}
- (void)keyDown:(NSEvent *)theEvent
{
unichar key = 0;
if( [[theEvent characters] length] )
{
key = [[theEvent characters] characterAtIndex: 0];
}
switch( key )
{
case 'f': case 'F':
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break;
case 'q': case 'Q':
p_main->p_intf->b_die = 1;
break;
default:
[super keyDown: theEvent];
break;
}
}
- (void)mouseMoved:(NSEvent *)theEvent
{
p_vout->p_sys->i_time_mouse_last_moved = mdate();
}
@end
/*****************************************************************************
* vout_window.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_window.h,v 1.1 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
@interface VLCWindow : NSWindow
{
struct vout_thread_s *p_vout;
}
- (void)setVout:(struct vout_thread_s *)_p_vout;
@end
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