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

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

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