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>
30 #include "vlcproc.hpp"
31 #include "os_factory.hpp"
32 #include "os_timer.hpp"
33 #include "var_manager.hpp"
35 #include "window_manager.hpp"
36 #include "../commands/async_queue.hpp"
37 #include "../commands/cmd_change_skin.hpp"
38 #include "../commands/cmd_show_window.hpp"
39 #include "../commands/cmd_quit.hpp"
40 #include "../commands/cmd_resize.hpp"
41 #include "../commands/cmd_vars.hpp"
42 #include "../commands/cmd_dialogs.hpp"
43 #include "../utils/var_bool.hpp"
47 VlcProc *VlcProc::instance( intf_thread_t *pIntf )
49 if( pIntf->p_sys->p_vlcProc == NULL )
51 pIntf->p_sys->p_vlcProc = new VlcProc( pIntf );
54 return pIntf->p_sys->p_vlcProc;
58 void VlcProc::destroy( intf_thread_t *pIntf )
60 if( pIntf->p_sys->p_vlcProc )
62 delete pIntf->p_sys->p_vlcProc;
63 pIntf->p_sys->p_vlcProc = NULL;
68 VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
69 m_varVoutSize( pIntf ), m_varEqBands( pIntf ),
70 m_pVout( NULL ), m_pAout( NULL ), m_cmdManage( this )
72 // Create a timer to poll the status of the vlc
73 OSFactory *pOsFactory = OSFactory::instance( pIntf );
74 m_pTimer = pOsFactory->createOSTimer( m_cmdManage );
75 m_pTimer->start( 100, false );
77 // Create and register VLC variables
78 VarManager *pVarManager = VarManager::instance( getIntf() );
80 #define REGISTER_VAR( var, type, name ) \
81 var = VariablePtr( new type( getIntf() ) ); \
82 pVarManager->registerVar( var, name );
83 REGISTER_VAR( m_cPlaylist, Playlist, "playlist" )
84 pVarManager->registerVar( getPlaylistVar().getPositionVarPtr(),
86 REGISTER_VAR( m_cVarRandom, VarBoolImpl, "playlist.isRandom" )
87 REGISTER_VAR( m_cVarLoop, VarBoolImpl, "playlist.isLoop" )
88 REGISTER_VAR( m_cVarRepeat, VarBoolImpl, "playlist.isRepeat" )
89 REGISTER_VAR( m_cPlaytree, Playtree, "playtree" )
90 pVarManager->registerVar( getPlaytreeVar().getPositionVarPtr(),
92 pVarManager->registerVar( m_cVarRandom, "playtree.isRandom" );
93 pVarManager->registerVar( m_cVarLoop, "playtree.isLoop" );
94 pVarManager->registerVar( m_cVarRepeat, "playtree.isRepeat" );
95 REGISTER_VAR( m_cVarTime, StreamTime, "time" )
96 REGISTER_VAR( m_cVarVolume, Volume, "volume" )
97 REGISTER_VAR( m_cVarMute, VarBoolImpl, "vlc.isMute" )
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 REGISTER_VAR( m_cVarSeekable, VarBoolImpl, "vlc.isSeekable" )
102 REGISTER_VAR( m_cVarEqualizer, VarBoolImpl, "equalizer.isEnabled" )
103 REGISTER_VAR( m_cVarEqPreamp, EqualizerPreamp, "equalizer.preamp" )
104 REGISTER_VAR( m_cVarDvdActive, VarBoolImpl, "dvd.isActive" )
105 REGISTER_VAR( m_cVarFullscreen, VarBoolImpl, "vlc.isFullscreen" )
106 REGISTER_VAR( m_cVarHasVout, VarBoolImpl, "vlc.hasVout" )
108 m_cVarStreamName = VariablePtr( new VarText( getIntf(), false ) );
109 pVarManager->registerVar( m_cVarStreamName, "streamName" );
110 m_cVarStreamURI = VariablePtr( new VarText( getIntf(), false ) );
111 pVarManager->registerVar( m_cVarStreamURI, "streamURI" );
112 m_cVarStreamBitRate = VariablePtr( new VarText( getIntf(), false ) );
113 pVarManager->registerVar( m_cVarStreamBitRate, "bitrate" );
115 // Register the equalizer bands
116 for( int i = 0; i < EqualizerBands::kNbBands; i++)
119 ss << "equalizer.band(" << i << ")";
120 pVarManager->registerVar( m_varEqBands.getBand( i ), ss.str() );
124 // The object variable callbacks are called from other VLC threads,
125 // so they must put commands in the queue and NOT do anything else
126 // (X11 calls are not reentrant)
128 // Called when the playlist changes
129 var_AddCallback( pIntf->p_sys->p_playlist, "intf-change",
130 onIntfChange, this );
131 // Called when a playlist item is added
132 var_AddCallback( pIntf->p_sys->p_playlist, "item-append",
133 onItemAppend, this );
134 // Called when a playlist item is deleted
135 // TODO: properly handle item-deleted
136 var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
137 onItemDelete, this );
138 // Called when the "interface shower" wants us to show the skin
139 var_AddCallback( pIntf->p_sys->p_playlist, "intf-show",
141 // Called when the current played item changes
142 var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
143 onPlaylistChange, this );
144 // Called when a playlist item changed
145 var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
146 onItemChange, this );
147 // Called when our skins2 demux wants us to load a new skin
148 var_AddCallback( pIntf, "skin-to-load", onSkinToLoad, this );
150 // Called when we have an interaction dialog to display
151 var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
152 var_AddCallback( pIntf, "interaction", onInteraction, this );
153 pIntf->b_interaction = VLC_TRUE;
155 // Callbacks for vout requests
156 getIntf()->pf_request_window = &getWindow;
157 getIntf()->pf_release_window = &releaseWindow;
158 getIntf()->pf_control_window = &controlWindow;
160 getIntf()->p_sys->p_input = NULL;
168 if( getIntf()->p_sys->p_input )
170 vlc_object_release( getIntf()->p_sys->p_input );
173 // Callbacks for vout requests
174 getIntf()->pf_request_window = NULL;
175 getIntf()->pf_release_window = NULL;
176 getIntf()->pf_control_window = NULL;
178 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
179 onIntfChange, this );
180 var_DelCallback( getIntf()->p_sys->p_playlist, "item-append",
181 onItemAppend, this );
182 var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
183 onItemDelete, this );
184 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-show",
186 var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
187 onPlaylistChange, this );
188 var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
189 onItemChange, this );
190 var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
194 void VlcProc::registerVoutWindow( void *pVoutWindow )
196 m_handleSet.insert( pVoutWindow );
197 // Reparent the vout window
200 if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
201 vout_Control( m_pVout, VOUT_CLOSE );
206 void VlcProc::unregisterVoutWindow( void *pVoutWindow )
208 m_handleSet.erase( pVoutWindow );
212 void VlcProc::dropVout()
216 if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
217 vout_Control( m_pVout, VOUT_CLOSE );
223 void VlcProc::manage()
225 // Did the user requested to quit vlc ?
226 if( getIntf()->b_die || getIntf()->p_vlc->b_die )
228 CmdQuit *pCmd = new CmdQuit( getIntf() );
229 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
230 pQueue->push( CmdGenericPtr( pCmd ) );
233 // Get the VLC variables
234 StreamTime *pTime = (StreamTime*)m_cVarTime.get();
235 VarBoolImpl *pVarPlaying = (VarBoolImpl*)m_cVarPlaying.get();
236 VarBoolImpl *pVarStopped = (VarBoolImpl*)m_cVarStopped.get();
237 VarBoolImpl *pVarPaused = (VarBoolImpl*)m_cVarPaused.get();
238 VarBoolImpl *pVarSeekable = (VarBoolImpl*)m_cVarSeekable.get();
239 VarBoolImpl *pVarRandom = (VarBoolImpl*)m_cVarRandom.get();
240 VarBoolImpl *pVarLoop = (VarBoolImpl*)m_cVarLoop.get();
241 VarBoolImpl *pVarRepeat = (VarBoolImpl*)m_cVarRepeat.get();
242 VarBoolImpl *pVarDvdActive = (VarBoolImpl*)m_cVarDvdActive.get();
243 VarBoolImpl *pVarFullscreen = (VarBoolImpl*)m_cVarFullscreen.get();
244 VarBoolImpl *pVarHasVout = (VarBoolImpl*)m_cVarHasVout.get();
245 VarText *pBitrate = (VarText*)m_cVarStreamBitRate.get();
247 // Refresh audio variables
251 if( getIntf()->p_sys->p_input == NULL )
253 getIntf()->p_sys->p_input = getIntf()->p_sys->p_playlist->p_input;
254 if( getIntf()->p_sys->p_input )
255 vlc_object_yield( getIntf()->p_sys->p_input );
257 else if( getIntf()->p_sys->p_input->b_dead )
259 vlc_object_release( getIntf()->p_sys->p_input );
260 getIntf()->p_sys->p_input = NULL;
263 input_thread_t *pInput = getIntf()->p_sys->p_input;
265 if( pInput && !pInput->b_die )
267 // Refresh time variables
269 var_Get( pInput, "position", &pos );
270 pTime->set( pos.f_float, false );
272 // Get the status of the playlist
273 playlist_status_t status =
274 getIntf()->p_sys->p_playlist->status.i_status;
276 pVarPlaying->set( status == PLAYLIST_RUNNING );
277 pVarStopped->set( status == PLAYLIST_STOPPED );
278 pVarPaused->set( status == PLAYLIST_PAUSED );
280 pVarSeekable->set( pos.f_float != 0.0 );
282 // Refresh DVD detection
283 vlc_value_t chapters_count;
284 var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT,
285 &chapters_count, NULL );
286 pVarDvdActive->set( chapters_count.i_int > 0 );
288 // Refresh fullscreen status
289 vout_thread_t *pVout = (vout_thread_t *)vlc_object_find( pInput,
290 VLC_OBJECT_VOUT, FIND_CHILD );
291 pVarHasVout->set( pVout != NULL );
294 pVarFullscreen->set( pVout->b_fullscreen );
295 vlc_object_release( pVout );
298 // Get information on the current playlist item
299 input_item_t *pItem = pInput->input.p_item;
300 // Get the input bitrate
301 int bitrate = (int)(roundf(pItem->p_stats->f_demux_bitrate*8000));
302 pBitrate->set( UString::fromInt( getIntf(), bitrate ) );
306 pVarPlaying->set( false );
307 pVarPaused->set( false );
308 pVarStopped->set( true );
309 pVarSeekable->set( false );
310 pVarDvdActive->set( false );
311 pTime->set( 0, false );
312 pVarFullscreen->set( false );
313 pVarHasVout->set( false );
316 // Refresh the random variable
318 var_Get( getIntf()->p_sys->p_playlist, "random", &val );
319 pVarRandom->set( val.b_bool != 0 );
321 // Refresh the loop variable
322 var_Get( getIntf()->p_sys->p_playlist, "loop", &val );
323 pVarLoop->set( val.b_bool != 0 );
325 // Refresh the repeat variable
326 var_Get( getIntf()->p_sys->p_playlist, "repeat", &val );
327 pVarRepeat->set( val.b_bool != 0 );
333 void VlcProc::CmdManage::execute()
335 // Just forward to VlcProc
340 void VlcProc::refreshAudio()
342 char *pFilters = NULL;
344 // Check if the audio output has changed
345 aout_instance_t *pAout = (aout_instance_t *)vlc_object_find( getIntf(),
346 VLC_OBJECT_AOUT, FIND_ANYWHERE );
349 if( pAout != m_pAout )
351 // Register the equalizer callbacks
352 if( !var_AddCallback( pAout, "equalizer-bands",
353 onEqBandsChange, this ) &&
354 !var_AddCallback( pAout, "equalizer-preamp",
355 onEqPreampChange, this ) )
358 //char * psz_bands = var_GetString( p_aout, "equalizer-bands" );
361 // Get the audio filters
362 pFilters = var_GetString( pAout, "audio-filter" );
363 vlc_object_release( pAout );
367 // Get the audio filters
368 pFilters = config_GetPsz( getIntf(), "audio-filter" );
371 // Refresh sound volume
372 audio_volume_t volume;
373 aout_VolumeGet( getIntf(), &volume );
374 Volume *pVolume = (Volume*)m_cVarVolume.get();
375 pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX );
377 // Set the mute variable
378 VarBoolImpl *pVarMute = (VarBoolImpl*)m_cVarMute.get();
379 pVarMute->set( volume == 0 );
381 // Refresh the equalizer variable
382 VarBoolImpl *pVarEqualizer = (VarBoolImpl*)m_cVarEqualizer.get();
383 pVarEqualizer->set( pFilters && strstr( pFilters, "equalizer" ) );
387 int VlcProc::onIntfChange( vlc_object_t *pObj, const char *pVariable,
388 vlc_value_t oldVal, vlc_value_t newVal,
391 VlcProc *pThis = (VlcProc*)pParam;
393 // Update the stream variable
394 playlist_t *p_playlist = (playlist_t*)pObj;
395 pThis->updateStreamName(p_playlist);
397 // Create a playlist notify command (for old style playlist)
398 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
399 // Create a playtree notify command (for new style playtree)
400 CmdPlaytreeChanged *pCmdTree = new CmdPlaytreeChanged( pThis->getIntf() );
402 // Push the command in the asynchronous command queue
403 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
404 pQueue->push( CmdGenericPtr( pCmd ) );
405 pQueue->push( CmdGenericPtr( pCmdTree ) );
411 int VlcProc::onIntfShow( vlc_object_t *pObj, const char *pVariable,
412 vlc_value_t oldVal, vlc_value_t newVal,
417 VlcProc *pThis = (VlcProc*)pParam;
419 // Create a raise all command
420 CmdRaiseAll *pCmd = new CmdRaiseAll( pThis->getIntf(),
421 pThis->getIntf()->p_sys->p_theme->getWindowManager() );
423 // Push the command in the asynchronous command queue
424 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
425 pQueue->push( CmdGenericPtr( pCmd ) );
432 int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
433 vlc_value_t oldVal, vlc_value_t newVal,
436 VlcProc *pThis = (VlcProc*)pParam;
438 // Update the stream variable
439 playlist_t *p_playlist = (playlist_t*)pObj;
440 pThis->updateStreamName(p_playlist);
442 // Create a playlist notify command
443 // TODO: selective update
444 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
445 // Create a playtree notify command
446 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
449 // Push the command in the asynchronous command queue
450 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
451 pQueue->push( CmdGenericPtr( pCmd ) );
452 pQueue->push( CmdGenericPtr( pCmdTree ), true );
457 int VlcProc::onItemAppend( vlc_object_t *pObj, const char *pVariable,
458 vlc_value_t oldVal, vlc_value_t newVal,
461 VlcProc *pThis = (VlcProc*)pParam;
463 playlist_add_t *p_add = (playlist_add_t*)malloc( sizeof(
466 memcpy( p_add, newVal.p_address, sizeof( playlist_add_t ) ) ;
468 CmdGenericPtr ptrTree;
469 CmdPlaytreeAppend *pCmdTree = new CmdPlaytreeAppend( pThis->getIntf(),
471 ptrTree = CmdGenericPtr( pCmdTree );
473 // Create a playlist notify command (for old style playlist)
474 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
476 // Push the command in the asynchronous command queue
477 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
478 pQueue->push( CmdGenericPtr( pCmd ) );
479 pQueue->push( ptrTree , false );
484 int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
485 vlc_value_t oldVal, vlc_value_t newVal,
488 VlcProc *pThis = (VlcProc*)pParam;
490 int i_id = newVal.i_int;
492 CmdGenericPtr ptrTree;
493 CmdPlaytreeDelete *pCmdTree = new CmdPlaytreeDelete( pThis->getIntf(),
495 ptrTree = CmdGenericPtr( pCmdTree );
497 // Create a playlist notify command (for old style playlist)
498 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
500 // Push the command in the asynchronous command queue
501 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
502 pQueue->push( CmdGenericPtr( pCmd ) );
503 pQueue->push( ptrTree , false );
511 int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
512 vlc_value_t oldVal, vlc_value_t newVal,
515 VlcProc *pThis = (VlcProc*)pParam;
517 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
519 // Update the stream variable
520 playlist_t *p_playlist = (playlist_t*)pObj;
521 pThis->updateStreamName(p_playlist);
523 // Create a playlist notify command (old style playlist)
524 // TODO: selective update
525 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
526 pQueue->push( CmdGenericPtr( pCmd ) );
527 // Create two playtree notify commands: one for old item, one for new
528 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
530 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
531 pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), newVal.i_int );
532 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
538 int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
539 vlc_value_t oldVal, vlc_value_t newVal,
542 VlcProc *pThis = (VlcProc*)pParam;
544 // Create a playlist notify command
545 CmdChangeSkin *pCmd =
546 new CmdChangeSkin( pThis->getIntf(), newVal.psz_string );
548 // Push the command in the asynchronous command queue
549 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
550 pQueue->push( CmdGenericPtr( pCmd ) );
555 int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
556 vlc_value_t oldVal, vlc_value_t newVal,
559 VlcProc *pThis = (VlcProc*)pParam;
560 interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);
562 CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
563 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
564 pQueue->push( CmdGenericPtr( pCmd ) );
569 void VlcProc::updateStreamName( playlist_t *p_playlist )
571 if( p_playlist && p_playlist->p_input )
573 // Get playlist item information
574 input_item_t *pItem = p_playlist->p_input->input.p_item;
576 VarText &rStreamName = getStreamNameVar();
577 VarText &rStreamURI = getStreamURIVar();
578 // XXX: we should not need to access p_input->psz_source directly, a
579 // getter should be provided by VLC core
580 string name = pItem->psz_name;
581 // XXX: This should be done in VLC core, not here...
582 // Remove path information if any
583 OSFactory *pFactory = OSFactory::instance( getIntf() );
584 string::size_type pos = name.rfind( pFactory->getDirSeparator() );
585 if( pos != string::npos )
587 name = name.substr( pos + 1, name.size() - pos + 1 );
589 UString srcName( getIntf(), name.c_str() );
590 UString srcURI( getIntf(), pItem->psz_uri );
592 // Create commands to update the stream variables
593 CmdSetText *pCmd1 = new CmdSetText( getIntf(), rStreamName, srcName );
594 CmdSetText *pCmd2 = new CmdSetText( getIntf(), rStreamURI, srcURI );
595 // Push the commands in the asynchronous command queue
596 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
597 pQueue->push( CmdGenericPtr( pCmd1 ), false );
598 pQueue->push( CmdGenericPtr( pCmd2 ), false );
603 void *VlcProc::getWindow( intf_thread_t *pIntf, vout_thread_t *pVout,
604 int *pXHint, int *pYHint,
605 unsigned int *pWidthHint,
606 unsigned int *pHeightHint )
608 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
609 pThis->m_pVout = pVout;
610 if( pThis->m_handleSet.empty() )
616 // Get the window handle
617 void *pWindow = *pThis->m_handleSet.begin();
618 // Post a resize vout command
619 CmdResizeVout *pCmd = new CmdResizeVout( pThis->getIntf(), pWindow,
620 *pWidthHint, *pHeightHint );
621 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
622 pQueue->push( CmdGenericPtr( pCmd ) );
628 void VlcProc::releaseWindow( intf_thread_t *pIntf, void *pWindow )
630 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
631 pThis->m_pVout = NULL;
635 int VlcProc::controlWindow( intf_thread_t *pIntf, void *pWindow,
636 int query, va_list args )
638 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
646 unsigned int i_width = va_arg( args, unsigned int );
647 unsigned int i_height = va_arg( args, unsigned int );
648 if( !i_width ) i_width = pThis->m_pVout->i_window_width;
649 if( !i_height ) i_height = pThis->m_pVout->i_window_height;
651 // Post a resize vout command
652 CmdResizeVout *pCmd =
653 new CmdResizeVout( pThis->getIntf(), pWindow,
655 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
656 pQueue->push( CmdGenericPtr( pCmd ) );
661 msg_Dbg( pIntf, "control query not supported" );
669 int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
670 vlc_value_t oldVal, vlc_value_t newVal,
673 VlcProc *pThis = (VlcProc*)pParam;
675 // Post a set equalizer bands command
676 CmdSetEqBands *pCmd = new CmdSetEqBands( pThis->getIntf(),
679 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
680 pQueue->push( CmdGenericPtr( pCmd ) );
686 int VlcProc::onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
687 vlc_value_t oldVal, vlc_value_t newVal,
690 VlcProc *pThis = (VlcProc*)pParam;
691 EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)(pThis->m_cVarEqPreamp.get());
693 // Post a set preamp command
694 CmdSetEqPreamp *pCmd = new CmdSetEqPreamp( pThis->getIntf(), *pVarPreamp,
695 (newVal.f_float + 20.0) / 40.0 );
696 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
697 pQueue->push( CmdGenericPtr( pCmd ) );