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" )
106 m_cVarStreamName = VariablePtr( new VarText( getIntf(), false ) );
107 pVarManager->registerVar( m_cVarStreamName, "streamName" );
108 m_cVarStreamURI = VariablePtr( new VarText( getIntf(), false ) );
109 pVarManager->registerVar( m_cVarStreamURI, "streamURI" );
111 // Register the equalizer bands
112 for( int i = 0; i < EqualizerBands::kNbBands; i++)
115 ss << "equalizer.band(" << i << ")";
116 pVarManager->registerVar( m_varEqBands.getBand( i ), ss.str() );
120 // The object variable callbacks are called from other VLC threads,
121 // so they must put commands in the queue and NOT do anything else
122 // (X11 calls are not reentrant)
124 // Called when the playlist changes
125 var_AddCallback( pIntf->p_sys->p_playlist, "intf-change",
126 onIntfChange, this );
127 // Called when a playlist item is added
128 var_AddCallback( pIntf->p_sys->p_playlist, "item-append",
129 onItemAppend, this );
130 // Called when a playlist item is deleted
131 // TODO: properly handle item-deleted
132 var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
133 onItemDelete, this );
134 // Called when the "interface shower" wants us to show the skin
135 var_AddCallback( pIntf->p_sys->p_playlist, "intf-show",
137 // Called when the current played item changes
138 var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
139 onPlaylistChange, this );
140 // Called when a playlist item changed
141 var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
142 onItemChange, this );
143 // Called when our skins2 demux wants us to load a new skin
144 var_AddCallback( pIntf, "skin-to-load", onSkinToLoad, this );
146 // Called when we have an interaction dialog to display
147 var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
148 var_AddCallback( pIntf, "interaction", onInteraction, this );
149 pIntf->b_interaction = VLC_TRUE;
151 // Callbacks for vout requests
152 getIntf()->pf_request_window = &getWindow;
153 getIntf()->pf_release_window = &releaseWindow;
154 getIntf()->pf_control_window = &controlWindow;
156 getIntf()->p_sys->p_input = NULL;
164 if( getIntf()->p_sys->p_input )
166 vlc_object_release( getIntf()->p_sys->p_input );
169 // Callbacks for vout requests
170 getIntf()->pf_request_window = NULL;
171 getIntf()->pf_release_window = NULL;
172 getIntf()->pf_control_window = NULL;
174 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
175 onIntfChange, this );
176 var_DelCallback( getIntf()->p_sys->p_playlist, "item-append",
177 onItemAppend, this );
178 var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
179 onItemDelete, this );
180 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-show",
182 var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
183 onPlaylistChange, this );
184 var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
185 onItemChange, this );
186 var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
190 void VlcProc::registerVoutWindow( void *pVoutWindow )
192 m_handleSet.insert( pVoutWindow );
193 // Reparent the vout window
196 if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
197 vout_Control( m_pVout, VOUT_CLOSE );
202 void VlcProc::unregisterVoutWindow( void *pVoutWindow )
204 m_handleSet.erase( pVoutWindow );
208 void VlcProc::dropVout()
212 if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
213 vout_Control( m_pVout, VOUT_CLOSE );
219 void VlcProc::manage()
221 // Did the user requested to quit vlc ?
222 if( getIntf()->b_die || getIntf()->p_vlc->b_die )
224 CmdQuit *pCmd = new CmdQuit( getIntf() );
225 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
226 pQueue->push( CmdGenericPtr( pCmd ) );
229 // Get the VLC variables
230 StreamTime *pTime = (StreamTime*)m_cVarTime.get();
231 VarBoolImpl *pVarPlaying = (VarBoolImpl*)m_cVarPlaying.get();
232 VarBoolImpl *pVarStopped = (VarBoolImpl*)m_cVarStopped.get();
233 VarBoolImpl *pVarPaused = (VarBoolImpl*)m_cVarPaused.get();
234 VarBoolImpl *pVarSeekable = (VarBoolImpl*)m_cVarSeekable.get();
235 VarBoolImpl *pVarRandom = (VarBoolImpl*)m_cVarRandom.get();
236 VarBoolImpl *pVarLoop = (VarBoolImpl*)m_cVarLoop.get();
237 VarBoolImpl *pVarRepeat = (VarBoolImpl*)m_cVarRepeat.get();
238 VarBoolImpl *pVarDvdActive = (VarBoolImpl*)m_cVarDvdActive.get();
239 VarBoolImpl *pVarFullscreen = (VarBoolImpl*)m_cVarFullscreen.get();
241 // Refresh audio variables
245 if( getIntf()->p_sys->p_input == NULL )
247 getIntf()->p_sys->p_input = getIntf()->p_sys->p_playlist->p_input;
248 if( getIntf()->p_sys->p_input )
249 vlc_object_yield( getIntf()->p_sys->p_input );
251 else if( getIntf()->p_sys->p_input->b_dead )
253 vlc_object_release( getIntf()->p_sys->p_input );
254 getIntf()->p_sys->p_input = NULL;
257 input_thread_t *pInput = getIntf()->p_sys->p_input;
259 if( pInput && !pInput->b_die )
261 // Refresh time variables
263 var_Get( pInput, "position", &pos );
264 pTime->set( pos.f_float, false );
266 // Get the status of the playlist
267 playlist_status_t status =
268 getIntf()->p_sys->p_playlist->status.i_status;
270 pVarPlaying->set( status == PLAYLIST_RUNNING );
271 pVarStopped->set( status == PLAYLIST_STOPPED );
272 pVarPaused->set( status == PLAYLIST_PAUSED );
274 pVarSeekable->set( pos.f_float != 0.0 );
276 // Refresh DVD detection
277 vlc_value_t chapters_count;
278 var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT,
279 &chapters_count, NULL );
280 pVarDvdActive->set( chapters_count.i_int > 0 );
282 // Refresh fullscreen status
283 vout_thread_t *pVout = (vout_thread_t *)vlc_object_find( pInput,
284 VLC_OBJECT_VOUT, FIND_CHILD );
287 pVarFullscreen->set( pVout->b_fullscreen );
288 vlc_object_release( pVout );
293 pVarPlaying->set( false );
294 pVarPaused->set( false );
295 pVarStopped->set( true );
296 pVarSeekable->set( false );
297 pVarDvdActive->set( false );
298 pTime->set( 0, false );
299 pVarFullscreen->set( false );
302 // Refresh the random variable
304 var_Get( getIntf()->p_sys->p_playlist, "random", &val );
305 pVarRandom->set( val.b_bool != 0 );
307 // Refresh the loop variable
308 var_Get( getIntf()->p_sys->p_playlist, "loop", &val );
309 pVarLoop->set( val.b_bool != 0 );
311 // Refresh the repeat variable
312 var_Get( getIntf()->p_sys->p_playlist, "repeat", &val );
313 pVarRepeat->set( val.b_bool != 0 );
319 void VlcProc::CmdManage::execute()
321 // Just forward to VlcProc
326 void VlcProc::refreshAudio()
328 char *pFilters = NULL;
330 // Check if the audio output has changed
331 aout_instance_t *pAout = (aout_instance_t *)vlc_object_find( getIntf(),
332 VLC_OBJECT_AOUT, FIND_ANYWHERE );
335 if( pAout != m_pAout )
337 // Register the equalizer callbacks
338 if( !var_AddCallback( pAout, "equalizer-bands",
339 onEqBandsChange, this ) &&
340 !var_AddCallback( pAout, "equalizer-preamp",
341 onEqPreampChange, this ) )
344 //char * psz_bands = var_GetString( p_aout, "equalizer-bands" );
347 // Get the audio filters
348 pFilters = var_GetString( pAout, "audio-filter" );
349 vlc_object_release( pAout );
353 // Get the audio filters
354 pFilters = config_GetPsz( getIntf(), "audio-filter" );
357 // Refresh sound volume
358 audio_volume_t volume;
359 aout_VolumeGet( getIntf(), &volume );
360 Volume *pVolume = (Volume*)m_cVarVolume.get();
361 pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX );
363 // Set the mute variable
364 VarBoolImpl *pVarMute = (VarBoolImpl*)m_cVarMute.get();
365 pVarMute->set( volume == 0 );
367 // Refresh the equalizer variable
368 VarBoolImpl *pVarEqualizer = (VarBoolImpl*)m_cVarEqualizer.get();
369 pVarEqualizer->set( pFilters && strstr( pFilters, "equalizer" ) );
373 int VlcProc::onIntfChange( vlc_object_t *pObj, const char *pVariable,
374 vlc_value_t oldVal, vlc_value_t newVal,
377 VlcProc *pThis = (VlcProc*)pParam;
379 // Update the stream variable
380 playlist_t *p_playlist = (playlist_t*)pObj;
381 pThis->updateStreamName(p_playlist);
383 // Create a playlist notify command (for old style playlist)
384 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
385 // Create a playtree notify command (for new style playtree)
386 CmdPlaytreeChanged *pCmdTree = new CmdPlaytreeChanged( pThis->getIntf() );
388 // Push the command in the asynchronous command queue
389 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
390 pQueue->push( CmdGenericPtr( pCmd ) );
391 pQueue->push( CmdGenericPtr( pCmdTree ) );
397 int VlcProc::onIntfShow( vlc_object_t *pObj, const char *pVariable,
398 vlc_value_t oldVal, vlc_value_t newVal,
403 VlcProc *pThis = (VlcProc*)pParam;
405 // Create a raise all command
406 CmdRaiseAll *pCmd = new CmdRaiseAll( pThis->getIntf(),
407 pThis->getIntf()->p_sys->p_theme->getWindowManager() );
409 // Push the command in the asynchronous command queue
410 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
411 pQueue->push( CmdGenericPtr( pCmd ) );
418 int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
419 vlc_value_t oldVal, vlc_value_t newVal,
422 VlcProc *pThis = (VlcProc*)pParam;
424 // Update the stream variable
425 playlist_t *p_playlist = (playlist_t*)pObj;
426 pThis->updateStreamName(p_playlist);
428 // Create a playlist notify command
429 // TODO: selective update
430 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
431 // Create a playtree notify command
432 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
435 // Push the command in the asynchronous command queue
436 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
437 pQueue->push( CmdGenericPtr( pCmd ) );
438 pQueue->push( CmdGenericPtr( pCmdTree ), true );
443 int VlcProc::onItemAppend( vlc_object_t *pObj, const char *pVariable,
444 vlc_value_t oldVal, vlc_value_t newVal,
447 VlcProc *pThis = (VlcProc*)pParam;
449 playlist_add_t *p_add = (playlist_add_t*)malloc( sizeof(
452 memcpy( p_add, newVal.p_address, sizeof( playlist_add_t ) ) ;
454 CmdGenericPtr ptrTree;
455 CmdPlaytreeAppend *pCmdTree = new CmdPlaytreeAppend( pThis->getIntf(),
457 ptrTree = CmdGenericPtr( pCmdTree );
459 // Create a playlist notify command (for old style playlist)
460 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
462 // Push the command in the asynchronous command queue
463 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
464 pQueue->push( CmdGenericPtr( pCmd ) );
465 pQueue->push( ptrTree , false );
470 int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
471 vlc_value_t oldVal, vlc_value_t newVal,
474 VlcProc *pThis = (VlcProc*)pParam;
476 int i_id = newVal.i_int;
478 CmdGenericPtr ptrTree;
479 CmdPlaytreeDelete *pCmdTree = new CmdPlaytreeDelete( pThis->getIntf(),
481 ptrTree = CmdGenericPtr( pCmdTree );
483 // Create a playlist notify command (for old style playlist)
484 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
486 // Push the command in the asynchronous command queue
487 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
488 pQueue->push( CmdGenericPtr( pCmd ) );
489 pQueue->push( ptrTree , false );
497 int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
498 vlc_value_t oldVal, vlc_value_t newVal,
501 VlcProc *pThis = (VlcProc*)pParam;
503 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
505 // Update the stream variable
506 playlist_t *p_playlist = (playlist_t*)pObj;
507 pThis->updateStreamName(p_playlist);
509 // Create a playlist notify command (old style playlist)
510 // TODO: selective update
511 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
512 pQueue->push( CmdGenericPtr( pCmd ) );
513 // Create two playtree notify commands: one for old item, one for new
514 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
516 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
517 pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), newVal.i_int );
518 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
524 int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
525 vlc_value_t oldVal, vlc_value_t newVal,
528 VlcProc *pThis = (VlcProc*)pParam;
530 // Create a playlist notify command
531 CmdChangeSkin *pCmd =
532 new CmdChangeSkin( pThis->getIntf(), newVal.psz_string );
534 // Push the command in the asynchronous command queue
535 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
536 pQueue->push( CmdGenericPtr( pCmd ) );
541 int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
542 vlc_value_t oldVal, vlc_value_t newVal,
545 VlcProc *pThis = (VlcProc*)pParam;
546 interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);
548 CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
549 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
550 pQueue->push( CmdGenericPtr( pCmd ) );
555 void VlcProc::updateStreamName( playlist_t *p_playlist )
557 if( p_playlist->p_input )
559 VarText &rStreamName = getStreamNameVar();
560 VarText &rStreamURI = getStreamURIVar();
561 // XXX: we should not need to access p_input->psz_source directly, a
562 // getter should be provided by VLC core
563 string name = p_playlist->p_input->input.p_item->psz_name;
564 // XXX: This should be done in VLC core, not here...
565 // Remove path information if any
566 OSFactory *pFactory = OSFactory::instance( getIntf() );
567 string::size_type pos = name.rfind( pFactory->getDirSeparator() );
568 if( pos != string::npos )
570 name = name.substr( pos + 1, name.size() - pos + 1 );
572 UString srcName( getIntf(), name.c_str() );
573 UString srcURI( getIntf(),
574 p_playlist->p_input->input.p_item->psz_uri );
576 // Create commands to update the stream variables
577 CmdSetText *pCmd1 = new CmdSetText( getIntf(), rStreamName, srcName );
578 CmdSetText *pCmd2 = new CmdSetText( getIntf(), rStreamURI, srcURI );
579 // Push the commands in the asynchronous command queue
580 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
581 pQueue->push( CmdGenericPtr( pCmd1 ), false );
582 pQueue->push( CmdGenericPtr( pCmd2 ), false );
587 void *VlcProc::getWindow( intf_thread_t *pIntf, vout_thread_t *pVout,
588 int *pXHint, int *pYHint,
589 unsigned int *pWidthHint,
590 unsigned int *pHeightHint )
592 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
593 pThis->m_pVout = pVout;
594 if( pThis->m_handleSet.empty() )
600 // Get the window handle
601 void *pWindow = *pThis->m_handleSet.begin();
602 // Post a resize vout command
603 CmdResizeVout *pCmd = new CmdResizeVout( pThis->getIntf(), pWindow,
604 *pWidthHint, *pHeightHint );
605 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
606 pQueue->push( CmdGenericPtr( pCmd ) );
612 void VlcProc::releaseWindow( intf_thread_t *pIntf, void *pWindow )
614 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
615 pThis->m_pVout = NULL;
619 int VlcProc::controlWindow( intf_thread_t *pIntf, void *pWindow,
620 int query, va_list args )
622 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
630 unsigned int i_width = va_arg( args, unsigned int );
631 unsigned int i_height = va_arg( args, unsigned int );
632 if( !i_width ) i_width = pThis->m_pVout->i_window_width;
633 if( !i_height ) i_height = pThis->m_pVout->i_window_height;
635 // Post a resize vout command
636 CmdResizeVout *pCmd =
637 new CmdResizeVout( pThis->getIntf(), pWindow,
639 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
640 pQueue->push( CmdGenericPtr( pCmd ) );
645 msg_Dbg( pIntf, "control query not supported" );
653 int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
654 vlc_value_t oldVal, vlc_value_t newVal,
657 VlcProc *pThis = (VlcProc*)pParam;
659 // Post a set equalizer bands command
660 CmdSetEqBands *pCmd = new CmdSetEqBands( pThis->getIntf(),
663 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
664 pQueue->push( CmdGenericPtr( pCmd ) );
670 int VlcProc::onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
671 vlc_value_t oldVal, vlc_value_t newVal,
674 VlcProc *pThis = (VlcProc*)pParam;
675 EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)(pThis->m_cVarEqPreamp.get());
677 // Post a set preamp command
678 CmdSetEqPreamp *pCmd = new CmdSetEqPreamp( pThis->getIntf(), *pVarPreamp,
679 (newVal.f_float + 20.0) / 40.0 );
680 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
681 pQueue->push( CmdGenericPtr( pCmd ) );