]> git.sesse.net Git - vlc/blob - modules/gui/skins2/src/vlcproc.cpp
Merge branch 1.0-bugfix
[vlc] / modules / gui / skins2 / src / vlcproc.cpp
1 /*****************************************************************************
2  * vlcproc.cpp
3  *****************************************************************************
4  * Copyright (C) 2003-2009 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *          Olivier Teulière <ipkiss@via.ecp.fr>
9  *
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.
14  *
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.
19  *
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  *****************************************************************************/
24
25 #ifdef HAVE_CONFIG_H
26 # include "config.h"
27 #endif
28
29 #include <vlc_common.h>
30 #include <vlc_aout.h>
31 #include <vlc_vout.h>
32 #include <vlc_playlist.h>
33 #include <vlc_window.h>
34
35 #include "vlcproc.hpp"
36 #include "os_factory.hpp"
37 #include "os_timer.hpp"
38 #include "var_manager.hpp"
39 #include "theme.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 "../commands/cmd_update_item.hpp"
49 #include "../utils/var_bool.hpp"
50 #include <sstream>
51
52
53 VlcProc *VlcProc::instance( intf_thread_t *pIntf )
54 {
55     if( pIntf->p_sys->p_vlcProc == NULL )
56     {
57         pIntf->p_sys->p_vlcProc = new VlcProc( pIntf );
58     }
59
60     return pIntf->p_sys->p_vlcProc;
61 }
62
63
64 void VlcProc::destroy( intf_thread_t *pIntf )
65 {
66     if( pIntf->p_sys->p_vlcProc )
67     {
68         delete pIntf->p_sys->p_vlcProc;
69         pIntf->p_sys->p_vlcProc = NULL;
70     }
71 }
72
73
74 VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
75     m_varVoutSize( pIntf ), m_varEqBands( pIntf ),
76     m_pVout( NULL ), m_pAout( NULL ), m_cmdManage( this )
77 {
78     // Create a timer to poll the status of the vlc
79     OSFactory *pOsFactory = OSFactory::instance( pIntf );
80     m_pTimer = pOsFactory->createOSTimer( m_cmdManage );
81     m_pTimer->start( 100, false );
82
83     // Create and register VLC variables
84     VarManager *pVarManager = VarManager::instance( getIntf() );
85
86 #define REGISTER_VAR( var, type, name ) \
87     var = VariablePtr( new type( getIntf() ) ); \
88     pVarManager->registerVar( var, name );
89     REGISTER_VAR( m_cVarRandom, VarBoolImpl, "playlist.isRandom" )
90     REGISTER_VAR( m_cVarLoop, VarBoolImpl, "playlist.isLoop" )
91     REGISTER_VAR( m_cVarRepeat, VarBoolImpl, "playlist.isRepeat" )
92     REGISTER_VAR( m_cPlaytree, Playtree, "playtree" )
93     pVarManager->registerVar( getPlaytreeVar().getPositionVarPtr(),
94                               "playtree.slider" );
95     pVarManager->registerVar( m_cVarRandom, "playtree.isRandom" );
96     pVarManager->registerVar( m_cVarLoop, "playtree.isLoop" );
97
98     REGISTER_VAR( m_cVarPlaying, VarBoolImpl, "vlc.isPlaying" )
99     REGISTER_VAR( m_cVarStopped, VarBoolImpl, "vlc.isStopped" )
100     REGISTER_VAR( m_cVarPaused, VarBoolImpl, "vlc.isPaused" )
101
102     /* Input variables */
103     pVarManager->registerVar( m_cVarRepeat, "playtree.isRepeat" );
104     REGISTER_VAR( m_cVarTime, StreamTime, "time" )
105     REGISTER_VAR( m_cVarSeekable, VarBoolImpl, "vlc.isSeekable" )
106     REGISTER_VAR( m_cVarDvdActive, VarBoolImpl, "dvd.isActive" )
107
108     /* Vout variables */
109     REGISTER_VAR( m_cVarFullscreen, VarBoolImpl, "vlc.isFullscreen" )
110     REGISTER_VAR( m_cVarHasVout, VarBoolImpl, "vlc.hasVout" )
111
112     /* Aout variables */
113     REGISTER_VAR( m_cVarHasAudio, VarBoolImpl, "vlc.hasAudio" )
114     REGISTER_VAR( m_cVarVolume, Volume, "volume" )
115     REGISTER_VAR( m_cVarMute, VarBoolImpl, "vlc.isMute" )
116     REGISTER_VAR( m_cVarEqualizer, VarBoolImpl, "equalizer.isEnabled" )
117     REGISTER_VAR( m_cVarEqPreamp, EqualizerPreamp, "equalizer.preamp" )
118
119 #undef REGISTER_VAR
120     m_cVarStreamName = VariablePtr( new VarText( getIntf(), false ) );
121     pVarManager->registerVar( m_cVarStreamName, "streamName" );
122     m_cVarStreamURI = VariablePtr( new VarText( getIntf(), false ) );
123     pVarManager->registerVar( m_cVarStreamURI, "streamURI" );
124     m_cVarStreamBitRate = VariablePtr( new VarText( getIntf(), false ) );
125     pVarManager->registerVar( m_cVarStreamBitRate, "bitrate" );
126     m_cVarStreamSampleRate = VariablePtr( new VarText( getIntf(), false ) );
127     pVarManager->registerVar( m_cVarStreamSampleRate, "samplerate" );
128
129     // Register the equalizer bands
130     for( int i = 0; i < EqualizerBands::kNbBands; i++)
131     {
132         stringstream ss;
133         ss << "equalizer.band(" << i << ")";
134         pVarManager->registerVar( m_varEqBands.getBand( i ), ss.str() );
135     }
136
137     // XXX WARNING XXX
138     // The object variable callbacks are called from other VLC threads,
139     // so they must put commands in the queue and NOT do anything else
140     // (X11 calls are not reentrant)
141
142     // Called when the playlist changes
143     var_AddCallback( pIntf->p_sys->p_playlist, "intf-change",
144                      onIntfChange, this );
145     // Called when a playlist item is added
146     var_AddCallback( pIntf->p_sys->p_playlist, "playlist-item-append",
147                      onItemAppend, this );
148     // Called when a playlist item is deleted
149     // TODO: properly handle item-deleted
150     var_AddCallback( pIntf->p_sys->p_playlist, "playlist-item-deleted",
151                      onItemDelete, this );
152     // Called when the "interface shower" wants us to show the skin
153     var_AddCallback( pIntf->p_libvlc, "intf-show",
154                      onIntfShow, this );
155     // Called when the current played item changes
156     var_AddCallback( pIntf->p_sys->p_playlist, "item-current",
157                      onPlaylistChange, this );
158     // Called when a playlist item changed
159     var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
160                      onItemChange, this );
161     // Called when our skins2 demux wants us to load a new skin
162     var_AddCallback( pIntf, "skin-to-load", onSkinToLoad, this );
163
164     // Called when we have an interaction dialog to display
165     var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
166     var_AddCallback( pIntf, "interaction", onInteraction, this );
167     interaction_Register( pIntf );
168
169     getIntf()->p_sys->p_input = NULL;
170 }
171
172
173 VlcProc::~VlcProc()
174 {
175     m_pTimer->stop();
176     delete( m_pTimer );
177     if( getIntf()->p_sys->p_input )
178     {
179         vlc_object_release( getIntf()->p_sys->p_input );
180         getIntf()->p_sys->p_input = NULL;
181     }
182
183     interaction_Unregister( getIntf() );
184
185     var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
186                      onIntfChange, this );
187     var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-item-append",
188                      onItemAppend, this );
189     var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-item-deleted",
190                      onItemDelete, this );
191     var_DelCallback( getIntf()->p_libvlc, "intf-show",
192                      onIntfShow, this );
193     var_DelCallback( getIntf()->p_sys->p_playlist, "item-current",
194                      onPlaylistChange, this );
195     var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
196                      onItemChange, this );
197     var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
198 }
199
200 void VlcProc::manage()
201 {
202     // Did the user request to quit vlc ?
203     if( !vlc_object_alive( getIntf() ) )
204     {
205         CmdQuit *pCmd = new CmdQuit( getIntf() );
206         AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
207         pQueue->push( CmdGenericPtr( pCmd ) );
208     }
209
210     refreshPlaylist();
211     refreshAudio();
212     refreshInput();
213 }
214 void VlcProc::CmdManage::execute()
215 {
216     // Just forward to VlcProc
217     m_pParent->manage();
218 }
219
220 void VlcProc::refreshAudio()
221 {
222     char *pFilters;
223
224     // Check if the audio output has changed
225     aout_instance_t *pAout = (aout_instance_t *)vlc_object_find( getIntf(),
226             VLC_OBJECT_AOUT, FIND_ANYWHERE );
227     if( pAout )
228     {
229         if( pAout != m_pAout )
230         {
231             // Register the equalizer callbacks
232             if( !var_AddCallback( pAout, "equalizer-bands",
233                                   onEqBandsChange, this ) &&
234                 !var_AddCallback( pAout, "equalizer-preamp",
235                                   onEqPreampChange, this ) )
236             {
237                 m_pAout = pAout;
238                 //char * psz_bands = var_GetString( p_aout, "equalizer-bands" );
239             }
240         }
241         // Get the audio filters
242         pFilters = var_GetNonEmptyString( pAout, "audio-filter" );
243         vlc_object_release( pAout );
244     }
245     else
246     {
247         // Get the audio filters
248         pFilters = config_GetPsz( getIntf(), "audio-filter" );
249     }
250
251     // Refresh sound volume
252     audio_volume_t volume;
253     aout_VolumeGet( getIntf(), &volume );
254     Volume *pVolume = (Volume*)m_cVarVolume.get();
255     pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX );
256
257     // Set the mute variable
258     VarBoolImpl *pVarMute = (VarBoolImpl*)m_cVarMute.get();
259     pVarMute->set( volume == 0 );
260
261     // Refresh the equalizer variable
262     VarBoolImpl *pVarEqualizer = (VarBoolImpl*)m_cVarEqualizer.get();
263     pVarEqualizer->set( pFilters && strstr( pFilters, "equalizer" ) );
264     free( pFilters );
265 }
266
267 void VlcProc::refreshPlaylist()
268 {
269     // Refresh the random variable
270     VarBoolImpl *pVarRandom = (VarBoolImpl*)m_cVarRandom.get();
271     vlc_value_t val;
272     var_Get( getIntf()->p_sys->p_playlist, "random", &val );
273     pVarRandom->set( val.b_bool != 0 );
274
275     // Refresh the loop variable
276     VarBoolImpl *pVarLoop = (VarBoolImpl*)m_cVarLoop.get();
277     var_Get( getIntf()->p_sys->p_playlist, "loop", &val );
278     pVarLoop->set( val.b_bool != 0 );
279
280     // Refresh the repeat variable
281     VarBoolImpl *pVarRepeat = (VarBoolImpl*)m_cVarRepeat.get();
282     var_Get( getIntf()->p_sys->p_playlist, "repeat", &val );
283     pVarRepeat->set( val.b_bool != 0 );
284 }
285
286 void VlcProc::refreshInput()
287 {
288     StreamTime *pTime = (StreamTime*)m_cVarTime.get();
289     VarBoolImpl *pVarSeekable = (VarBoolImpl*)m_cVarSeekable.get();
290     VarBoolImpl *pVarDvdActive = (VarBoolImpl*)m_cVarDvdActive.get();
291     VarBoolImpl *pVarHasVout = (VarBoolImpl*)m_cVarHasVout.get();
292     VarBoolImpl *pVarHasAudio = (VarBoolImpl*)m_cVarHasAudio.get();
293     VarText *pBitrate = (VarText*)m_cVarStreamBitRate.get();
294     VarText *pSampleRate = (VarText*)m_cVarStreamSampleRate.get();
295     VarBoolImpl *pVarFullscreen = (VarBoolImpl*)m_cVarFullscreen.get();
296     VarBoolImpl *pVarPlaying = (VarBoolImpl*)m_cVarPlaying.get();
297     VarBoolImpl *pVarStopped = (VarBoolImpl*)m_cVarStopped.get();
298     VarBoolImpl *pVarPaused = (VarBoolImpl*)m_cVarPaused.get();
299
300     // Update the input
301     if( getIntf()->p_sys->p_input == NULL )
302     {
303         getIntf()->p_sys->p_input =
304             playlist_CurrentInput( getIntf()->p_sys->p_playlist );
305     }
306     else if( getIntf()->p_sys->p_input->b_dead )
307     {
308         vlc_object_release( getIntf()->p_sys->p_input );
309         getIntf()->p_sys->p_input = NULL;
310     }
311
312     input_thread_t *pInput = getIntf()->p_sys->p_input;
313
314     if( pInput && vlc_object_alive (pInput) )
315     {
316         // Refresh time variables
317         vlc_value_t pos;
318         var_Get( pInput, "position", &pos );
319         pTime->set( pos.f_float, false );
320         pVarSeekable->set( pos.f_float != 0.0 );
321
322         // Refresh DVD detection
323         vlc_value_t chapters_count;
324         var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT,
325                         &chapters_count, NULL );
326         pVarDvdActive->set( chapters_count.i_int > 0 );
327
328         // Get the input bitrate
329         int bitrate = var_GetInteger( pInput, "bit-rate" ) / 1000;
330         pBitrate->set( UString::fromInt( getIntf(), bitrate ) );
331
332         // Get the audio sample rate
333         int sampleRate = var_GetInteger( pInput, "sample-rate" ) / 1000;
334         pSampleRate->set( UString::fromInt( getIntf(), sampleRate ) );
335
336         // Do we have audio
337         vlc_value_t audio_es;
338         var_Change( pInput, "audio-es", VLC_VAR_CHOICESCOUNT,
339                         &audio_es, NULL );
340         pVarHasAudio->set( audio_es.i_int > 0 );
341
342         // Refresh fullscreen status
343         vout_thread_t *pVout = input_GetVout( pInput );
344         pVarHasVout->set( pVout != NULL );
345         if( pVout )
346         {
347             pVarFullscreen->set( pVout->b_fullscreen );
348             vlc_object_release( pVout );
349         }
350
351         // Refresh play/pause status
352         int state = var_GetInteger( pInput, "state" );
353         pVarStopped->set( false );
354         pVarPlaying->set( state != PAUSE_S );
355         pVarPaused->set( state == PAUSE_S );
356     }
357     else
358     {
359         pVarSeekable->set( false );
360         pVarDvdActive->set( false );
361         pTime->set( 0, false );
362         pVarFullscreen->set( false );
363         pVarHasAudio->set( false );
364         pVarHasVout->set( false );
365         pVarStopped->set( true );
366         pVarPlaying->set( false );
367         pVarPaused->set( false );
368     }
369 }
370
371 int VlcProc::onIntfChange( vlc_object_t *pObj, const char *pVariable,
372                            vlc_value_t oldVal, vlc_value_t newVal,
373                            void *pParam )
374 {
375     VlcProc *pThis = (VlcProc*)pParam;
376
377     // Update the stream variable
378     pThis->updateStreamName();
379
380     // Create a playtree notify command (for new style playtree)
381     CmdPlaytreeChanged *pCmdTree = new CmdPlaytreeChanged( pThis->getIntf() );
382
383     // Push the command in the asynchronous command queue
384     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
385     pQueue->push( CmdGenericPtr( pCmdTree ) );
386
387     return VLC_SUCCESS;
388 }
389
390
391 int VlcProc::onIntfShow( vlc_object_t *pObj, const char *pVariable,
392                          vlc_value_t oldVal, vlc_value_t newVal,
393                          void *pParam )
394 {
395     if (newVal.b_bool)
396     {
397         VlcProc *pThis = (VlcProc*)pParam;
398
399         // Create a raise all command
400         CmdRaiseAll *pCmd = new CmdRaiseAll( pThis->getIntf(),
401             pThis->getIntf()->p_sys->p_theme->getWindowManager() );
402
403         // Push the command in the asynchronous command queue
404         AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
405         pQueue->push( CmdGenericPtr( pCmd ) );
406     }
407
408     return VLC_SUCCESS;
409 }
410
411
412 int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
413                            vlc_value_t oldval, vlc_value_t newval,
414                            void *pParam )
415 {
416     VlcProc *pThis = (VlcProc*)pParam;
417     input_item_t *p_item = static_cast<input_item_t*>(newval.p_address);
418
419     // Update the stream variable
420     pThis->updateStreamName();
421
422     // Create a playtree notify command
423     CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
424                                                          p_item->i_id );
425
426     // Push the command in the asynchronous command queue
427     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
428     pQueue->push( CmdGenericPtr( pCmdTree ), true );
429
430     return VLC_SUCCESS;
431 }
432
433 int VlcProc::onItemAppend( vlc_object_t *pObj, const char *pVariable,
434                            vlc_value_t oldVal, vlc_value_t newVal,
435                            void *pParam )
436 {
437     VlcProc *pThis = (VlcProc*)pParam;
438
439     playlist_add_t *p_add = (playlist_add_t*)malloc( sizeof(
440                                                 playlist_add_t ) ) ;
441
442     memcpy( p_add, newVal.p_address, sizeof( playlist_add_t ) ) ;
443
444     CmdGenericPtr ptrTree;
445     CmdPlaytreeAppend *pCmdTree = new CmdPlaytreeAppend( pThis->getIntf(),
446                                                              p_add );
447     ptrTree = CmdGenericPtr( pCmdTree );
448
449     // Push the command in the asynchronous command queue
450     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
451     pQueue->push( ptrTree , false );
452
453     return VLC_SUCCESS;
454 }
455
456 int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
457                            vlc_value_t oldVal, vlc_value_t newVal,
458                            void *pParam )
459 {
460     VlcProc *pThis = (VlcProc*)pParam;
461
462     int i_id = newVal.i_int;
463
464     CmdGenericPtr ptrTree;
465     CmdPlaytreeDelete *pCmdTree = new CmdPlaytreeDelete( pThis->getIntf(),
466                                                          i_id);
467     ptrTree = CmdGenericPtr( pCmdTree );
468
469     // Push the command in the asynchronous command queue
470     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
471     pQueue->push( ptrTree , false );
472
473     return VLC_SUCCESS;
474 }
475
476
477 int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
478                                vlc_value_t oldval, vlc_value_t newval,
479                                void *pParam )
480 {
481     VlcProc *pThis = (VlcProc*)pParam;
482     input_item_t *p_item = static_cast<input_item_t*>(newval.p_address);
483
484     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
485
486     // Update the stream variable
487     pThis->updateStreamName();
488
489     // Create two playtree notify commands: one for old item, one for new
490 #if 0 /* FIXME: Heck, no! You cannot do that.
491          There is no warranty that the old item is still valid. */
492     CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
493                                                          oldVal.i_int );
494     pQueue->push( CmdGenericPtr( pCmdTree ) , true );
495 #endif
496     CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), p_item->i_id );
497     pQueue->push( CmdGenericPtr( pCmdTree ) , true );
498
499     return VLC_SUCCESS;
500 }
501
502
503 int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
504                            vlc_value_t oldVal, vlc_value_t newVal,
505                            void *pParam )
506 {
507     VlcProc *pThis = (VlcProc*)pParam;
508
509     // Create a playlist notify command
510     CmdChangeSkin *pCmd =
511         new CmdChangeSkin( pThis->getIntf(), newVal.psz_string );
512
513     // Push the command in the asynchronous command queue
514     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
515     pQueue->push( CmdGenericPtr( pCmd ) );
516
517     return VLC_SUCCESS;
518 }
519
520 int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
521                             vlc_value_t oldVal, vlc_value_t newVal,
522                             void *pParam )
523 {
524     VlcProc *pThis = (VlcProc*)pParam;
525     interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);
526
527     CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
528     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
529     pQueue->push( CmdGenericPtr( pCmd ) );
530     return VLC_SUCCESS;
531 }
532
533
534 void VlcProc::updateStreamName()
535 {
536     // Create a update item command
537     CmdUpdateItem *pCmdItem = new CmdUpdateItem( getIntf(), getStreamNameVar(), getStreamURIVar() );
538
539     // Push the command in the asynchronous command queue
540     AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
541     pQueue->push( CmdGenericPtr( pCmdItem ) );
542 }
543
544 int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
545                               vlc_value_t oldVal, vlc_value_t newVal,
546                               void *pParam )
547 {
548     VlcProc *pThis = (VlcProc*)pParam;
549
550     // Post a set equalizer bands command
551     CmdSetEqBands *pCmd = new CmdSetEqBands( pThis->getIntf(),
552                                              pThis->m_varEqBands,
553                                              newVal.psz_string );
554     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
555     pQueue->push( CmdGenericPtr( pCmd ) );
556
557     return VLC_SUCCESS;
558 }
559
560
561 int VlcProc::onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
562                                vlc_value_t oldVal, vlc_value_t newVal,
563                                void *pParam )
564 {
565     VlcProc *pThis = (VlcProc*)pParam;
566     EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)(pThis->m_cVarEqPreamp.get());
567
568     // Post a set preamp command
569     CmdSetEqPreamp *pCmd = new CmdSetEqPreamp( pThis->getIntf(), *pVarPreamp,
570                                               (newVal.f_float + 20.0) / 40.0 );
571     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
572     pQueue->push( CmdGenericPtr( pCmd ) );
573
574     return VLC_SUCCESS;
575 }
576