/*****************************************************************************
* intf.m: MacOS X interface module
*****************************************************************************
- * Copyright (C) 2002-2005 VideoLAN
+ * Copyright (C) 2002-2005 the VideoLAN team
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
#include "controls.h"
#include "about.h"
#include "open.h"
+#include "wizard.h"
+#include "extended.h"
/*****************************************************************************
* Local prototypes.
}
o_about = [[VLAboutBox alloc] init];
- o_prefs = [[VLCPrefs alloc] init];
+ o_prefs = nil;
o_open = [[VLCOpen alloc] init];
+ o_wizard = [[VLCWizard alloc] init];
+ o_extended = [[VLCExtended alloc] init];
i_lastShownVolume = -1;
return _o_sharedMainInstance;
[o_msgs_btn_crashlog setTitle: _NS("Open CrashLog")];
/* main menu */
- [o_mi_about setTitle: _NS("About VLC media player")];
+ [o_mi_about setTitle: _NS("About VLC media player...")];
[o_mi_prefs setTitle: _NS("Preferences...")];
[o_mi_add_intf setTitle: _NS("Add Interface")];
[o_mu_add_intf setTitle: _NS("Add Interface")];
[o_mi_open_net setTitle: _NS("Open Network...")];
[o_mi_open_recent setTitle: _NS("Open Recent")];
[o_mi_open_recent_cm setTitle: _NS("Clear Menu")];
+ [o_mi_open_wizard setTitle: _NS("Wizard...")];
[o_mu_edit setTitle: _NS("Edit")];
[o_mi_cut setTitle: _NS("Cut")];
[o_mi_close_window setTitle: _NS("Close Window")];
[o_mi_controller setTitle: _NS("Controller")];
[o_mi_equalizer setTitle: _NS("Equalizer")];
+ [o_mi_extended setTitle: _NS("Extended controls")];
[o_mi_playlist setTitle: _NS("Playlist")];
[o_mi_info setTitle: _NS("Info")];
[o_mi_messages setTitle: _NS("Messages")];
case NSDeleteFunctionKey:
case NSDeleteCharFunctionKey:
case NSBackspaceCharacter:
- return YES;
+ case NSUpArrowFunctionKey:
+ case NSDownArrowFunctionKey:
+ case NSRightArrowFunctionKey:
+ case NSLeftArrowFunctionKey:
+ case NSEnterCharacter:
+ case NSCarriageReturnCharacter:
+ return NO;
}
val.i_int |= CocoaKeyToVLC( key );
{
return o_info;
}
- return nil;
+ return nil;
+}
+
+- (id)getWizard
+{
+ if ( o_wizard )
+ {
+ return o_wizard;
+ }
+ return nil;
}
- (void)manage
}
#undef p_input
+ /* Manage volume status */
+ [self manageVolumeSlider];
+
vlc_mutex_unlock( &p_intf->change_lock );
o_sleep_date = [NSDate dateWithTimeIntervalSinceNow: .1];
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
}
+
+ if( p_intf->p_sys->b_volume_update )
+ {
+ NSString *o_text;
+ o_text = [NSString stringWithFormat: _NS("Volume: %d%%"), i_lastShownVolume * 400 / AOUT_VOLUME_MAX];
+ if( i_lastShownVolume != -1 )
+ [self setScrollField:o_text stopAfter:1000000];
+
+ [o_volumeslider setFloatValue: (float)i_lastShownVolume / AOUT_VOLUME_STEP];
+ [o_volumeslider setEnabled: TRUE];
+ p_intf->p_sys->b_mute = ( i_lastShownVolume == 0 );
+ p_intf->p_sys->b_volume_update = FALSE;
+ }
/* Manage Playing status */
var_Get( p_input, "state", &val );
if( (i_end_scroll != -1) && (mdate() > i_end_scroll) )
[self resetScrollField];
- /* Manage volume status */
- [self manageVolumeSlider];
[NSTimer scheduledTimerWithTimeInterval: 0.3
target: self selector: @selector(manageIntf:)
if( i_volume != i_lastShownVolume )
{
- NSString *o_text;
- o_text = [NSString stringWithFormat: _NS("Volume: %d"), i_volume * 200 / AOUT_VOLUME_MAX];
- if( i_lastShownVolume != -1 )
- [self setScrollField:o_text stopAfter:1000000];
-
- [o_volumeslider setFloatValue: (float)i_volume / AOUT_VOLUME_STEP];
- [o_volumeslider setEnabled: TRUE];
i_lastShownVolume = i_volume;
+ p_intf->p_sys->b_volume_update = TRUE;
}
-
- p_intf->p_sys->b_mute = ( i_volume == 0 );
}
- (IBAction)timesliderUpdate:(id)sender
playlist_t * p_playlist;
vout_thread_t * p_vout;
+#define p_input p_intf->p_sys->p_input
+ if( p_input )
+ {
+ vlc_object_release( p_input );
+ p_input = NULL;
+ }
+#undef p_input
+
/* Stop playback */
if( ( p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ) ) )
}
}
+- (IBAction)showWizard:(id)sender
+{
+ if (!nib_wizard_loaded)
+ {
+ nib_wizard_loaded = [NSBundle loadNibNamed:@"Wizard" owner:self];
+ [o_wizard initStrings];
+ [o_wizard showWizard];
+ } else {
+ [o_wizard showWizard];
+ }
+}
+
+- (IBAction)showExtended:(id)sender
+{
+ if (!nib_extended_loaded)
+ {
+ nib_extended_loaded = [NSBundle loadNibNamed:@"Extended" owner:self];
+ [o_extended initStrings];
+ [o_extended showPanel];
+ } else {
+ [o_extended showPanel];
+ }
+}
+
- (IBAction)viewAbout:(id)sender
{
- [o_about showPanel];
+ if (!nib_about_loaded)
+ {
+ nib_about_loaded = [NSBundle loadNibNamed:@"About" owner:self];
+ [o_about showPanel];
+ } else {
+ [o_about showPanel];
+ }
}
- (IBAction)viewPreferences:(id)sender
{
+/* GRUIIIIIIIK */
+ if( o_prefs == nil )
+ o_prefs = [[VLCPrefs alloc] init];
[o_prefs showPrefs];
}
}
else
{
- NSBeginInformationalAlertSheet(_NS("No CrashLog found"), @"Continue", nil, nil, o_msgs_panel, self, NULL, NULL, nil, _NS("Either you are running Mac OS X pre 10.2 or you haven't experienced any heavy crashes yet.") );
+ NSBeginInformationalAlertSheet(_NS("No CrashLog found"), @"Continue", nil, nil, o_msgs_panel, self, NULL, NULL, nil, _NS("You haven't experienced any heavy crashes yet.") );
}
}
if ( o_size_with_playlist.height > 200 )
{
o_rect.size.height = o_size_with_playlist.height;
+ } else {
+ o_rect.size.height = 500;
}
- else
+
+ if ( o_size_with_playlist.width > [o_window minSize].width )
{
- o_rect.size.height = 500;
- if ( o_rect.size.width == [o_window minSize].width )
- {
- o_rect.size.width = 500;
- }
-
+ o_rect.size.width = o_size_with_playlist.width;
+ } else {
+ o_rect.size.width = 500;
}
+
o_rect.size.height = (o_size_with_playlist.height > 200) ?
o_size_with_playlist.height : 500;
o_rect.origin.x = [o_window frame].origin.x;
{
/* make small */
o_rect.size.height = [o_window minSize].height;
+ o_rect.size.width = [o_window minSize].width;
o_rect.origin.x = [o_window frame].origin.x;
/* Calculate the position of the lower right corner after resize */
o_rect.origin.y = [o_window frame].origin.y +