* aout_beos.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_beos.cpp,v 1.12 2001/02/18 03:32:02 polux Exp $
+ * $Id: aout_beos.cpp,v 1.23 2002/02/24 22:06:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include "defs.h"
-
#include <stdio.h>
#include <stdlib.h> /* malloc(), free() */
#include <kernel/OS.h>
extern "C"
{
-#include "config.h"
-#include "common.h"
-#include "threads.h"
-#include "mtime.h"
+#include <videolan/vlc.h>
#include "audio_output.h"
-
-#include "intf_msg.h"
-#include "main.h"
-
-#include "modules.h"
}
/*****************************************************************************
BPushGameSound * p_sound;
gs_audio_format * p_format;
void * p_buffer;
- long i_buffer_size;
- long i_buffer_pos;
+ int i_buffer_size;
+ int i_buffer_pos;
} aout_sys_t;
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
-static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
+static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
static void aout_Play ( aout_thread_t *p_aout,
byte_t *buffer, int i_size );
static void aout_Close ( aout_thread_t *p_aout );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-void aout_getfunctions( function_list_t * p_function_list )
+void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- /* We don't test anything since I don't know what to test. However
- * if the module could be loaded it is quite likely to work. */
- return( 100 );
-}
-
/*****************************************************************************
* aout_Open: opens a BPushGameSound
*****************************************************************************/
}
/* Initialize some variables */
- p_aout->i_format = AOUT_FORMAT_DEFAULT;
- p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
- AOUT_STEREO_DEFAULT );
- p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT );
-
p_aout->p_sys->p_format->frame_rate = 44100.0;
p_aout->p_sys->p_format->channel_count = p_aout->i_channels;
p_aout->p_sys->p_format->format = gs_audio_format::B_GS_S16;
/*****************************************************************************
* aout_GetBufInfo: buffer status query
*****************************************************************************/
-static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
+static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
/* Each value is 4 bytes long (stereo signed 16 bits) */
- long i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
+ int i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
i_hard_pos = p_aout->p_sys->i_buffer_pos - i_hard_pos;
if( i_hard_pos < 0 )
*****************************************************************************/
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
- long i_newbuf_pos;
+ int i_newbuf_pos;
if( (i_newbuf_pos = p_aout->p_sys->i_buffer_pos + i_size)
> p_aout->p_sys->i_buffer_size )