* aout.m: CoreAudio output plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: aout.m,v 1.20 2003/01/13 20:02:37 jlj Exp $
+ * $Id: aout.m,v 1.21 2003/01/15 00:49:49 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
int E_(OpenAudio)( vlc_object_t * p_this )
{
OSStatus err;
+ vlc_value_t val;
UInt32 i, i_param_size;
struct aout_sys_t * p_sys;
aout_instance_t * p_aout = (aout_instance_t *)p_this;
- vlc_value_t val;
/* Allocate structure */
p_sys = (struct aout_sys_t *)malloc( sizeof( struct aout_sys_t ) );
if( var_Type( p_aout, "audio-device" ) == 0 )
{
+ UInt32 i_option = config_GetInt( p_aout, "macosx-adev" );
+
var_Create( p_aout, "audio-device", VLC_VAR_STRING |
VLC_VAR_HASCHOICE );
{
val.psz_string = p_sys->p_options[i].sz_option;
var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val );
+
+ if( i == i_option )
+ {
+ var_Set( p_aout, "audio-device", val );
+ }
}
var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart,
NULL );
+
+ val.b_bool = VLC_TRUE;
+ var_Set( p_aout, "intf-change", val );
}
- val.b_bool = VLC_TRUE;
- var_Set( p_aout, "intf-change", val );
- /* Get selected device */
+ /* Get requested device */
if( GetDevice( p_aout, &p_sys->devid ) )
{
msg_Err( p_aout, "GetDevice failed" );
static int GetDevice( aout_instance_t *p_aout, AudioDeviceID *p_devid )
{
OSStatus err;
- char *psz_tmp;
vlc_value_t val;
- UInt32 i_option;
+ unsigned int i_option;
struct aout_dev_t * p_dev;
struct aout_option_t * p_option;
return( VLC_ENOVAR );
}
- psz_tmp = strchr( val.psz_string, ':' );
- if( psz_tmp == NULL )
+ if( !sscanf( val.psz_string, "%d:", &i_option ) ||
+ p_sys->i_options <= i_option )
{
- msg_Err( p_aout, "audio-device value missing seperator" );
- free( (void *)val.psz_string );
- return( VLC_EGENERIC );
+ i_option = 0;
}
- *psz_tmp = '\0';
- i_option = atol( val.psz_string );
free( (void *)val.psz_string );
p_option = &p_sys->p_options[i_option];
msg_Dbg( p_aout, "getting device [%ld]", p_option->i_dev );
+ config_PutInt( p_aout, "macosx-adev", i_option );
+
*p_devid = p_dev->devid;
return( VLC_SUCCESS );
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.23 2003/01/13 17:11:14 ipkiss Exp $
+ * $Id: intf.m,v 1.24 2003/01/15 00:49:49 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+ config_SaveConfigFile( p_intf, MODULE_STRING );
+
[p_intf->p_sys->o_sendport release];
[p_intf->p_sys->o_pool release];
/*****************************************************************************
* macosx.m: MacOS X plugin for vlc
*****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: macosx.m,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * Copyright (C) 2001-2003 VideoLAN
+ * $Id: macosx.m,v 1.2 2003/01/15 00:49:49 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
/*****************************************************************************
* Module descriptor
*****************************************************************************/
+#define ADEV_TEXT N_("audio device")
+#define VDEV_TEXT N_("video device")
+
vlc_module_begin();
set_description( _("MacOS X interface, sound and video module") );
add_submodule();
add_submodule();
set_capability( "video output", 100 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
+ add_category_hint( N_("Video"), NULL );
+ add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_TEXT );
add_submodule();
set_capability( "audio output", 100 );
set_callbacks( E_(OpenAudio), E_(CloseAudio) );
+ add_category_hint( N_("Audio"), NULL );
+ add_integer( "macosx-adev", 0, NULL, ADEV_TEXT, ADEV_TEXT );
vlc_module_end();
/*****************************************************************************
* vout.m: MacOS X video output plugin
*****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout.m,v 1.11 2003/01/05 16:23:57 massiot Exp $
+ * Copyright (C) 2001-2003 VideoLAN
+ * $Id: vout.m,v 1.12 2003/01/15 00:49:49 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
NSArray * o_screens = [NSScreen screens];
- if ( [o_screens count] > 0 )
+ if( [o_screens count] > 0 && var_Type( p_vout, "video-device" ) == 0 )
{
int i = 1;
vlc_value_t val;
NSScreen * o_screen;
- var_Destroy( p_vout, "video-device" );
- var_Create( p_vout, "video-device",
- VLC_VAR_STRING | VLC_VAR_HASCHOICE );
+ int i_option = config_GetInt( p_vout, "macosx-vdev" );
+
+ var_Create( p_vout, "video-device", VLC_VAR_STRING |
+ VLC_VAR_HASCHOICE );
NSEnumerator * o_enumerator = [o_screens objectEnumerator];
- while ( (o_screen = [o_enumerator nextObject]) != NULL )
+ while( (o_screen = [o_enumerator nextObject]) != NULL )
{
char psz_temp[255];
NSRect s_rect = [o_screen frame];
val.psz_string = psz_temp;
var_Change( p_vout, "video-device", VLC_VAR_ADDCHOICE, &val );
+ if( ( i - 1 ) == i_option )
+ {
+ var_Set( p_vout, "video-device", val );
+ }
+
i++;
}
}
else
{
- o_screen = [o_screens objectAtIndex: i_index - 1];
+ i_index--;
+ o_screen = [o_screens objectAtIndex: i_index];
+ config_PutInt( p_vout, "macosx-vdev", i_index );
}
free( val.psz_string );