Commit 323e8f14 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Move <vlc_aout.h> UI functions into their own <vlc_aout_intf.h>

Also move some stuff from vlc_config.h to vlc_aout*.h
parent e2fb5392
/*****************************************************************************
* audio_output.h : audio output interface
* vlc_aout.h : audio output interface
*****************************************************************************
* Copyright (C) 2002-2005 the VideoLAN team
* $Id$
* Copyright (C) 2002-2011 the VideoLAN team
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -29,9 +28,27 @@
* This file defines functions, structures and macros for audio output object
*/
# ifdef __cplusplus
extern "C" {
# endif
/* Max number of pre-filters per input, and max number of post-filters */
#define AOUT_MAX_FILTERS 10
/* Buffers which arrive in advance of more than AOUT_MAX_ADVANCE_TIME
* will be considered as bogus and be trashed */
#define AOUT_MAX_ADVANCE_TIME (DEFAULT_PTS_DELAY * 5)
/* Buffers which arrive in advance of more than AOUT_MAX_PREPARE_TIME
* will cause the calling thread to sleep */
#define AOUT_MAX_PREPARE_TIME (CLOCK_FREQ/2)
/* Buffers which arrive after pts - AOUT_MIN_PREPARE_TIME will be trashed
* to avoid too heavy resampling */
#define AOUT_MIN_PREPARE_TIME (CLOCK_FREQ/25)
/* Max acceptable delay between the coded PTS and the actual presentation
* time, without resampling */
#define AOUT_PTS_TOLERANCE (CLOCK_FREQ/25)
/* Max acceptable resampling (in %) */
#define AOUT_MAX_RESAMPLING 10
#include "vlc_es.h"
......@@ -264,29 +281,9 @@ VLC_API aout_buffer_t *aout_FifoPop( aout_fifo_t * p_fifo ) VLC_USED;
/* From intf.c : */
VLC_API void aout_VolumeSoftInit( aout_instance_t * );
VLC_API void aout_VolumeNoneInit( aout_instance_t * );
VLC_API audio_volume_t aout_VolumeGet( vlc_object_t * );
#define aout_VolumeGet(a) aout_VolumeGet(VLC_OBJECT(a))
VLC_API int aout_VolumeSet( vlc_object_t *, audio_volume_t );
#define aout_VolumeSet(a, b) aout_VolumeSet(VLC_OBJECT(a), b)
VLC_API int aout_VolumeUp( vlc_object_t *, int, audio_volume_t * );
#define aout_VolumeUp(a, b, c) aout_VolumeUp(VLC_OBJECT(a), b, c)
VLC_API int aout_VolumeDown( vlc_object_t *, int, audio_volume_t * );
#define aout_VolumeDown(a, b, c) aout_VolumeDown(VLC_OBJECT(a), b, c)
VLC_API int aout_ToggleMute( vlc_object_t *, audio_volume_t * );
#define aout_ToggleMute(a, b) aout_ToggleMute(VLC_OBJECT(a), b)
VLC_API int aout_SetMute( vlc_object_t *, audio_volume_t *, bool );
VLC_API bool aout_IsMuted( vlc_object_t * );
VLC_API int aout_ChannelsRestart( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * );
VLC_API void aout_EnableFilter(vlc_object_t *, const char *, bool );
#define aout_EnableFilter( o, n, b ) \
aout_EnableFilter( VLC_OBJECT(o), n, b )
/* */
VLC_API vout_thread_t * aout_filter_RequestVout( filter_t *, vout_thread_t *p_vout, video_format_t *p_fmt ) VLC_USED;
# ifdef __cplusplus
}
# endif
#endif /* _VLC_AOUT_H */
#endif /* VLC_AOUT_H */
/*****************************************************************************
* vlc_aout_intf.h : audio output control
*****************************************************************************
* Copyright (C) 2002-2011 the VideoLAN team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_AOUT_INTF_H
#define VLC_AOUT_INTF_H 1
/**
* \file
* This file defines functions, structures and macros for audio output object
*/
#define AOUT_VOLUME_DEFAULT 256
#define AOUT_VOLUME_STEP 32
#define AOUT_VOLUME_MAX 1024
#define AOUT_VOLUME_MIN 0
VLC_API audio_volume_t aout_VolumeGet( vlc_object_t * );
#define aout_VolumeGet(a) aout_VolumeGet(VLC_OBJECT(a))
VLC_API int aout_VolumeSet( vlc_object_t *, audio_volume_t );
#define aout_VolumeSet(a, b) aout_VolumeSet(VLC_OBJECT(a), b)
VLC_API int aout_VolumeUp( vlc_object_t *, int, audio_volume_t * );
#define aout_VolumeUp(a, b, c) aout_VolumeUp(VLC_OBJECT(a), b, c)
VLC_API int aout_VolumeDown( vlc_object_t *, int, audio_volume_t * ) ;
#define aout_VolumeDown(a, b, c) aout_VolumeDown(VLC_OBJECT(a), b, c)
VLC_API int aout_ToggleMute( vlc_object_t *, audio_volume_t * );
#define aout_ToggleMute(a, b) aout_ToggleMute(VLC_OBJECT(a), b)
VLC_API int aout_SetMute( vlc_object_t *, audio_volume_t *, bool );
VLC_API bool aout_IsMuted( vlc_object_t * );
VLC_API void aout_EnableFilter( vlc_object_t *, const char *, bool );
#define aout_EnableFilter( o, n, b ) \
aout_EnableFilter( VLC_OBJECT(o), n, b )
#endif /* _VLC_AOUT_H */
......@@ -78,39 +78,6 @@
* mark it to be presented */
#define DEFAULT_PTS_DELAY (3*CLOCK_FREQ/10)
/*****************************************************************************
* Audio configuration
*****************************************************************************/
/* Volume */
/* If you are coding an interface, please see src/audio_output/intf.c */
#define AOUT_VOLUME_DEFAULT 256
#define AOUT_VOLUME_STEP 32
#define AOUT_VOLUME_MAX 1024
#define AOUT_VOLUME_MIN 0
/* Max number of pre-filters per input, and max number of post-filters */
#define AOUT_MAX_FILTERS 10
/* Buffers which arrive in advance of more than AOUT_MAX_ADVANCE_TIME
* will be considered as bogus and be trashed */
#define AOUT_MAX_ADVANCE_TIME (DEFAULT_PTS_DELAY * 5)
/* Buffers which arrive in advance of more than AOUT_MAX_PREPARE_TIME
* will cause the calling thread to sleep */
#define AOUT_MAX_PREPARE_TIME (CLOCK_FREQ/2)
/* Buffers which arrive after pts - AOUT_MIN_PREPARE_TIME will be trashed
* to avoid too heavy resampling */
#define AOUT_MIN_PREPARE_TIME (CLOCK_FREQ/25)
/* Max acceptable delay between the coded PTS and the actual presentation
* time, without resampling */
#define AOUT_PTS_TOLERANCE (CLOCK_FREQ/25)
/* Max acceptable resampling (in %) */
#define AOUT_MAX_RESAMPLING 10
/*****************************************************************************
* SPU configuration
*****************************************************************************/
......
......@@ -25,6 +25,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
static int Open (vlc_object_t *);
static void Close (vlc_object_t *);
......
......@@ -28,6 +28,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_cpu.h>
#include <pulse/pulseaudio.h>
......
......@@ -33,6 +33,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_charset.h> /* FromLocaleDup, LocaleFree */
#include <vlc_atomic.h>
......
......@@ -29,7 +29,6 @@
#include <vlc_common.h>
#include <vlc_interface.h>
#include <vlc_aout.h>
#include <dbus/dbus.h>
#define DBUS_MPRIS_OBJECT_PATH "/org/mpris/MediaPlayer2"
......
......@@ -31,7 +31,7 @@
#include <vlc_common.h>
#include <vlc_playlist.h>
#include <vlc_interface.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <math.h>
......
......@@ -33,7 +33,7 @@
#include <vlc_plugin.h>
#include <vlc_interface.h>
#include <vlc_vout.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_playlist.h>
#ifdef HAVE_UNISTD_H
......
......@@ -35,7 +35,7 @@
#include <vlc_interface.h>
#include <vlc_input.h>
#include <vlc_vout.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_osd.h>
#include <vlc_playlist.h>
#include <vlc_keys.h>
......@@ -162,7 +162,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
vout_thread_t *p_vout = p_input ? input_GetVout( p_input ) : NULL;
/* Update the aout */
aout_instance_t *p_aout = p_input ? input_GetAout( p_input ) : NULL;
vlc_object_t *p_aout = p_input ? (vlc_object_t *)input_GetAout( p_input ) : NULL;
/* Register OSD channels */
/* FIXME: this check can fail if the new vout is reallocated at the same
......
......@@ -38,7 +38,7 @@
#include <assert.h>
#include <vlc_interface.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_vout.h>
#include <vlc_osd.h>
#include <vlc_playlist.h>
......@@ -1704,7 +1704,6 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
intf_thread_t *p_intf = (intf_thread_t*)p_this;
input_thread_t *p_input =
playlist_CurrentInput( p_intf->p_sys->p_playlist );
aout_instance_t * p_aout;
const char * psz_variable;
vlc_value_t val_name;
int i_error;
......@@ -1719,7 +1718,7 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
return VLC_EGENERIC;
}
p_aout = input_GetAout( p_input );
vlc_object_t * p_aout = (vlc_object_t *)input_GetAout( p_input );
vlc_object_release( p_input );
if ( p_aout == NULL )
return VLC_ENOOBJ;
......
......@@ -35,6 +35,7 @@
#include <vlc_dialog.h>
#include <vlc_url.h>
#include <vlc_modules.h>
#include <vlc_aout_intf.h>
#include <unistd.h> /* execl() */
#import "intf.h"
......
......@@ -44,7 +44,7 @@
#include <vlc_interface.h>
#include <vlc_vout.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_charset.h>
#include <vlc_input.h>
#include <vlc_es.h>
......
......@@ -27,7 +27,7 @@
#endif
#include <vlc_vout.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_keys.h>
#include "actions_manager.hpp"
......
......@@ -31,7 +31,7 @@
#include "input_manager.hpp" /* Get notification of Volume Change */
#include "util/input_slider.hpp" /* SoundSlider */
#include <vlc_aout.h> /* Volume functions */
#include <vlc_aout_intf.h> /* Volume functions */
#include <QLabel>
#include <QHBoxLayout>
......
......@@ -45,7 +45,7 @@
#include "util/qt_dirs.hpp"
#include "../../audio_filter/equalizer_presets.h"
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_intf_strings.h>
#include <vlc_vout.h>
#include <vlc_osd.h>
......@@ -920,7 +920,7 @@ void Equalizer::updateUIFromCore()
float f_preamp;
int i_preset;
aout_instance_t *p_aout = THEMIM->getAout();
vlc_object_t *p_aout = (vlc_object_t *)THEMIM->getAout();
if( p_aout )
{
psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
......@@ -999,7 +999,7 @@ void Equalizer::enable( bool en )
/* Function called when the set2Pass button is activated */
void Equalizer::set2Pass()
{
aout_instance_t *p_aout= THEMIM->getAout();
vlc_object_t *p_aout= (vlc_object_t *)THEMIM->getAout();
bool b_2p = ui.eq2PassCheck->isChecked();
if( p_aout )
......@@ -1014,7 +1014,7 @@ void Equalizer::set2Pass()
void Equalizer::setPreamp()
{
const float f = ( float )( ui.preampSlider->value() ) /10 - 20;
aout_instance_t *p_aout = THEMIM->getAout();
vlc_object_t *p_aout = (vlc_object_t *)THEMIM->getAout();
ui.preampLabel->setText( qtr( "Preamp\n" ) + QString::number( f, 'f', 1 )
+ qtr( "dB" ) );
......@@ -1042,7 +1042,7 @@ void Equalizer::setCoreBands()
values += " " + val;
}
aout_instance_t *p_aout = THEMIM->getAout();
vlc_object_t *p_aout = (vlc_object_t *)THEMIM->getAout();
if( p_aout )
{
//delCallbacks( p_aout );
......@@ -1091,7 +1091,7 @@ void Equalizer::setCorePreset( int i_preset )
}
/* Apply presets to audio output */
aout_instance_t *p_aout= THEMIM->getAout();
vlc_object_t *p_aout = (vlc_object_t *)THEMIM->getAout();
if( p_aout )
{
var_SetString( p_aout , "equalizer-preset" , preset_list[i_preset] );
......@@ -1120,14 +1120,14 @@ static int PresetCallback( vlc_object_t *p_this, char const *psz_cmd,
return VLC_SUCCESS;
}
void Equalizer::delCallbacks( aout_instance_t *p_aout )
void Equalizer::delCallbacks( vlc_object_t *p_aout )
{
//var_DelCallback( p_aout, "equalizer-bands", EqzCallback, this );
//var_DelCallback( p_aout, "equalizer-preamp", EqzCallback, this );
var_DelCallback( p_aout, "equalizer-preset", PresetCallback, this );
}
void Equalizer::addCallbacks( aout_instance_t *p_aout )
void Equalizer::addCallbacks( vlc_object_t *p_aout )
{
//var_AddCallback( p_aout, "equalizer-bands", EqzCallback, this );
//var_AddCallback( p_aout, "equalizer-preamp", EqzCallback, this );
......@@ -1209,7 +1209,7 @@ Compressor::Compressor( intf_thread_t *_p_intf, QWidget *_parent )
BUTTONACT( enableCheck, enable() );
/* Write down initial values */
aout_instance_t *p_aout = THEMIM->getAout();
vlc_object_t *p_aout = (vlc_object_t *)THEMIM->getAout();
char *psz_af;
if( p_aout )
......@@ -1277,7 +1277,7 @@ void Compressor::setInitValues()
void Compressor::setValues()
{
aout_instance_t *p_aout = THEMIM->getAout();
vlc_object_t *p_aout = (vlc_object_t *)THEMIM->getAout();
for( int i = 0 ; i < NUM_CP_CTRL ; i++ )
{
......@@ -1362,7 +1362,7 @@ Spatializer::Spatializer( intf_thread_t *_p_intf, QWidget *_parent )
BUTTONACT( enableCheck, enable() );
/* Write down initial values */
aout_instance_t *p_aout = THEMIM->getAout();
vlc_object_t *p_aout = (vlc_object_t *)THEMIM->getAout();
char *psz_af;
if( p_aout )
......@@ -1412,7 +1412,7 @@ void Spatializer::setInitValues()
void Spatializer::setValues()
{
aout_instance_t *p_aout = THEMIM->getAout();
vlc_object_t *p_aout = (vlc_object_t *)THEMIM->getAout();
for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
{
......@@ -1436,14 +1436,14 @@ void Spatializer::setValues()
}
}
void Spatializer::delCallbacks( aout_instance_t *p_aout )
void Spatializer::delCallbacks( vlc_object_t *p_aout )
{
VLC_UNUSED( p_aout );
// var_DelCallback( p_aout, "Spatializer-bands", EqzCallback, this );
// var_DelCallback( p_aout, "Spatializer-preamp", EqzCallback, this );
}
void Spatializer::addCallbacks( aout_instance_t *p_aout )
void Spatializer::addCallbacks( vlc_object_t *p_aout )
{
VLC_UNUSED( p_aout );
// var_AddCallback( p_aout, "Spatializer-bands", EqzCallback, this );
......
......@@ -98,8 +98,8 @@ private:
QSlider *bands[BANDS];
QLabel *band_texts[BANDS];
void delCallbacks( aout_instance_t * );
void addCallbacks( aout_instance_t * );
void delCallbacks( vlc_object_t * );
void addCallbacks( vlc_object_t * );
intf_thread_t *p_intf;
void clean() { enable(); }
......@@ -129,8 +129,8 @@ private:
intf_thread_t *p_intf;
void delCallbacks( aout_instance_t * );
void addCallbacks( aout_instance_t * );
void delCallbacks( vlc_object_t * );
void addCallbacks( vlc_object_t * );
void updateSliders(float *);
void setValues();
......@@ -156,8 +156,8 @@ private:
QCheckBox *enableCheck;
void delCallbacks( aout_instance_t * );
void addCallbacks( aout_instance_t * );
void delCallbacks( vlc_object_t * );
void addCallbacks( vlc_object_t * );
intf_thread_t *p_intf;
void setValues();
......
......@@ -33,6 +33,7 @@
#include <vlc_config_cat.h>
#include <vlc_configuration.h>
#include <vlc_aout_intf.h>
#include <QString>
#include <QFont>
......
......@@ -38,6 +38,7 @@
#include "dialogs/help.hpp" /* Launch Update */
#include "recents.hpp" /* Recents Item destruction */
#include "util/qvlcapp.hpp" /* QVLCApplication definition */
#include <vlc_aout_intf.h>
#ifdef Q_WS_X11
#include <vlc_xlib.h>
......
......@@ -30,6 +30,7 @@
#include "util/input_slider.hpp"
#include "adapters/seekpoints.hpp"
#include <vlc_aout_intf.h>
#include <stdlib.h>
......
......@@ -27,7 +27,7 @@
#endif
#include <vlc_common.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_playlist.h>
#include "volume.hpp"
......
......@@ -36,7 +36,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_meta.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <lua.h> /* Low level lua C API */
#include <lauxlib.h> /* Higher level C API */
......
......@@ -30,6 +30,7 @@
#endif
#include <vlc_common.h>
#include <vlc_aout_intf.h>
#include <stdio.h>
#include <stdlib.h> /* calloc(), malloc(), free() */
......
......@@ -34,6 +34,7 @@
#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_aout_intf.h>
#include <vlc_aout.h>
#include <vlc_modules.h>
......
......@@ -36,6 +36,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_cpu.h>
#include <vlc_aout_intf.h>
#include "libvlc.h"
//#define Nothing here, this is just to prevent update-po from being stupid
......
......@@ -42,7 +42,7 @@
#include <vlc_input.h>
#include <vlc_meta.h>
#include <vlc_playlist.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_strings.h>
#include <vlc_url.h>
......
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