#include "prefs.h"
#include "playlist.h"
#include "controls.h"
+#include "about.h"
+#include "open.h"
/*****************************************************************************
* Local prototypes.
} else {
_o_sharedMainInstance = [super init];
}
-
+
+ o_about = [[VLAboutBox alloc] init];
+ o_prefs = [[VLCPrefs alloc] init];
+ o_open = [[VLCOpen alloc] init];
+
return _o_sharedMainInstance;
}
i_key = config_GetInt( p_intf, "key-fullscreen" );
[o_mi_fullscreen setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
[o_mi_fullscreen setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
+ i_key = config_GetInt( p_intf, "key-snapshot" );
+ [o_mi_snapshot setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
+ [o_mi_snapshot setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
var_Create( p_intf, "intf-change", VLC_VAR_BOOL );
[self setSubmenusEnabled: FALSE];
[self manageVolumeSlider];
+ [o_window setDelegate: self];
p_playlist = (playlist_t *) vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
[o_mi_fittoscreen setTitle: _NS("Fit to Screen")];
[o_mi_fullscreen setTitle: _NS("Fullscreen")];
[o_mi_floatontop setTitle: _NS("Float on Top")];
+ [o_mi_snapshot setTitle: _NS("Snapshot")];
[o_mi_videotrack setTitle: _NS("Video Track")];
[o_mu_videotrack setTitle: _NS("Video Track")];
[o_mi_screen setTitle: _NS("Video Device")];
key = [[o_event charactersIgnoringModifiers] characterAtIndex: 0];
+ switch( key )
+ {
+ case NSDeleteCharacter:
+ case NSDeleteFunctionKey:
+ case NSDeleteCharFunctionKey:
+ case NSBackspaceCharacter:
+ return YES;
+ }
+
val.i_int |= CocoaKeyToVLC( key );
for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
if ( p_intf->p_sys->b_playlist_update )
{
- [o_playlist playlistUpdated];
+ [o_playlist playlistUpdated];
p_intf->p_sys->b_playlist_update = VLC_FALSE;
}
{
return;
}
-
- vlc_mutex_lock( &p_playlist->object_lock );
o_temp = [NSString stringWithUTF8String:
- p_playlist->pp_items[p_playlist->i_index]->input.psz_name];
+ p_playlist->status.p_item->input.psz_name];
if( o_temp == NULL )
o_temp = [NSString stringWithCString:
- p_playlist->pp_items[p_playlist->i_index]->input.psz_name];
- vlc_mutex_unlock( &p_playlist->object_lock );
+ p_playlist->status.p_item->input.psz_name];
[o_scrollfield setStringValue: o_temp ];
-
- /*p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
+ p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout != NULL )
{
}
}
vlc_object_release( (vlc_object_t *)p_vout );
- }*/
+ }
[o_playlist updateRowSelection];
vlc_object_release( p_playlist );
p_intf->p_sys->b_current_title_update = FALSE;
[self application: nil openFile: [sender title]];
}
+- (IBAction)intfOpenFile:(id)sender
+{
+ if (!nib_open_loaded)
+ {
+ nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
+ [o_open awakeFromNib];
+ [o_open openFile];
+ } else {
+ [o_open openFile];
+ }
+}
+
+- (IBAction)intfOpenFileGeneric:(id)sender
+{
+ if (!nib_open_loaded)
+ {
+ nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
+ [o_open awakeFromNib];
+ [o_open openFileGeneric];
+ } else {
+ [o_open openFileGeneric];
+ }
+}
+
+- (IBAction)intfOpenDisc:(id)sender
+{
+ if (!nib_open_loaded)
+ {
+ nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
+ [o_open awakeFromNib];
+ [o_open openDisc];
+ } else {
+ [o_open openDisc];
+ }
+}
+
+- (IBAction)intfOpenNet:(id)sender
+{
+ if (!nib_open_loaded)
+ {
+ nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
+ [o_open awakeFromNib];
+ [o_open openNet];
+ } else {
+ [o_open openNet];
+ }
+}
+
+- (IBAction)viewAbout:(id)sender
+{
+ [o_about showPanel];
+}
+
- (IBAction)viewPreferences:(id)sender
{
[o_prefs showPrefs];
}
}
+- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedFrameSize
+{
+ if( proposedFrameSize.height <= 200 )
+ {
+ if( [sender frame].size.height > 200 )
+ {
+ //rect_remember = [[o_playlist playlistView] frame];
+ o_document_view = [o_clip_view documentView];
+ [o_document_view retain];
+ [o_clip_view setDocumentView: NULL];
+ }
+ return NSMakeSize( proposedFrameSize.width, 95 );
+ }
+ else
+ {
+ if( [sender frame].size.height <= 200 )
+ {
+ [o_clip_view setDocumentView: o_document_view];
+ [o_document_view release];
+ [o_document_view setFrameSize: NSMakeSize( proposedFrameSize.width - 22, proposedFrameSize.height - 120 )];
+ //[[o_playlist playlistView] setFrame: rect_remember];
+ }
+ return proposedFrameSize;
+ }
+ return proposedFrameSize;
+}
+
@end
@implementation VLCMain (NSMenuValidation)