Commit 8345dff5 authored by Jon Lech Johansen's avatar Jon Lech Johansen

* ./modules/gui/macosx/aout.m: M-Audio Revolution fixes.

                                 Dynamic device support.
  * ./modules/gui/macosx: Minor fixes and cosmetic changes.
parent 36401a1c
......@@ -39,7 +39,7 @@
ACTIONS = {showCategory = id; toggleInfoPanel = id; };
CLASS = VLCInfo;
LANGUAGE = ObjC;
OUTLETS = {"o_info_selector" = id; "o_info_view" = id; "o_info_window" = id; };
OUTLETS = {"o_selector" = id; "o_view" = id; "o_window" = id; };
SUPERCLASS = NSObject;
},
{
......
......@@ -3,11 +3,11 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>65 171 365 441 0 0 1280 1002 </string>
<string>417 347 365 441 0 0 1600 1178 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>16 822 419 44 0 0 1280 1002 </string>
<string>22 973 419 44 0 0 1600 1178 </string>
<key>303</key>
<string>60 509 104 114 0 0 1280 1002 </string>
<key>909</key>
......@@ -23,8 +23,9 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>1194</integer>
<integer>21</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>6I32</string>
......
This diff is collapsed.
/*****************************************************************************
* info.h: MacOS X info panel
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: info.h,v 1.1 2003/02/17 10:52:07 hartman Exp $
* Copyright (C) 2003 VideoLAN
* $Id: info.h,v 1.2 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......@@ -21,28 +21,21 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include <vlc/vlc.h>
#include <vlc/intf.h>
#import <Cocoa/Cocoa.h>
/*****************************************************************************
* VLCInfo interface
*****************************************************************************/
@interface VLCInfo : NSObject {
@interface VLCInfo : NSObject
{
IBOutlet id o_window;
IBOutlet id o_view;
IBOutlet id o_selector;
IBOutlet id o_info_window;
IBOutlet id o_info_view;
IBOutlet id o_info_selector;
intf_thread_t *p_intf;
NSMutableDictionary *o_info_strings;
NSMutableDictionary * o_strings;
}
- (void)updateInfo;
- (IBAction)toggleInfoPanel:(id)sender;
- (IBAction)showCategory:(id)sender;
- (void)updateInfo;
- (void)createInfoView:(input_info_category_t *)p_category;
@end
/*****************************************************************************
* info.m: MacOS X info panel
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: info.m,v 1.2 2003/02/18 20:54:02 hartman Exp $
* Copyright (C) 2003 VideoLAN
* $Id: info.m,v 1.3 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......@@ -22,23 +22,25 @@
*****************************************************************************/
#include "intf.h"
#import "info.h"
#include "info.h"
/*****************************************************************************
* VLCInfo implementation
*****************************************************************************/
@implementation VLCInfo
- (void)awakeFromNib
{
[o_window setExcludedFromWindowsMenu: YES];
}
- (id)init
{
self = [super init];
if( self != nil )
{
p_intf = [NSApp getIntf];
o_info_strings = [[NSMutableDictionary alloc] init];
o_strings = [[NSMutableDictionary alloc] init];
}
return( self );
......@@ -46,91 +48,99 @@
- (void)dealloc
{
[o_info_strings release];
[o_strings release];
[super dealloc];
}
- (IBAction)toggleInfoPanel:(id)sender
{
if ( [o_info_window isVisible] )
if( [o_window isVisible] )
{
[o_info_window orderOut:sender];
[o_window orderOut: sender];
}
else
{
[o_info_window orderFront:sender];
[o_window orderFront: sender];
[self updateInfo];
}
}
- (IBAction)showCategory:(id)sender
{
NSString *o_selected = [o_info_selector titleOfSelectedItem];
[o_info_view setString:(NSString *)[o_info_strings objectForKey: o_selected]];
[o_info_view setNeedsDisplay: YES];
NSString * o_title = [o_selector titleOfSelectedItem];
[o_view setString: [o_strings objectForKey: o_title]];
[o_view setNeedsDisplay: YES];
}
- (void)updateInfo
{
if ( ![o_info_window isVisible] )
if( ![o_window isVisible] )
{
return;
}
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
[o_info_window orderOut:self];
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
if ( p_playlist->p_input == NULL )
{
[o_info_window orderOut:self];
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
return;
}
[o_info_strings removeAllObjects];
[o_info_selector removeAllItems];
[o_info_view setDrawsBackground: NO];
[[[o_info_view superview] superview] setDrawsBackground: NO];
[o_info_window setExcludedFromWindowsMenu:YES];
[o_strings removeAllObjects];
[o_selector removeAllItems];
vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
input_info_category_t *p_category = p_playlist->p_input->stream.p_info;
while ( p_category )
input_info_category_t * p_category = p_playlist->p_input->stream.p_info;
while( p_category )
{
[self createInfoView: p_category ];
[self createInfoView: p_category];
p_category = p_category->p_next;
}
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
[o_info_selector selectItemAtIndex: 0];
[self showCategory:o_info_selector];
[o_selector selectItemAtIndex: 0];
[self showCategory: o_selector];
}
- (void)createInfoView:(input_info_category_t *)p_category
{
/* Add a catecory */
NSString *title = [NSString stringWithCString: p_category->psz_name];
[o_info_selector addItemWithTitle: title];
NSString * o_title;
NSMutableString * o_content;
input_info_t * p_info;
/* Create the textfield content */
NSMutableString *catString = [NSMutableString string];
/* Add a category */
o_title = [NSString stringWithCString: p_category->psz_name];
[o_selector addItemWithTitle: o_title];
/* Create empty content string */
o_content = [NSMutableString string];
/* Add the fields */
input_info_t *p_info = p_category->p_info;
while ( p_info )
p_info = p_category->p_info;
while( p_info )
{
[catString appendFormat: @"%s: %s\n\n", p_info->psz_name, p_info->psz_value];
[o_content appendFormat: @"%s: %s\n\n", p_info->psz_name,
p_info->psz_value];
p_info = p_info->p_next;
}
[o_info_strings setObject: catString forKey: title];
[o_strings setObject: o_content forKey: o_title];
}
@end
......@@ -141,6 +151,7 @@
{
BOOL bEnabled = TRUE;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
......
......@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.60 2003/02/19 14:49:25 hartman Exp $
* $Id: intf.m,v 1.61 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -435,15 +435,6 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
if( p_playlist != NULL )
{
vlc_value_t val;
if( var_Get( (vlc_object_t *)p_playlist, "intf-change", &val )
>= 0 && val.b_bool )
{
p_intf->p_sys->b_playlist_update = 1;
p_intf->p_sys->b_intf_update = VLC_TRUE;
}
vlc_mutex_lock( &p_playlist->object_lock );
[self manage: p_playlist];
......@@ -465,8 +456,17 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
- (void)manage:(playlist_t *)p_playlist
{
vlc_value_t val;
intf_thread_t * p_intf = [NSApp getIntf];
if( var_Get( (vlc_object_t *)p_playlist, "intf-change", &val ) >= 0 &&
val.b_bool )
{
p_intf->p_sys->b_playlist_update = VLC_TRUE;
p_intf->p_sys->b_intf_update = VLC_TRUE;
}
#define p_input p_playlist->p_input
if( p_input )
......@@ -508,8 +508,10 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
p_intf->p_sys->b_aout_update = 1;
b_need_menus = VLC_TRUE;
}
vlc_object_release( (vlc_object_t *)p_aout );
}
aout_VolumeGet( p_intf, &i_volume );
p_intf->p_sys->b_mute = ( i_volume == 0 );
......@@ -578,15 +580,6 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
vout_Destroy( p_vout );
vlc_mutex_lock( &p_playlist->object_lock );
}
aout_instance_t * p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if( p_aout != NULL )
{
vlc_object_detach( (vlc_object_t *)p_aout );
vlc_object_release( (vlc_object_t *)p_aout );
aout_Delete( p_aout );
}
}
p_intf->p_sys->b_intf_update = VLC_TRUE;
......@@ -610,51 +603,46 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
if ( p_intf->p_sys->b_playlist_update )
{
vlc_value_t val;
val.b_bool = 0;
val.b_bool = 0;
var_Set( (vlc_object_t *)p_playlist, "intf-change", val );
[o_playlist playlistUpdated];
p_intf->p_sys->b_playlist_update = VLC_FALSE;
}
#define p_input p_playlist->p_input
[o_playlist playlistUpdated];
if( p_input != NULL )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
p_intf->p_sys->b_playlist_update = VLC_FALSE;
}
if( p_intf->p_sys->b_current_title_update )
{
id o_awindow = [NSApp keyWindow];
NSArray *o_windows = [NSApp windows];
NSEnumerator *o_enumerator = [o_windows objectEnumerator];
id o_vout_wnd;
NSEnumerator * o_enum = [[NSApp windows] objectEnumerator];
while ((o_awindow = [o_enumerator nextObject]))
while( ( o_vout_wnd = [o_enum nextObject] ) )
{
if( [[o_awindow className] isEqualToString: @"VLCWindow"] )
if( [[o_vout_wnd className] isEqualToString: @"VLCWindow"] )
{
vlc_mutex_unlock( &p_playlist->object_lock );
[o_awindow updateTitle];
vlc_mutex_lock( &p_playlist->object_lock );
[o_vout_wnd updateTitle];
}
}
vlc_mutex_unlock( &p_playlist->object_lock );
[o_playlist updateState];
[o_playlist updateRowSelection];
[o_info updateInfo];
p_intf->p_sys->b_current_title_update = FALSE;
}
vlc_mutex_lock( &p_playlist->object_lock );
#define p_input p_playlist->p_input
if( p_input != NULL )
{
vlc_mutex_unlock( &p_input->stream.stream_lock );
[o_info updateInfo];
vlc_mutex_lock( &p_input->stream.stream_lock );
}
p_intf->p_sys->b_current_title_update = FALSE;
}
if( p_intf->p_sys->b_intf_update )
{
......
......@@ -2,7 +2,7 @@
* macosx.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: macosx.m,v 1.3 2003/02/20 01:52:46 sigmunau Exp $
* $Id: macosx.m,v 1.4 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
......@@ -56,7 +56,7 @@ vlc_module_begin();
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
add_submodule();
set_capability( "video output", 100 );
set_capability( "video output", 200 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
add_category_hint( N_("Video"), NULL, VLC_FALSE );
add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_TEXT, VLC_FALSE );
......@@ -64,6 +64,6 @@ vlc_module_begin();
set_capability( "audio output", 100 );
set_callbacks( E_(OpenAudio), E_(CloseAudio) );
add_category_hint( N_("Audio"), NULL, VLC_FALSE );
add_integer( "macosx-adev", 0, NULL, ADEV_TEXT, ADEV_TEXT, VLC_FALSE );
add_integer( "macosx-adev", -1, NULL, ADEV_TEXT, ADEV_TEXT, VLC_FALSE );
vlc_module_end();
/*****************************************************************************
* playlist.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: playlist.h,v 1.5 2003/02/13 14:16:41 hartman Exp $
* Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.h,v 1.6 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net>
......@@ -56,7 +56,8 @@
- (IBAction)selectAll:(id)sender;
- (void)appendArray:(NSArray*)o_array atPos:(int)i_pos enqueue:(BOOL)b_enqueue;
- (void)updateRowSelection;
- (void)playlistUpdated;
- (void)updateState;
@end
/*****************************************************************************
* playlist.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: playlist.m,v 1.11 2003/02/13 14:16:41 hartman Exp $
* Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.m,v 1.12 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -65,7 +65,7 @@
{
case ' ':
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist != NULL && p_playlist->p_input != NULL )
if( p_playlist->p_input != NULL )
{
input_SetStatus( p_playlist->p_input, INPUT_STATUS_PAUSE );
}
......@@ -300,7 +300,7 @@
[o_table_view reloadData];
}
- (void)updateState
- (void)updateRowSelection
{
int i_row;
......@@ -313,7 +313,9 @@
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
i_row = p_playlist->i_index;
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
[o_table_view selectRow: i_row byExtendingSelection: NO];
......@@ -322,16 +324,15 @@
vout_thread_t * p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if ( p_vout == NULL )
if( p_vout == NULL || !p_vout->b_fullscreen )
{
[[NSApp keyWindow] makeFirstResponder:o_table_view];
return;
[[NSApp keyWindow] makeFirstResponder: o_table_view];
}
else if ( !p_vout->b_fullscreen )
if( p_vout != NULL )
{
[[NSApp keyWindow] makeFirstResponder:o_table_view];
}
vlc_object_release( (vlc_object_t *)p_vout );
}
}
@end
......@@ -347,7 +348,9 @@
if( p_playlist != NULL )
{
vlc_mutex_lock( &p_playlist->object_lock );
i_count = p_playlist->i_size;
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
......
/*****************************************************************************
* prefs.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: prefs.h,v 1.3 2003/02/21 02:45:21 hartman Exp $
* Copyright (C) 2002-2003 VideoLAN
* $Id: prefs.h,v 1.4 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......
/*****************************************************************************
* prefs.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: prefs.m,v 1.15 2003/02/21 02:45:21 hartman Exp $
* Copyright (C) 2002-2003 VideoLAN
* $Id: prefs.m,v 1.16 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -280,7 +280,7 @@
if( p_item ) do
{
if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" ))
if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" ) )
{
continue;
}
......@@ -728,7 +728,7 @@
{
id o_vlc_control;
NSEnumerator *o_enum;
BOOL b_advanced_change = FALSE;
BOOL b_adv_change = FALSE;
NSWindow *o_pref_panel = [[sender superview] window];
NSString *o_module_name = [[o_pref_panel toolbar] identifier];
......@@ -770,10 +770,13 @@
case CONFIG_ITEM_BOOL:
{
int i_value = [o_vlc_control intValue];
if ( !strcmp( psz_name, "advanced" ) && ( config_GetInt( p_intf, "advanced" ) != i_value ) )
if( !strcmp( psz_name, "advanced" ) &&
( config_GetInt( p_intf, "advanced" ) != i_value ) )
{
b_advanced_change = TRUE;
b_adv_change = TRUE;
}
config_PutInt( p_intf, psz_name, i_value );
}
break;
......@@ -795,11 +798,7 @@
config_SaveConfigFile( p_intf, NULL );
}
if ( [[sender title] isEqualToString: _NS("Apply")] && !b_advanced_change )
{
;
}
else
if( ![[sender title] isEqualToString: _NS("Apply")] || b_adv_change )
{
[o_pref_panel close];
......@@ -809,10 +808,6 @@
[self performSelectorOnMainThread: @selector(destroyPrefPanel:)
withObject: o_module_name
waitUntilDone: YES];
if ( [[sender title] isEqualToString: _NS("Apply")] && b_advanced_change )
{
[self createPrefPanel:@"main"];
}
}
else
{
......@@ -820,6 +815,11 @@
target: self selector: @selector(destroyPrefPanel:)
userInfo: o_module_name repeats: NO];
}
if( [[sender title] isEqualToString: _NS("Apply")] && b_adv_change )
{
[self createPrefPanel: o_module_name];
}
}
}
......
......@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.34 2003/02/15 12:57:51 hartman Exp $
* $Id: vout.m,v 1.35 2003/02/23 05:53:53 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -819,7 +819,8 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
- (void)updateTitle
{
NSMutableString *o_title;
NSMutableString * o_title;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
......@@ -836,11 +837,13 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
vlc_object_release( p_playlist );
if (o_title)
if( o_title != nil )
{
NSRange prefix_range = [o_title rangeOfString: @"file:"];
if( prefix_range.location != NSNotFound )
{
NSRange prefixrange = [o_title rangeOfString: @"file:"];
if ( prefixrange.location != NSNotFound )
[o_title deleteCharactersInRange: prefixrange];
[o_title deleteCharactersInRange: prefix_range];
}
[self setTitleWithRepresentedFilename: o_title];
}
......
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