Commit 69945cce authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* ./extras/MacOSX/vlc.pbproj/project.pbxproj: Added .mp3, .m3u and .mov

  filetypes.
* ./modules/gui/macosx/vout.m: Made the video window a textured window
* All:
  - fixed several missing object_release bugs, that i had introduced.
  - updated the play/pause behaviour.
  - fixed an issue with the volumeslider.
parent a37a2e5e
......@@ -28,7 +28,7 @@
};
CLASS = VLCControls;
LANGUAGE = ObjC;
OUTLETS = {"o_mi_mute" = id; "o_open" = id; "o_volumeslider" = id; };
OUTLETS = {"o_main" = id; "o_mi_mute" = id; "o_open" = id; "o_volumeslider" = id; };
SUPERCLASS = NSObject;
},
{
......
......@@ -124,6 +124,40 @@
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mp3</string>
</array>
<key>CFBundleTypeName</key>
<string>MP3</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mov</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>generic.icns</string>
<key>CFBundleTypeName</key>
<string>Mov File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>m3u</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>generic.icns</string>
<key>CFBundleTypeName</key>
<string>Playlist file</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
......
......@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: controls.m,v 1.9 2003/01/17 21:46:04 hartman Exp $
* $Id: controls.m,v 1.10 2003/01/22 01:48:06 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -46,6 +46,7 @@
@interface VLCControls : NSObject
{
IBOutlet id o_open;
IBOutlet id o_main;
IBOutlet id o_mi_mute;
IBOutlet id o_volumeslider;
int i_ff;
......@@ -96,6 +97,7 @@
if ( p_intf->p_sys->p_input != NULL && p_intf->p_sys->p_input->stream.control.i_status != PAUSE_S)
{
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE );
vlc_object_release( p_playlist );
}
else
{
......@@ -168,7 +170,7 @@
* Therefore we need to count. I know, it is ugly. We could have used
* a bool as well, but now we can also accellerate after a certain period.
* Currently this method is called every second if the button is pressed.
* You can set this value in intf.m
* You can set this value in intf.m (hartman)
*/
case NSPeriodic:
if (i_ff == 1)
......@@ -192,13 +194,13 @@
{
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
break;
default:
break;
}
vlc_object_release( p_playlist );
}
- (IBAction)prev:(id)sender
......@@ -261,7 +263,6 @@
intf_thread_t * p_intf = [NSApp getIntf];
aout_instance_t * p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if ( p_aout != NULL )
{
if (p_intf->p_sys->b_mute)
......@@ -279,7 +280,6 @@
intf_thread_t * p_intf = [NSApp getIntf];
aout_instance_t * p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if ( p_aout != NULL )
{
if (p_intf->p_sys->b_mute)
......@@ -307,6 +307,7 @@
p_intf->p_sys->b_mute = (i_volume == 0);
[o_mi_mute setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
[o_volumeslider setEnabled: p_intf->p_sys->b_mute ? FALSE : TRUE];
[self setVolumeSlider];
}
......@@ -325,13 +326,11 @@
i_volume = (int) [sender floatValue];
aout_VolumeSet( p_aout, i_volume * AOUT_VOLUME_STEP);
vlc_object_release( (vlc_object_t *)p_aout );
p_intf->p_sys->b_mute = (i_volume == 0);
[o_mi_mute setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
}
break;
default:
if ( p_aout != NULL ) vlc_object_release( (vlc_object_t *)p_aout );
break;
}
}
......
......@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.h,v 1.14 2003/01/21 17:08:16 hartman Exp $
* $Id: intf.h,v 1.15 2003/01/22 01:48:06 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -185,6 +185,7 @@ struct intf_sys_t
- (void)manage;
- (void)manageMode;
- (void)setControlItems;
- (void)setupMenus;
- (void)setupLangMenu:(NSMenuItem *)o_mi
......
......@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.28 2003/01/21 17:08:16 hartman Exp $
* $Id: intf.m,v 1.29 2003/01/22 01:48:06 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -195,7 +195,7 @@ static void Run( intf_thread_t *p_intf )
/* button controls */
[o_btn_playlist setToolTip: _NS("Playlist")];
[o_btn_prev setToolTip: _NS("Previous")];
[o_btn_slower setToolTip: _NS("Slower")];
[o_btn_slower setToolTip: _NS("Slowmotion")];
[o_btn_play setToolTip: _NS("Play")];
[o_btn_stop setToolTip: _NS("Stop")];
[o_btn_fastforward setToolTip: _NS("Fast Forward")];
......@@ -233,7 +233,7 @@ static void Run( intf_thread_t *p_intf )
[o_mi_select_all setTitle: _NS("Select All")];
[o_mu_controls setTitle: _NS("Controls")];
[o_mi_play setTitle: _NS("Play/Pause")];
[o_mi_play setTitle: _NS("Play")];
[o_mi_stop setTitle: _NS("Stop")];
[o_mi_faster setTitle: _NS("Faster")];
[o_mi_slower setTitle: _NS("Slower")];
......@@ -268,7 +268,7 @@ static void Run( intf_thread_t *p_intf )
[o_mi_bring_atf setTitle: _NS("Bring All to Front")];
/* dock menu */
[o_dmi_play setTitle: _NS("Play/Pause")];
[o_dmi_play setTitle: _NS("Play")];
[o_dmi_stop setTitle: _NS("Stop")];
/* error panel */
......@@ -321,11 +321,7 @@ static void Run( intf_thread_t *p_intf )
{
p_intf->p_sys->p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
[o_btn_play setState: NSOffState];
[o_btn_stop setEnabled: NO];
[o_btn_slower setEnabled: NO];
[o_btn_fastforward setEnabled: NO];
[o_timeslider setEnabled: NO];
[self setControlItems];
}
else if( p_intf->p_sys->p_input->b_dead )
{
......@@ -344,13 +340,9 @@ static void Run( intf_thread_t *p_intf )
vlc_object_release( p_vout );
vout_Destroy( p_vout );
}
p_intf->p_sys->b_stopping = 0;
[o_btn_play setState: NSOffState];
[o_btn_stop setEnabled: NO];
[o_btn_fastforward setEnabled: NO];
[o_btn_slower setEnabled: NO];
[o_timeslider setEnabled: NO];
[self setControlItems];
}
[self displayTime];
......@@ -414,23 +406,15 @@ static void Run( intf_thread_t *p_intf )
if ( b_need_menus )
[self setupMenus];
if ( p_intf->p_sys->p_input != NULL && p_intf->p_sys->p_input->stream.control.i_status != PAUSE_S)
{
[o_btn_play setState: NSOnState];
}
else
{
[o_btn_play setState: NSOffState];
}
[self setControlItems];
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
else if( p_intf->p_sys->b_playing && !p_intf->b_die )
{
[self displayTime];
[self manageMode];
[o_btn_play setState: NSOffState];
p_intf->p_sys->b_playing = 0;
}
......@@ -587,9 +571,7 @@ static void Run( intf_thread_t *p_intf )
- (void)manageMode
{
vlc_bool_t b_input;
vlc_bool_t b_plmul = 0;
vlc_bool_t b_control = 0;
playlist_t * p_playlist = NULL;
intf_thread_t * p_intf = [NSApp getIntf];
if( ( b_input = ( p_intf->p_sys->p_input != NULL ) ) )
......@@ -621,7 +603,18 @@ static void Run( intf_thread_t *p_intf )
[o_mi_screen setEnabled: FALSE];
[o_mi_close_window setEnabled: FALSE];
}
[self setControlItems];
}
- (void)setControlItems {
intf_thread_t * p_intf = [NSApp getIntf];
vlc_bool_t b_input;
vlc_bool_t b_plmul = 0;
vlc_bool_t b_control = 0;
playlist_t * p_playlist = NULL;
NSImage *playImage = [NSImage imageNamed:@"play"];
NSImage *pauseImage = [NSImage imageNamed:@"pause"];
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL )
......@@ -631,7 +624,13 @@ static void Run( intf_thread_t *p_intf )
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
if( ( b_input = ( p_intf->p_sys->p_input != NULL ) ) )
{
/* control buttons for free pace streams */
b_control = p_intf->p_sys->p_input->stream.b_pace_control;
}
/* set control items */
[o_btn_stop setEnabled: b_input];
[o_btn_fastforward setEnabled: b_control];
......@@ -639,7 +638,8 @@ static void Run( intf_thread_t *p_intf )
[o_btn_prev setEnabled: b_plmul];
[o_btn_next setEnabled: b_plmul];
[o_controls setVolumeSlider];
[o_timeslider setEnabled: b_input];
if ( (p_intf->p_sys->b_loop = config_GetInt( p_intf, "loop" )) )
{
[o_mi_loop setState: NSOnState];
......@@ -648,6 +648,22 @@ static void Run( intf_thread_t *p_intf )
{
[o_mi_loop setState: NSOffState];
}
if ( p_intf->p_sys->p_input != NULL &&
p_intf->p_sys->p_input->stream.control.i_status != PAUSE_S)
{
[o_btn_play setImage: pauseImage];
[o_btn_play setToolTip: _NS("Pause")];
[o_mi_play setTitle: _NS("Pause")];
[o_dmi_play setTitle: _NS("Pause")];
}
else
{
[o_btn_play setImage: playImage];
[o_btn_play setToolTip: _NS("Play")];
[o_mi_play setTitle: _NS("Play")];
[o_dmi_play setTitle: _NS("Play")];
}
}
- (void)setupMenus
......@@ -1051,6 +1067,7 @@ static void Run( intf_thread_t *p_intf )
intf_thread_t * p_intf = [NSApp getIntf];
input_thread_t * p_input = p_intf->p_sys->p_input;
vlc_mutex_unlock( &p_input->stream.stream_lock );
vlc_object_release( p_input );
break;
default:
......
......@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.14 2003/01/20 00:23:45 hartman Exp $
* $Id: vout.m,v 1.15 2003/01/22 01:48:06 hartman Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -1030,7 +1030,8 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
unsigned int i_stylemask = NSTitledWindowMask |
NSMiniaturizableWindowMask |
NSClosableWindowMask |
NSResizableWindowMask;
NSResizableWindowMask |
NSTexturedBackgroundWindowMask;
[p_vout->p_sys->o_window
initWithContentRect: p_vout->p_sys->s_rect
......
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