1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 the VideoLAN team
7 * Authors: Cyril Deguet <asmax@via.ecp.fr>
8 * Olivier Teulière <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 *****************************************************************************/
29 #include <vlc_common.h>
32 #include <vlc_playlist.h>
33 #include <vlc_window.h>
35 #include "vlcproc.hpp"
36 #include "os_factory.hpp"
37 #include "os_timer.hpp"
38 #include "var_manager.hpp"
40 #include "window_manager.hpp"
41 #include "../commands/async_queue.hpp"
42 #include "../commands/cmd_change_skin.hpp"
43 #include "../commands/cmd_show_window.hpp"
44 #include "../commands/cmd_quit.hpp"
45 #include "../commands/cmd_resize.hpp"
46 #include "../commands/cmd_vars.hpp"
47 #include "../commands/cmd_dialogs.hpp"
48 #include "../utils/var_bool.hpp"
52 VlcProc *VlcProc::instance( intf_thread_t *pIntf )
54 if( pIntf->p_sys->p_vlcProc == NULL )
56 pIntf->p_sys->p_vlcProc = new VlcProc( pIntf );
59 return pIntf->p_sys->p_vlcProc;
63 void VlcProc::destroy( intf_thread_t *pIntf )
65 if( pIntf->p_sys->p_vlcProc )
67 delete pIntf->p_sys->p_vlcProc;
68 pIntf->p_sys->p_vlcProc = NULL;
73 VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
74 m_varVoutSize( pIntf ), m_varEqBands( pIntf ),
75 m_pVout( NULL ), m_pAout( NULL ), m_cmdManage( this )
77 // Create a timer to poll the status of the vlc
78 OSFactory *pOsFactory = OSFactory::instance( pIntf );
79 m_pTimer = pOsFactory->createOSTimer( m_cmdManage );
80 m_pTimer->start( 100, false );
82 // Create and register VLC variables
83 VarManager *pVarManager = VarManager::instance( getIntf() );
85 #define REGISTER_VAR( var, type, name ) \
86 var = VariablePtr( new type( getIntf() ) ); \
87 pVarManager->registerVar( var, name );
88 REGISTER_VAR( m_cVarRandom, VarBoolImpl, "playlist.isRandom" )
89 REGISTER_VAR( m_cVarLoop, VarBoolImpl, "playlist.isLoop" )
90 REGISTER_VAR( m_cVarRepeat, VarBoolImpl, "playlist.isRepeat" )
91 REGISTER_VAR( m_cPlaytree, Playtree, "playtree" )
92 pVarManager->registerVar( getPlaytreeVar().getPositionVarPtr(),
94 pVarManager->registerVar( m_cVarRandom, "playtree.isRandom" );
95 pVarManager->registerVar( m_cVarLoop, "playtree.isLoop" );
97 REGISTER_VAR( m_cVarPlaying, VarBoolImpl, "vlc.isPlaying" )
98 REGISTER_VAR( m_cVarStopped, VarBoolImpl, "vlc.isStopped" )
99 REGISTER_VAR( m_cVarPaused, VarBoolImpl, "vlc.isPaused" )
101 /* Input variables */
102 pVarManager->registerVar( m_cVarRepeat, "playtree.isRepeat" );
103 REGISTER_VAR( m_cVarTime, StreamTime, "time" )
104 REGISTER_VAR( m_cVarSeekable, VarBoolImpl, "vlc.isSeekable" )
105 REGISTER_VAR( m_cVarDvdActive, VarBoolImpl, "dvd.isActive" )
108 REGISTER_VAR( m_cVarFullscreen, VarBoolImpl, "vlc.isFullscreen" )
109 REGISTER_VAR( m_cVarHasVout, VarBoolImpl, "vlc.hasVout" )
112 REGISTER_VAR( m_cVarHasAudio, VarBoolImpl, "vlc.hasAudio" )
113 REGISTER_VAR( m_cVarVolume, Volume, "volume" )
114 REGISTER_VAR( m_cVarMute, VarBoolImpl, "vlc.isMute" )
115 REGISTER_VAR( m_cVarEqualizer, VarBoolImpl, "equalizer.isEnabled" )
116 REGISTER_VAR( m_cVarEqPreamp, EqualizerPreamp, "equalizer.preamp" )
119 m_cVarStreamName = VariablePtr( new VarText( getIntf(), false ) );
120 pVarManager->registerVar( m_cVarStreamName, "streamName" );
121 m_cVarStreamURI = VariablePtr( new VarText( getIntf(), false ) );
122 pVarManager->registerVar( m_cVarStreamURI, "streamURI" );
123 m_cVarStreamBitRate = VariablePtr( new VarText( getIntf(), false ) );
124 pVarManager->registerVar( m_cVarStreamBitRate, "bitrate" );
125 m_cVarStreamSampleRate = VariablePtr( new VarText( getIntf(), false ) );
126 pVarManager->registerVar( m_cVarStreamSampleRate, "samplerate" );
128 // Register the equalizer bands
129 for( int i = 0; i < EqualizerBands::kNbBands; i++)
132 ss << "equalizer.band(" << i << ")";
133 pVarManager->registerVar( m_varEqBands.getBand( i ), ss.str() );
137 // The object variable callbacks are called from other VLC threads,
138 // so they must put commands in the queue and NOT do anything else
139 // (X11 calls are not reentrant)
141 // Called when the playlist changes
142 var_AddCallback( pIntf->p_sys->p_playlist, "intf-change",
143 onIntfChange, this );
144 // Called when a playlist item is added
145 var_AddCallback( pIntf->p_sys->p_playlist, "item-append",
146 onItemAppend, this );
147 // Called when a playlist item is deleted
148 // TODO: properly handle item-deleted
149 var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
150 onItemDelete, this );
151 // Called when the "interface shower" wants us to show the skin
152 var_AddCallback( pIntf->p_libvlc, "intf-show",
154 // Called when the current played item changes
155 var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
156 onPlaylistChange, this );
157 // Called when a playlist item changed
158 var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
159 onItemChange, this );
160 // Called when our skins2 demux wants us to load a new skin
161 var_AddCallback( pIntf, "skin-to-load", onSkinToLoad, this );
163 // Called when we have an interaction dialog to display
164 var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
165 var_AddCallback( pIntf, "interaction", onInteraction, this );
166 pIntf->b_interaction = true;
168 getIntf()->p_sys->p_input = NULL;
176 if( getIntf()->p_sys->p_input )
178 vlc_object_release( getIntf()->p_sys->p_input );
181 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
182 onIntfChange, this );
183 var_DelCallback( getIntf()->p_sys->p_playlist, "item-append",
184 onItemAppend, this );
185 var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
186 onItemDelete, this );
187 var_DelCallback( getIntf()->p_libvlc, "intf-show",
189 var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
190 onPlaylistChange, this );
191 var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
192 onItemChange, this );
193 var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
197 void VlcProc::registerVoutWindow( void *pVoutWindow )
199 m_handleSet.insert( pVoutWindow );
200 // Reparent the vout window
203 if( vout_Control( m_pVout, VOUT_REPARENT, 0 ) != VLC_SUCCESS )
204 vout_Control( m_pVout, VOUT_CLOSE );
209 void VlcProc::unregisterVoutWindow( void *pVoutWindow )
211 m_handleSet.erase( pVoutWindow );
215 void VlcProc::dropVout()
219 if( vout_Control( m_pVout, VOUT_REPARENT, 0 ) != VLC_SUCCESS )
220 vout_Control( m_pVout, VOUT_CLOSE );
226 void VlcProc::manage()
228 // Did the user request to quit vlc ?
229 if( !vlc_object_alive( getIntf() ) )
231 CmdQuit *pCmd = new CmdQuit( getIntf() );
232 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
233 pQueue->push( CmdGenericPtr( pCmd ) );
240 void VlcProc::CmdManage::execute()
242 // Just forward to VlcProc
246 void VlcProc::refreshAudio()
250 // Check if the audio output has changed
251 aout_instance_t *pAout = (aout_instance_t *)vlc_object_find( getIntf(),
252 VLC_OBJECT_AOUT, FIND_ANYWHERE );
255 if( pAout != m_pAout )
257 // Register the equalizer callbacks
258 if( !var_AddCallback( pAout, "equalizer-bands",
259 onEqBandsChange, this ) &&
260 !var_AddCallback( pAout, "equalizer-preamp",
261 onEqPreampChange, this ) )
264 //char * psz_bands = var_GetString( p_aout, "equalizer-bands" );
267 // Get the audio filters
268 pFilters = var_GetNonEmptyString( pAout, "audio-filter" );
269 vlc_object_release( pAout );
273 // Get the audio filters
274 pFilters = config_GetPsz( getIntf(), "audio-filter" );
277 // Refresh sound volume
278 audio_volume_t volume;
279 aout_VolumeGet( getIntf(), &volume );
280 Volume *pVolume = (Volume*)m_cVarVolume.get();
281 pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX );
283 // Set the mute variable
284 VarBoolImpl *pVarMute = (VarBoolImpl*)m_cVarMute.get();
285 pVarMute->set( volume == 0 );
287 // Refresh the equalizer variable
288 VarBoolImpl *pVarEqualizer = (VarBoolImpl*)m_cVarEqualizer.get();
289 pVarEqualizer->set( pFilters && strstr( pFilters, "equalizer" ) );
293 void VlcProc::refreshPlaylist()
295 // Refresh the random variable
296 VarBoolImpl *pVarRandom = (VarBoolImpl*)m_cVarRandom.get();
298 var_Get( getIntf()->p_sys->p_playlist, "random", &val );
299 pVarRandom->set( val.b_bool != 0 );
301 // Refresh the loop variable
302 VarBoolImpl *pVarLoop = (VarBoolImpl*)m_cVarLoop.get();
303 var_Get( getIntf()->p_sys->p_playlist, "loop", &val );
304 pVarLoop->set( val.b_bool != 0 );
306 // Refresh the repeat variable
307 VarBoolImpl *pVarRepeat = (VarBoolImpl*)m_cVarRepeat.get();
308 var_Get( getIntf()->p_sys->p_playlist, "repeat", &val );
309 pVarRepeat->set( val.b_bool != 0 );
312 void VlcProc::refreshInput()
314 StreamTime *pTime = (StreamTime*)m_cVarTime.get();
315 VarBoolImpl *pVarSeekable = (VarBoolImpl*)m_cVarSeekable.get();
316 VarBoolImpl *pVarDvdActive = (VarBoolImpl*)m_cVarDvdActive.get();
317 VarBoolImpl *pVarHasVout = (VarBoolImpl*)m_cVarHasVout.get();
318 VarBoolImpl *pVarHasAudio = (VarBoolImpl*)m_cVarHasAudio.get();
319 VarText *pBitrate = (VarText*)m_cVarStreamBitRate.get();
320 VarText *pSampleRate = (VarText*)m_cVarStreamSampleRate.get();
321 VarBoolImpl *pVarFullscreen = (VarBoolImpl*)m_cVarFullscreen.get();
322 VarBoolImpl *pVarPlaying = (VarBoolImpl*)m_cVarPlaying.get();
323 VarBoolImpl *pVarStopped = (VarBoolImpl*)m_cVarStopped.get();
324 VarBoolImpl *pVarPaused = (VarBoolImpl*)m_cVarPaused.get();
326 input_thread_t *pInput = getIntf()->p_sys->p_input;
329 if( getIntf()->p_sys->p_input == NULL )
331 getIntf()->p_sys->p_input =
332 playlist_CurrentInput( getIntf()->p_sys->p_playlist );
333 if( getIntf()->p_sys->p_input )
334 vlc_object_hold( getIntf()->p_sys->p_input );
336 else if( getIntf()->p_sys->p_input->b_dead )
338 vlc_object_release( getIntf()->p_sys->p_input );
339 getIntf()->p_sys->p_input = NULL;
343 if( pInput && vlc_object_alive (pInput) )
345 // Refresh time variables
347 var_Get( pInput, "position", &pos );
348 pTime->set( pos.f_float, false );
349 pVarSeekable->set( pos.f_float != 0.0 );
351 // Refresh DVD detection
352 vlc_value_t chapters_count;
353 var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT,
354 &chapters_count, NULL );
355 pVarDvdActive->set( chapters_count.i_int > 0 );
357 // Get the input bitrate
358 int bitrate = var_GetInteger( pInput, "bit-rate" ) / 1000;
359 pBitrate->set( UString::fromInt( getIntf(), bitrate ) );
361 // Get the audio sample rate
362 int sampleRate = var_GetInteger( pInput, "sample-rate" ) / 1000;
363 pSampleRate->set( UString::fromInt( getIntf(), sampleRate ) );
366 vlc_value_t audio_es;
367 var_Change( pInput, "audio-es", VLC_VAR_CHOICESCOUNT,
369 pVarHasAudio->set( audio_es.i_int > 0 );
371 // Refresh fullscreen status
372 vout_thread_t *pVout = (vout_thread_t *)vlc_object_find( pInput,
373 VLC_OBJECT_VOUT, FIND_CHILD );
374 pVarHasVout->set( pVout != NULL );
377 pVarFullscreen->set( pVout->b_fullscreen );
378 vlc_object_release( pVout );
381 // Refresh play/pause status
382 int state = var_GetInteger( pInput, "state" );
383 pVarStopped->set( false );
384 pVarPlaying->set( state != PAUSE_S );
385 pVarPaused->set( state == PAUSE_S );
389 pVarSeekable->set( false );
390 pVarDvdActive->set( false );
391 pTime->set( 0, false );
392 pVarFullscreen->set( false );
393 pVarHasAudio->set( false );
394 pVarHasVout->set( false );
395 pVarStopped->set( true );
396 pVarPlaying->set( false );
397 pVarPaused->set( false );
401 int VlcProc::onIntfChange( vlc_object_t *pObj, const char *pVariable,
402 vlc_value_t oldVal, vlc_value_t newVal,
405 VlcProc *pThis = (VlcProc*)pParam;
407 // Update the stream variable
408 playlist_t *p_playlist = (playlist_t*)pObj;
409 pThis->updateStreamName(p_playlist);
411 // Create a playtree notify command (for new style playtree)
412 CmdPlaytreeChanged *pCmdTree = new CmdPlaytreeChanged( pThis->getIntf() );
414 // Push the command in the asynchronous command queue
415 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
416 pQueue->push( CmdGenericPtr( pCmdTree ) );
422 int VlcProc::onIntfShow( vlc_object_t *pObj, const char *pVariable,
423 vlc_value_t oldVal, vlc_value_t newVal,
428 VlcProc *pThis = (VlcProc*)pParam;
430 // Create a raise all command
431 CmdRaiseAll *pCmd = new CmdRaiseAll( pThis->getIntf(),
432 pThis->getIntf()->p_sys->p_theme->getWindowManager() );
434 // Push the command in the asynchronous command queue
435 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
436 pQueue->push( CmdGenericPtr( pCmd ) );
443 int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
444 vlc_value_t oldVal, vlc_value_t newVal,
447 VlcProc *pThis = (VlcProc*)pParam;
449 // Update the stream variable
450 playlist_t *p_playlist = (playlist_t*)pObj;
451 pThis->updateStreamName(p_playlist);
453 // Create a playtree notify command
454 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
457 // Push the command in the asynchronous command queue
458 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
459 pQueue->push( CmdGenericPtr( pCmdTree ), true );
464 int VlcProc::onItemAppend( vlc_object_t *pObj, const char *pVariable,
465 vlc_value_t oldVal, vlc_value_t newVal,
468 VlcProc *pThis = (VlcProc*)pParam;
470 playlist_add_t *p_add = (playlist_add_t*)malloc( sizeof(
473 memcpy( p_add, newVal.p_address, sizeof( playlist_add_t ) ) ;
475 CmdGenericPtr ptrTree;
476 CmdPlaytreeAppend *pCmdTree = new CmdPlaytreeAppend( pThis->getIntf(),
478 ptrTree = CmdGenericPtr( pCmdTree );
480 // Push the command in the asynchronous command queue
481 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
482 pQueue->push( ptrTree , false );
487 int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
488 vlc_value_t oldVal, vlc_value_t newVal,
491 VlcProc *pThis = (VlcProc*)pParam;
493 int i_id = newVal.i_int;
495 CmdGenericPtr ptrTree;
496 CmdPlaytreeDelete *pCmdTree = new CmdPlaytreeDelete( pThis->getIntf(),
498 ptrTree = CmdGenericPtr( pCmdTree );
500 // Push the command in the asynchronous command queue
501 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
502 pQueue->push( ptrTree , false );
508 int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
509 vlc_value_t oldVal, vlc_value_t newVal,
512 VlcProc *pThis = (VlcProc*)pParam;
514 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
516 // Update the stream variable
517 playlist_t *p_playlist = (playlist_t*)pObj;
518 pThis->updateStreamName(p_playlist);
520 // Create two playtree notify commands: one for old item, one for new
521 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
523 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
524 pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), newVal.i_int );
525 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
531 int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
532 vlc_value_t oldVal, vlc_value_t newVal,
535 VlcProc *pThis = (VlcProc*)pParam;
537 // Create a playlist notify command
538 CmdChangeSkin *pCmd =
539 new CmdChangeSkin( pThis->getIntf(), newVal.psz_string );
541 // Push the command in the asynchronous command queue
542 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
543 pQueue->push( CmdGenericPtr( pCmd ) );
548 int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
549 vlc_value_t oldVal, vlc_value_t newVal,
552 VlcProc *pThis = (VlcProc*)pParam;
553 interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);
555 CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
556 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
557 pQueue->push( CmdGenericPtr( pCmd ) );
562 void VlcProc::updateStreamName( playlist_t *p_playlist )
564 if( p_playlist && playlist_CurrentInput( p_playlist ))
566 // Get playlist item information
567 input_item_t *pItem = input_GetItem(playlist_CurrentInput( p_playlist));
569 VarText &rStreamName = getStreamNameVar();
570 VarText &rStreamURI = getStreamURIVar();
571 // XXX: we should not need to access p_input->psz_source directly, a
572 // getter should be provided by VLC core
573 string name = pItem->psz_name;
574 // XXX: This should be done in VLC core, not here...
575 // Remove path information if any
576 OSFactory *pFactory = OSFactory::instance( getIntf() );
577 string::size_type pos = name.rfind( pFactory->getDirSeparator() );
578 if( pos != string::npos )
580 name = name.substr( pos + 1, name.size() - pos + 1 );
582 UString srcName( getIntf(), name.c_str() );
583 UString srcURI( getIntf(), pItem->psz_uri );
585 // Create commands to update the stream variables
586 CmdSetText *pCmd1 = new CmdSetText( getIntf(), rStreamName, srcName );
587 CmdSetText *pCmd2 = new CmdSetText( getIntf(), rStreamURI, srcURI );
588 // Push the commands in the asynchronous command queue
589 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
590 pQueue->push( CmdGenericPtr( pCmd1 ), false );
591 pQueue->push( CmdGenericPtr( pCmd2 ), false );
596 void *VlcProc::getWindow( intf_thread_t *pIntf, vout_thread_t *pVout,
597 int *pXHint, int *pYHint,
598 unsigned int *pWidthHint,
599 unsigned int *pHeightHint )
601 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
602 if( pThis->m_handleSet.empty() )
608 pThis->m_pVout = pVout;
609 // Get the window handle
610 void *pWindow = *pThis->m_handleSet.begin();
611 // Post a resize vout command
612 CmdResizeVout *pCmd = new CmdResizeVout( pThis->getIntf(), pWindow,
613 *pWidthHint, *pHeightHint );
614 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
615 pQueue->push( CmdGenericPtr( pCmd ) );
621 void VlcProc::releaseWindow( intf_thread_t *pIntf, void *pWindow )
623 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
624 pThis->m_pVout = NULL;
628 int VlcProc::controlWindow( struct vout_window_t *pWnd,
629 int query, va_list args )
631 intf_thread_t *pIntf = (intf_thread_t *)pWnd->p_private;
632 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
640 unsigned int i_width = va_arg( args, unsigned int );
641 unsigned int i_height = va_arg( args, unsigned int );
642 if( !i_width ) i_width = pThis->m_pVout->i_window_width;
643 if( !i_height ) i_height = pThis->m_pVout->i_window_height;
645 // Post a resize vout command
646 CmdResizeVout *pCmd =
647 new CmdResizeVout( pThis->getIntf(), pWnd->handle,
649 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
650 pQueue->push( CmdGenericPtr( pCmd ) );
655 msg_Dbg( pWnd, "control query not supported" );
663 int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
664 vlc_value_t oldVal, vlc_value_t newVal,
667 VlcProc *pThis = (VlcProc*)pParam;
669 // Post a set equalizer bands command
670 CmdSetEqBands *pCmd = new CmdSetEqBands( pThis->getIntf(),
673 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
674 pQueue->push( CmdGenericPtr( pCmd ) );
680 int VlcProc::onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
681 vlc_value_t oldVal, vlc_value_t newVal,
684 VlcProc *pThis = (VlcProc*)pParam;
685 EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)(pThis->m_cVarEqPreamp.get());
687 // Post a set preamp command
688 CmdSetEqPreamp *pCmd = new CmdSetEqPreamp( pThis->getIntf(), *pVarPreamp,
689 (newVal.f_float + 20.0) / 40.0 );
690 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
691 pQueue->push( CmdGenericPtr( pCmd ) );