1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 the VideoLAN team
7 * Authors: Cyril Deguet <asmax@via.ecp.fr>
8 * Olivier Teuli�e <ipkiss@via.ecp.fr>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
27 #include <aout_internal.h>
29 #include "vlcproc.hpp"
30 #include "os_factory.hpp"
31 #include "os_timer.hpp"
32 #include "var_manager.hpp"
34 #include "window_manager.hpp"
35 #include "../commands/async_queue.hpp"
36 #include "../commands/cmd_change_skin.hpp"
37 #include "../commands/cmd_show_window.hpp"
38 #include "../commands/cmd_quit.hpp"
39 #include "../commands/cmd_resize.hpp"
40 #include "../commands/cmd_vars.hpp"
41 #include "../commands/cmd_dialogs.hpp"
42 #include "../utils/var_bool.hpp"
46 VlcProc *VlcProc::instance( intf_thread_t *pIntf )
48 if( pIntf->p_sys->p_vlcProc == NULL )
50 pIntf->p_sys->p_vlcProc = new VlcProc( pIntf );
53 return pIntf->p_sys->p_vlcProc;
57 void VlcProc::destroy( intf_thread_t *pIntf )
59 if( pIntf->p_sys->p_vlcProc )
61 delete pIntf->p_sys->p_vlcProc;
62 pIntf->p_sys->p_vlcProc = NULL;
67 VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
68 m_varVoutSize( pIntf ), m_varEqBands( pIntf ),
69 m_pVout( NULL ), m_pAout( NULL ), m_cmdManage( this )
71 // Create a timer to poll the status of the vlc
72 OSFactory *pOsFactory = OSFactory::instance( pIntf );
73 m_pTimer = pOsFactory->createOSTimer( m_cmdManage );
74 m_pTimer->start( 100, false );
76 // Create and register VLC variables
77 VarManager *pVarManager = VarManager::instance( getIntf() );
79 #define REGISTER_VAR( var, type, name ) \
80 var = VariablePtr( new type( getIntf() ) ); \
81 pVarManager->registerVar( var, name );
82 REGISTER_VAR( m_cPlaylist, Playlist, "playlist" )
83 pVarManager->registerVar( getPlaylistVar().getPositionVarPtr(),
85 REGISTER_VAR( m_cVarRandom, VarBoolImpl, "playlist.isRandom" )
86 REGISTER_VAR( m_cVarLoop, VarBoolImpl, "playlist.isLoop" )
87 REGISTER_VAR( m_cVarRepeat, VarBoolImpl, "playlist.isRepeat" )
88 REGISTER_VAR( m_cPlaytree, Playtree, "playtree" )
89 pVarManager->registerVar( getPlaytreeVar().getPositionVarPtr(),
91 pVarManager->registerVar( m_cVarRandom, "playtree.isRandom" );
92 pVarManager->registerVar( m_cVarLoop, "playtree.isLoop" );
93 pVarManager->registerVar( m_cVarRepeat, "playtree.isRepeat" );
94 REGISTER_VAR( m_cVarTime, StreamTime, "time" )
95 REGISTER_VAR( m_cVarVolume, Volume, "volume" )
96 REGISTER_VAR( m_cVarMute, VarBoolImpl, "vlc.isMute" )
97 REGISTER_VAR( m_cVarPlaying, VarBoolImpl, "vlc.isPlaying" )
98 REGISTER_VAR( m_cVarStopped, VarBoolImpl, "vlc.isStopped" )
99 REGISTER_VAR( m_cVarPaused, VarBoolImpl, "vlc.isPaused" )
100 REGISTER_VAR( m_cVarSeekable, VarBoolImpl, "vlc.isSeekable" )
101 REGISTER_VAR( m_cVarEqualizer, VarBoolImpl, "equalizer.isEnabled" )
102 REGISTER_VAR( m_cVarEqPreamp, EqualizerPreamp, "equalizer.preamp" )
103 REGISTER_VAR( m_cVarDvdActive, VarBoolImpl, "dvd.isActive" )
104 REGISTER_VAR( m_cVarFullscreen, VarBoolImpl, "vlc.isFullscreen" )
105 REGISTER_VAR( m_cVarHasVout, VarBoolImpl, "vlc.hasVout" )
107 m_cVarStreamName = VariablePtr( new VarText( getIntf(), false ) );
108 pVarManager->registerVar( m_cVarStreamName, "streamName" );
109 m_cVarStreamURI = VariablePtr( new VarText( getIntf(), false ) );
110 pVarManager->registerVar( m_cVarStreamURI, "streamURI" );
112 // Register the equalizer bands
113 for( int i = 0; i < EqualizerBands::kNbBands; i++)
116 ss << "equalizer.band(" << i << ")";
117 pVarManager->registerVar( m_varEqBands.getBand( i ), ss.str() );
121 // The object variable callbacks are called from other VLC threads,
122 // so they must put commands in the queue and NOT do anything else
123 // (X11 calls are not reentrant)
125 // Called when the playlist changes
126 var_AddCallback( pIntf->p_sys->p_playlist, "intf-change",
127 onIntfChange, this );
128 // Called when a playlist item is added
129 var_AddCallback( pIntf->p_sys->p_playlist, "item-append",
130 onItemAppend, this );
131 // Called when a playlist item is deleted
132 // TODO: properly handle item-deleted
133 var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
134 onItemDelete, this );
135 // Called when the "interface shower" wants us to show the skin
136 var_AddCallback( pIntf->p_sys->p_playlist, "intf-show",
138 // Called when the current played item changes
139 var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
140 onPlaylistChange, this );
141 // Called when a playlist item changed
142 var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
143 onItemChange, this );
144 // Called when our skins2 demux wants us to load a new skin
145 var_AddCallback( pIntf, "skin-to-load", onSkinToLoad, this );
147 // Called when we have an interaction dialog to display
148 var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
149 var_AddCallback( pIntf, "interaction", onInteraction, this );
150 pIntf->b_interaction = VLC_TRUE;
152 // Callbacks for vout requests
153 getIntf()->pf_request_window = &getWindow;
154 getIntf()->pf_release_window = &releaseWindow;
155 getIntf()->pf_control_window = &controlWindow;
157 getIntf()->p_sys->p_input = NULL;
165 if( getIntf()->p_sys->p_input )
167 vlc_object_release( getIntf()->p_sys->p_input );
170 // Callbacks for vout requests
171 getIntf()->pf_request_window = NULL;
172 getIntf()->pf_release_window = NULL;
173 getIntf()->pf_control_window = NULL;
175 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
176 onIntfChange, this );
177 var_DelCallback( getIntf()->p_sys->p_playlist, "item-append",
178 onItemAppend, this );
179 var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
180 onItemDelete, this );
181 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-show",
183 var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
184 onPlaylistChange, this );
185 var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
186 onItemChange, this );
187 var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
191 void VlcProc::registerVoutWindow( void *pVoutWindow )
193 m_handleSet.insert( pVoutWindow );
194 // Reparent the vout window
197 if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
198 vout_Control( m_pVout, VOUT_CLOSE );
203 void VlcProc::unregisterVoutWindow( void *pVoutWindow )
205 m_handleSet.erase( pVoutWindow );
209 void VlcProc::dropVout()
213 if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
214 vout_Control( m_pVout, VOUT_CLOSE );
220 void VlcProc::manage()
222 // Did the user requested to quit vlc ?
223 if( getIntf()->b_die || getIntf()->p_vlc->b_die )
225 CmdQuit *pCmd = new CmdQuit( getIntf() );
226 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
227 pQueue->push( CmdGenericPtr( pCmd ) );
230 // Get the VLC variables
231 StreamTime *pTime = (StreamTime*)m_cVarTime.get();
232 VarBoolImpl *pVarPlaying = (VarBoolImpl*)m_cVarPlaying.get();
233 VarBoolImpl *pVarStopped = (VarBoolImpl*)m_cVarStopped.get();
234 VarBoolImpl *pVarPaused = (VarBoolImpl*)m_cVarPaused.get();
235 VarBoolImpl *pVarSeekable = (VarBoolImpl*)m_cVarSeekable.get();
236 VarBoolImpl *pVarRandom = (VarBoolImpl*)m_cVarRandom.get();
237 VarBoolImpl *pVarLoop = (VarBoolImpl*)m_cVarLoop.get();
238 VarBoolImpl *pVarRepeat = (VarBoolImpl*)m_cVarRepeat.get();
239 VarBoolImpl *pVarDvdActive = (VarBoolImpl*)m_cVarDvdActive.get();
240 VarBoolImpl *pVarFullscreen = (VarBoolImpl*)m_cVarFullscreen.get();
241 VarBoolImpl *pVarHasVout = (VarBoolImpl*)m_cVarHasVout.get();
243 // Refresh audio variables
247 if( getIntf()->p_sys->p_input == NULL )
249 getIntf()->p_sys->p_input = getIntf()->p_sys->p_playlist->p_input;
250 if( getIntf()->p_sys->p_input )
251 vlc_object_yield( getIntf()->p_sys->p_input );
253 else if( getIntf()->p_sys->p_input->b_dead )
255 vlc_object_release( getIntf()->p_sys->p_input );
256 getIntf()->p_sys->p_input = NULL;
259 input_thread_t *pInput = getIntf()->p_sys->p_input;
261 if( pInput && !pInput->b_die )
263 // Refresh time variables
265 var_Get( pInput, "position", &pos );
266 pTime->set( pos.f_float, false );
268 // Get the status of the playlist
269 playlist_status_t status =
270 getIntf()->p_sys->p_playlist->status.i_status;
272 pVarPlaying->set( status == PLAYLIST_RUNNING );
273 pVarStopped->set( status == PLAYLIST_STOPPED );
274 pVarPaused->set( status == PLAYLIST_PAUSED );
276 pVarSeekable->set( pos.f_float != 0.0 );
278 // Refresh DVD detection
279 vlc_value_t chapters_count;
280 var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT,
281 &chapters_count, NULL );
282 pVarDvdActive->set( chapters_count.i_int > 0 );
284 // Refresh fullscreen status
285 vout_thread_t *pVout = (vout_thread_t *)vlc_object_find( pInput,
286 VLC_OBJECT_VOUT, FIND_CHILD );
287 pVarHasVout->set( pVout != NULL );
290 pVarFullscreen->set( pVout->b_fullscreen );
291 vlc_object_release( pVout );
296 pVarPlaying->set( false );
297 pVarPaused->set( false );
298 pVarStopped->set( true );
299 pVarSeekable->set( false );
300 pVarDvdActive->set( false );
301 pTime->set( 0, false );
302 pVarFullscreen->set( false );
303 pVarHasVout->set( false );
306 // Refresh the random variable
308 var_Get( getIntf()->p_sys->p_playlist, "random", &val );
309 pVarRandom->set( val.b_bool != 0 );
311 // Refresh the loop variable
312 var_Get( getIntf()->p_sys->p_playlist, "loop", &val );
313 pVarLoop->set( val.b_bool != 0 );
315 // Refresh the repeat variable
316 var_Get( getIntf()->p_sys->p_playlist, "repeat", &val );
317 pVarRepeat->set( val.b_bool != 0 );
323 void VlcProc::CmdManage::execute()
325 // Just forward to VlcProc
330 void VlcProc::refreshAudio()
332 char *pFilters = NULL;
334 // Check if the audio output has changed
335 aout_instance_t *pAout = (aout_instance_t *)vlc_object_find( getIntf(),
336 VLC_OBJECT_AOUT, FIND_ANYWHERE );
339 if( pAout != m_pAout )
341 // Register the equalizer callbacks
342 if( !var_AddCallback( pAout, "equalizer-bands",
343 onEqBandsChange, this ) &&
344 !var_AddCallback( pAout, "equalizer-preamp",
345 onEqPreampChange, this ) )
348 //char * psz_bands = var_GetString( p_aout, "equalizer-bands" );
351 // Get the audio filters
352 pFilters = var_GetString( pAout, "audio-filter" );
353 vlc_object_release( pAout );
357 // Get the audio filters
358 pFilters = config_GetPsz( getIntf(), "audio-filter" );
361 // Refresh sound volume
362 audio_volume_t volume;
363 aout_VolumeGet( getIntf(), &volume );
364 Volume *pVolume = (Volume*)m_cVarVolume.get();
365 pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX );
367 // Set the mute variable
368 VarBoolImpl *pVarMute = (VarBoolImpl*)m_cVarMute.get();
369 pVarMute->set( volume == 0 );
371 // Refresh the equalizer variable
372 VarBoolImpl *pVarEqualizer = (VarBoolImpl*)m_cVarEqualizer.get();
373 pVarEqualizer->set( pFilters && strstr( pFilters, "equalizer" ) );
377 int VlcProc::onIntfChange( vlc_object_t *pObj, const char *pVariable,
378 vlc_value_t oldVal, vlc_value_t newVal,
381 VlcProc *pThis = (VlcProc*)pParam;
383 // Update the stream variable
384 playlist_t *p_playlist = (playlist_t*)pObj;
385 pThis->updateStreamName(p_playlist);
387 // Create a playlist notify command (for old style playlist)
388 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
389 // Create a playtree notify command (for new style playtree)
390 CmdPlaytreeChanged *pCmdTree = new CmdPlaytreeChanged( pThis->getIntf() );
392 // Push the command in the asynchronous command queue
393 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
394 pQueue->push( CmdGenericPtr( pCmd ) );
395 pQueue->push( CmdGenericPtr( pCmdTree ) );
401 int VlcProc::onIntfShow( vlc_object_t *pObj, const char *pVariable,
402 vlc_value_t oldVal, vlc_value_t newVal,
407 VlcProc *pThis = (VlcProc*)pParam;
409 // Create a raise all command
410 CmdRaiseAll *pCmd = new CmdRaiseAll( pThis->getIntf(),
411 pThis->getIntf()->p_sys->p_theme->getWindowManager() );
413 // Push the command in the asynchronous command queue
414 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
415 pQueue->push( CmdGenericPtr( pCmd ) );
422 int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
423 vlc_value_t oldVal, vlc_value_t newVal,
426 VlcProc *pThis = (VlcProc*)pParam;
428 // Update the stream variable
429 playlist_t *p_playlist = (playlist_t*)pObj;
430 pThis->updateStreamName(p_playlist);
432 // Create a playlist notify command
433 // TODO: selective update
434 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
435 // Create a playtree notify command
436 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
439 // Push the command in the asynchronous command queue
440 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
441 pQueue->push( CmdGenericPtr( pCmd ) );
442 pQueue->push( CmdGenericPtr( pCmdTree ), true );
447 int VlcProc::onItemAppend( vlc_object_t *pObj, const char *pVariable,
448 vlc_value_t oldVal, vlc_value_t newVal,
451 VlcProc *pThis = (VlcProc*)pParam;
453 playlist_add_t *p_add = (playlist_add_t*)malloc( sizeof(
456 memcpy( p_add, newVal.p_address, sizeof( playlist_add_t ) ) ;
458 CmdGenericPtr ptrTree;
459 CmdPlaytreeAppend *pCmdTree = new CmdPlaytreeAppend( pThis->getIntf(),
461 ptrTree = CmdGenericPtr( pCmdTree );
463 // Create a playlist notify command (for old style playlist)
464 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
466 // Push the command in the asynchronous command queue
467 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
468 pQueue->push( CmdGenericPtr( pCmd ) );
469 pQueue->push( ptrTree , false );
474 int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
475 vlc_value_t oldVal, vlc_value_t newVal,
478 VlcProc *pThis = (VlcProc*)pParam;
480 int i_id = newVal.i_int;
482 CmdGenericPtr ptrTree;
483 CmdPlaytreeDelete *pCmdTree = new CmdPlaytreeDelete( pThis->getIntf(),
485 ptrTree = CmdGenericPtr( pCmdTree );
487 // Create a playlist notify command (for old style playlist)
488 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
490 // Push the command in the asynchronous command queue
491 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
492 pQueue->push( CmdGenericPtr( pCmd ) );
493 pQueue->push( ptrTree , false );
501 int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
502 vlc_value_t oldVal, vlc_value_t newVal,
505 VlcProc *pThis = (VlcProc*)pParam;
507 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
509 // Update the stream variable
510 playlist_t *p_playlist = (playlist_t*)pObj;
511 pThis->updateStreamName(p_playlist);
513 // Create a playlist notify command (old style playlist)
514 // TODO: selective update
515 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
516 pQueue->push( CmdGenericPtr( pCmd ) );
517 // Create two playtree notify commands: one for old item, one for new
518 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
520 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
521 pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), newVal.i_int );
522 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
528 int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
529 vlc_value_t oldVal, vlc_value_t newVal,
532 VlcProc *pThis = (VlcProc*)pParam;
534 // Create a playlist notify command
535 CmdChangeSkin *pCmd =
536 new CmdChangeSkin( pThis->getIntf(), newVal.psz_string );
538 // Push the command in the asynchronous command queue
539 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
540 pQueue->push( CmdGenericPtr( pCmd ) );
545 int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
546 vlc_value_t oldVal, vlc_value_t newVal,
549 VlcProc *pThis = (VlcProc*)pParam;
550 interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);
552 CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
553 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
554 pQueue->push( CmdGenericPtr( pCmd ) );
559 void VlcProc::updateStreamName( playlist_t *p_playlist )
561 if( p_playlist->p_input )
563 VarText &rStreamName = getStreamNameVar();
564 VarText &rStreamURI = getStreamURIVar();
565 // XXX: we should not need to access p_input->psz_source directly, a
566 // getter should be provided by VLC core
567 string name = p_playlist->p_input->input.p_item->psz_name;
568 // XXX: This should be done in VLC core, not here...
569 // Remove path information if any
570 OSFactory *pFactory = OSFactory::instance( getIntf() );
571 string::size_type pos = name.rfind( pFactory->getDirSeparator() );
572 if( pos != string::npos )
574 name = name.substr( pos + 1, name.size() - pos + 1 );
576 UString srcName( getIntf(), name.c_str() );
577 UString srcURI( getIntf(),
578 p_playlist->p_input->input.p_item->psz_uri );
580 // Create commands to update the stream variables
581 CmdSetText *pCmd1 = new CmdSetText( getIntf(), rStreamName, srcName );
582 CmdSetText *pCmd2 = new CmdSetText( getIntf(), rStreamURI, srcURI );
583 // Push the commands in the asynchronous command queue
584 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
585 pQueue->push( CmdGenericPtr( pCmd1 ), false );
586 pQueue->push( CmdGenericPtr( pCmd2 ), false );
591 void *VlcProc::getWindow( intf_thread_t *pIntf, vout_thread_t *pVout,
592 int *pXHint, int *pYHint,
593 unsigned int *pWidthHint,
594 unsigned int *pHeightHint )
596 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
597 pThis->m_pVout = pVout;
598 if( pThis->m_handleSet.empty() )
604 // Get the window handle
605 void *pWindow = *pThis->m_handleSet.begin();
606 // Post a resize vout command
607 CmdResizeVout *pCmd = new CmdResizeVout( pThis->getIntf(), pWindow,
608 *pWidthHint, *pHeightHint );
609 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
610 pQueue->push( CmdGenericPtr( pCmd ) );
616 void VlcProc::releaseWindow( intf_thread_t *pIntf, void *pWindow )
618 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
619 pThis->m_pVout = NULL;
623 int VlcProc::controlWindow( intf_thread_t *pIntf, void *pWindow,
624 int query, va_list args )
626 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
634 unsigned int i_width = va_arg( args, unsigned int );
635 unsigned int i_height = va_arg( args, unsigned int );
636 if( !i_width ) i_width = pThis->m_pVout->i_window_width;
637 if( !i_height ) i_height = pThis->m_pVout->i_window_height;
639 // Post a resize vout command
640 CmdResizeVout *pCmd =
641 new CmdResizeVout( pThis->getIntf(), pWindow,
643 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
644 pQueue->push( CmdGenericPtr( pCmd ) );
649 msg_Dbg( pIntf, "control query not supported" );
657 int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
658 vlc_value_t oldVal, vlc_value_t newVal,
661 VlcProc *pThis = (VlcProc*)pParam;
663 // Post a set equalizer bands command
664 CmdSetEqBands *pCmd = new CmdSetEqBands( pThis->getIntf(),
667 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
668 pQueue->push( CmdGenericPtr( pCmd ) );
674 int VlcProc::onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
675 vlc_value_t oldVal, vlc_value_t newVal,
678 VlcProc *pThis = (VlcProc*)pParam;
679 EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)(pThis->m_cVarEqPreamp.get());
681 // Post a set preamp command
682 CmdSetEqPreamp *pCmd = new CmdSetEqPreamp( pThis->getIntf(), *pVarPreamp,
683 (newVal.f_float + 20.0) / 40.0 );
684 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
685 pQueue->push( CmdGenericPtr( pCmd ) );