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 = getIntf()->p_sys->p_playlist->p_input;
332 if( getIntf()->p_sys->p_input )
333 vlc_object_yield( getIntf()->p_sys->p_input );
335 else if( getIntf()->p_sys->p_input->b_dead )
337 vlc_object_release( getIntf()->p_sys->p_input );
338 getIntf()->p_sys->p_input = NULL;
342 if( pInput && vlc_object_alive (pInput) )
344 // Refresh time variables
346 var_Get( pInput, "position", &pos );
347 pTime->set( pos.f_float, false );
348 pVarSeekable->set( pos.f_float != 0.0 );
350 // Refresh DVD detection
351 vlc_value_t chapters_count;
352 var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT,
353 &chapters_count, NULL );
354 pVarDvdActive->set( chapters_count.i_int > 0 );
356 // Get the input bitrate
357 int bitrate = var_GetInteger( pInput, "bit-rate" ) / 1000;
358 pBitrate->set( UString::fromInt( getIntf(), bitrate ) );
360 // Get the audio sample rate
361 int sampleRate = var_GetInteger( pInput, "sample-rate" ) / 1000;
362 pSampleRate->set( UString::fromInt( getIntf(), sampleRate ) );
365 vlc_value_t audio_es;
366 var_Change( pInput, "audio-es", VLC_VAR_CHOICESCOUNT,
368 pVarHasAudio->set( audio_es.i_int > 0 );
370 // Refresh fullscreen status
371 vout_thread_t *pVout = (vout_thread_t *)vlc_object_find( pInput,
372 VLC_OBJECT_VOUT, FIND_CHILD );
373 pVarHasVout->set( pVout != NULL );
376 pVarFullscreen->set( pVout->b_fullscreen );
377 vlc_object_release( pVout );
380 // Refresh play/pause status
381 int state = var_GetInteger( pInput, "state" );
382 pVarStopped->set( false );
383 pVarPlaying->set( state != PAUSE_S );
384 pVarPaused->set( state == PAUSE_S );
388 pVarSeekable->set( false );
389 pVarDvdActive->set( false );
390 pTime->set( 0, false );
391 pVarFullscreen->set( false );
392 pVarHasAudio->set( false );
393 pVarHasVout->set( false );
394 pVarStopped->set( true );
395 pVarPlaying->set( false );
396 pVarPaused->set( false );
400 int VlcProc::onIntfChange( vlc_object_t *pObj, const char *pVariable,
401 vlc_value_t oldVal, vlc_value_t newVal,
404 VlcProc *pThis = (VlcProc*)pParam;
406 // Update the stream variable
407 playlist_t *p_playlist = (playlist_t*)pObj;
408 pThis->updateStreamName(p_playlist);
410 // Create a playtree notify command (for new style playtree)
411 CmdPlaytreeChanged *pCmdTree = new CmdPlaytreeChanged( pThis->getIntf() );
413 // Push the command in the asynchronous command queue
414 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
415 pQueue->push( CmdGenericPtr( pCmdTree ) );
421 int VlcProc::onIntfShow( vlc_object_t *pObj, const char *pVariable,
422 vlc_value_t oldVal, vlc_value_t newVal,
427 VlcProc *pThis = (VlcProc*)pParam;
429 // Create a raise all command
430 CmdRaiseAll *pCmd = new CmdRaiseAll( pThis->getIntf(),
431 pThis->getIntf()->p_sys->p_theme->getWindowManager() );
433 // Push the command in the asynchronous command queue
434 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
435 pQueue->push( CmdGenericPtr( pCmd ) );
442 int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
443 vlc_value_t oldVal, vlc_value_t newVal,
446 VlcProc *pThis = (VlcProc*)pParam;
448 // Update the stream variable
449 playlist_t *p_playlist = (playlist_t*)pObj;
450 pThis->updateStreamName(p_playlist);
452 // Create a playtree notify command
453 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
456 // Push the command in the asynchronous command queue
457 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
458 pQueue->push( CmdGenericPtr( pCmdTree ), true );
463 int VlcProc::onItemAppend( vlc_object_t *pObj, const char *pVariable,
464 vlc_value_t oldVal, vlc_value_t newVal,
467 VlcProc *pThis = (VlcProc*)pParam;
469 playlist_add_t *p_add = (playlist_add_t*)malloc( sizeof(
472 memcpy( p_add, newVal.p_address, sizeof( playlist_add_t ) ) ;
474 CmdGenericPtr ptrTree;
475 CmdPlaytreeAppend *pCmdTree = new CmdPlaytreeAppend( pThis->getIntf(),
477 ptrTree = CmdGenericPtr( pCmdTree );
479 // Push the command in the asynchronous command queue
480 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
481 pQueue->push( ptrTree , false );
486 int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
487 vlc_value_t oldVal, vlc_value_t newVal,
490 VlcProc *pThis = (VlcProc*)pParam;
492 int i_id = newVal.i_int;
494 CmdGenericPtr ptrTree;
495 CmdPlaytreeDelete *pCmdTree = new CmdPlaytreeDelete( pThis->getIntf(),
497 ptrTree = CmdGenericPtr( pCmdTree );
499 // Push the command in the asynchronous command queue
500 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
501 pQueue->push( ptrTree , false );
507 int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
508 vlc_value_t oldVal, vlc_value_t newVal,
511 VlcProc *pThis = (VlcProc*)pParam;
513 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
515 // Update the stream variable
516 playlist_t *p_playlist = (playlist_t*)pObj;
517 pThis->updateStreamName(p_playlist);
519 // Create two playtree notify commands: one for old item, one for new
520 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
522 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
523 pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), newVal.i_int );
524 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
530 int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
531 vlc_value_t oldVal, vlc_value_t newVal,
534 VlcProc *pThis = (VlcProc*)pParam;
536 // Create a playlist notify command
537 CmdChangeSkin *pCmd =
538 new CmdChangeSkin( pThis->getIntf(), newVal.psz_string );
540 // Push the command in the asynchronous command queue
541 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
542 pQueue->push( CmdGenericPtr( pCmd ) );
547 int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
548 vlc_value_t oldVal, vlc_value_t newVal,
551 VlcProc *pThis = (VlcProc*)pParam;
552 interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);
554 CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
555 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
556 pQueue->push( CmdGenericPtr( pCmd ) );
561 void VlcProc::updateStreamName( playlist_t *p_playlist )
563 if( p_playlist && p_playlist->p_input )
565 // Get playlist item information
566 input_item_t *pItem = input_GetItem(p_playlist->p_input);
568 VarText &rStreamName = getStreamNameVar();
569 VarText &rStreamURI = getStreamURIVar();
570 // XXX: we should not need to access p_input->psz_source directly, a
571 // getter should be provided by VLC core
572 string name = pItem->psz_name;
573 // XXX: This should be done in VLC core, not here...
574 // Remove path information if any
575 OSFactory *pFactory = OSFactory::instance( getIntf() );
576 string::size_type pos = name.rfind( pFactory->getDirSeparator() );
577 if( pos != string::npos )
579 name = name.substr( pos + 1, name.size() - pos + 1 );
581 UString srcName( getIntf(), name.c_str() );
582 UString srcURI( getIntf(), pItem->psz_uri );
584 // Create commands to update the stream variables
585 CmdSetText *pCmd1 = new CmdSetText( getIntf(), rStreamName, srcName );
586 CmdSetText *pCmd2 = new CmdSetText( getIntf(), rStreamURI, srcURI );
587 // Push the commands in the asynchronous command queue
588 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
589 pQueue->push( CmdGenericPtr( pCmd1 ), false );
590 pQueue->push( CmdGenericPtr( pCmd2 ), false );
595 void *VlcProc::getWindow( intf_thread_t *pIntf, vout_thread_t *pVout,
596 int *pXHint, int *pYHint,
597 unsigned int *pWidthHint,
598 unsigned int *pHeightHint )
600 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
601 if( pThis->m_handleSet.empty() )
607 pThis->m_pVout = pVout;
608 // Get the window handle
609 void *pWindow = *pThis->m_handleSet.begin();
610 // Post a resize vout command
611 CmdResizeVout *pCmd = new CmdResizeVout( pThis->getIntf(), pWindow,
612 *pWidthHint, *pHeightHint );
613 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
614 pQueue->push( CmdGenericPtr( pCmd ) );
620 void VlcProc::releaseWindow( intf_thread_t *pIntf, void *pWindow )
622 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
623 pThis->m_pVout = NULL;
627 int VlcProc::controlWindow( struct vout_window_t *pWnd,
628 int query, va_list args )
630 intf_thread_t *pIntf = (intf_thread_t *)pWnd->p_private;
631 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
639 unsigned int i_width = va_arg( args, unsigned int );
640 unsigned int i_height = va_arg( args, unsigned int );
641 if( !i_width ) i_width = pThis->m_pVout->i_window_width;
642 if( !i_height ) i_height = pThis->m_pVout->i_window_height;
644 // Post a resize vout command
645 CmdResizeVout *pCmd =
646 new CmdResizeVout( pThis->getIntf(), pWnd->handle,
648 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
649 pQueue->push( CmdGenericPtr( pCmd ) );
654 msg_Dbg( pWnd, "control query not supported" );
662 int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
663 vlc_value_t oldVal, vlc_value_t newVal,
666 VlcProc *pThis = (VlcProc*)pParam;
668 // Post a set equalizer bands command
669 CmdSetEqBands *pCmd = new CmdSetEqBands( pThis->getIntf(),
672 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
673 pQueue->push( CmdGenericPtr( pCmd ) );
679 int VlcProc::onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
680 vlc_value_t oldVal, vlc_value_t newVal,
683 VlcProc *pThis = (VlcProc*)pParam;
684 EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)(pThis->m_cVarEqPreamp.get());
686 // Post a set preamp command
687 CmdSetEqPreamp *pCmd = new CmdSetEqPreamp( pThis->getIntf(), *pVarPreamp,
688 (newVal.f_float + 20.0) / 40.0 );
689 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
690 pQueue->push( CmdGenericPtr( pCmd ) );