Commit 875e25d5 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Qt: remove vlc_object_find for AOUTs in menu and extended settings.

parent 1be27f13
......@@ -875,8 +875,7 @@ void Equalizer::updateUIFromCore()
float f_preamp;
int i_preset;
aout_instance_t *p_aout = ( aout_instance_t * )vlc_object_find( p_intf,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
aout_instance_t *p_aout = THEMIM->getAout();
if( p_aout )
{
psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
......@@ -938,8 +937,7 @@ void Equalizer::enable( bool en )
/* Function called when the set2Pass button is activated */
void Equalizer::set2Pass()
{
aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
aout_instance_t *p_aout= THEMIM->getAout();
bool b_2p = ui.eq2PassCheck->isChecked();
if( p_aout == NULL )
......@@ -960,8 +958,7 @@ void Equalizer::set2Pass()
void Equalizer::setPreamp()
{
const float f = ( float )( ui.preampSlider->value() ) /10 - 20;
aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
aout_instance_t *p_aout = THEMIM->getAout();
ui.preampLabel->setText( qtr( "Preamp\n" ) + QString::number( f, 'f', 1 )
+ qtr( "dB" ) );
......@@ -990,8 +987,7 @@ void Equalizer::setCoreBands()
}
const char *psz_values = values.toAscii().constData();
aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
aout_instance_t *p_aout = THEMIM->getAout();
if( p_aout )
{
//delCallbacks( p_aout );
......@@ -1053,8 +1049,7 @@ void Equalizer::setCorePreset( int i_preset )
char *psz_values = createValuesFromPreset( i_preset );
if( !psz_values ) return ;
aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
aout_instance_t *p_aout= THEMIM->getAout();
if( p_aout )
{
delCallbacks( p_aout );
......@@ -1148,8 +1143,7 @@ Spatializer::Spatializer( intf_thread_t *_p_intf, QWidget *_parent ) :
BUTTONACT( enableCheck, enable() );
/* Write down initial values */
aout_instance_t *p_aout = ( aout_instance_t * )
vlc_object_find( p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE );
aout_instance_t *p_aout = THEMIM->getAout();
char *psz_af;
if( p_aout )
......@@ -1204,8 +1198,7 @@ void Spatializer::setInitValues()
void Spatializer::setValues( float *controlVars )
{
aout_instance_t *p_aout= ( aout_instance_t * )
vlc_object_find( p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE );
aout_instance_t *p_aout = THEMIM->getAout();
for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
{
......
......@@ -31,6 +31,7 @@
#include <vlc_input.h>
#include <vlc_vout.h>
#include <vlc_aout.h>
#include "qt4.hpp"
......@@ -220,6 +221,14 @@ public:
return NULL;
}
aout_instance_t *getAout()
{
aout_instance_t *p_aout;
if( p_input && !input_Control( p_input, INPUT_GET_AOUT, &p_aout ) )
{
return p_aout;
}
}
private:
MainInputManager( intf_thread_t * );
static MainInputManager *instance;
......
......@@ -230,7 +230,7 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object,
return VLC_SUCCESS;
}
static int AudioAutoMenuBuilder( vlc_object_t *p_object,
static int AudioAutoMenuBuilder( aout_instance_t *p_object,
input_thread_t *p_input,
vector<vlc_object_t *> &objects,
vector<const char *> &varnames )
......@@ -477,7 +477,7 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
{
vector<vlc_object_t *> objects;
vector<const char *> varnames;
vlc_object_t *p_aout;
aout_instance_t *p_aout;
input_thread_t *p_input;
if( !current ) current = new QMenu();
......@@ -494,9 +494,7 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
p_input = THEMIM->getInput();
if( p_input )
vlc_object_hold( p_input );
p_aout = ( vlc_object_t * ) vlc_object_find( p_intf,
VLC_OBJECT_AOUT,
FIND_ANYWHERE );
p_aout = THEMIM->getAout();
AudioAutoMenuBuilder( p_aout, p_input, objects, varnames );
......@@ -759,8 +757,7 @@ void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
if( p_input )
{
vlc_object_hold( p_input );
vlc_object_t *p_aout = ( vlc_object_t * )vlc_object_find( p_input,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
aout_instance_t *p_aout = THEMIM->getAout();
AudioAutoMenuBuilder( p_aout, p_input, objects, varnames );
if( p_aout )
vlc_object_release( p_aout );
......
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