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" )
105 REGISTER_VAR( m_cVarHasVout, VarBoolImpl, "vlc.hasVout" )
107 m_cVarStreamName = VariablePtr( new VarText( getIntf(), false ) );
108 pVarManager->registerVar( m_cVarStreamName, "streamName" );
109 m_cVarStreamURI = VariablePtr( new VarText( getIntf(), false ) );
110 pVarManager->registerVar( m_cVarStreamURI, "streamURI" );
111 m_cVarStreamBitRate = VariablePtr( new VarText( getIntf(), false ) );
112 pVarManager->registerVar( m_cVarStreamBitRate, "bitrate" );
113 m_cVarStreamSampleRate = VariablePtr( new VarText( getIntf(), false ) );
114 pVarManager->registerVar( m_cVarStreamSampleRate, "samplerate" );
116 // Register the equalizer bands
117 for( int i = 0; i < EqualizerBands::kNbBands; i++)
120 ss << "equalizer.band(" << i << ")";
121 pVarManager->registerVar( m_varEqBands.getBand( i ), ss.str() );
125 // The object variable callbacks are called from other VLC threads,
126 // so they must put commands in the queue and NOT do anything else
127 // (X11 calls are not reentrant)
129 // Called when the playlist changes
130 var_AddCallback( pIntf->p_sys->p_playlist, "intf-change",
131 onIntfChange, this );
132 // Called when a playlist item is added
133 var_AddCallback( pIntf->p_sys->p_playlist, "item-append",
134 onItemAppend, this );
135 // Called when a playlist item is deleted
136 // TODO: properly handle item-deleted
137 var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
138 onItemDelete, this );
139 // Called when the "interface shower" wants us to show the skin
140 var_AddCallback( pIntf->p_sys->p_playlist, "intf-show",
142 // Called when the current played item changes
143 var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
144 onPlaylistChange, this );
145 // Called when a playlist item changed
146 var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
147 onItemChange, this );
148 // Called when our skins2 demux wants us to load a new skin
149 var_AddCallback( pIntf, "skin-to-load", onSkinToLoad, this );
151 // Called when we have an interaction dialog to display
152 var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
153 var_AddCallback( pIntf, "interaction", onInteraction, this );
154 pIntf->b_interaction = VLC_TRUE;
156 // Callbacks for vout requests
157 getIntf()->pf_request_window = &getWindow;
158 getIntf()->pf_release_window = &releaseWindow;
159 getIntf()->pf_control_window = &controlWindow;
161 getIntf()->p_sys->p_input = NULL;
169 if( getIntf()->p_sys->p_input )
171 vlc_object_release( getIntf()->p_sys->p_input );
174 // Callbacks for vout requests
175 getIntf()->pf_request_window = NULL;
176 getIntf()->pf_release_window = NULL;
177 getIntf()->pf_control_window = NULL;
179 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
180 onIntfChange, this );
181 var_DelCallback( getIntf()->p_sys->p_playlist, "item-append",
182 onItemAppend, this );
183 var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
184 onItemDelete, this );
185 var_DelCallback( getIntf()->p_sys->p_playlist, "intf-show",
187 var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
188 onPlaylistChange, this );
189 var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
190 onItemChange, this );
191 var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
195 void VlcProc::registerVoutWindow( void *pVoutWindow )
197 m_handleSet.insert( pVoutWindow );
198 // Reparent the vout window
201 if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
202 vout_Control( m_pVout, VOUT_CLOSE );
207 void VlcProc::unregisterVoutWindow( void *pVoutWindow )
209 m_handleSet.erase( pVoutWindow );
213 void VlcProc::dropVout()
217 if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
218 vout_Control( m_pVout, VOUT_CLOSE );
224 void VlcProc::manage()
226 // Did the user requested to quit vlc ?
227 if( getIntf()->b_die || getIntf()->p_vlc->b_die )
229 CmdQuit *pCmd = new CmdQuit( getIntf() );
230 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
231 pQueue->push( CmdGenericPtr( pCmd ) );
234 // Get the VLC variables
235 StreamTime *pTime = (StreamTime*)m_cVarTime.get();
236 VarBoolImpl *pVarPlaying = (VarBoolImpl*)m_cVarPlaying.get();
237 VarBoolImpl *pVarStopped = (VarBoolImpl*)m_cVarStopped.get();
238 VarBoolImpl *pVarPaused = (VarBoolImpl*)m_cVarPaused.get();
239 VarBoolImpl *pVarSeekable = (VarBoolImpl*)m_cVarSeekable.get();
240 VarBoolImpl *pVarRandom = (VarBoolImpl*)m_cVarRandom.get();
241 VarBoolImpl *pVarLoop = (VarBoolImpl*)m_cVarLoop.get();
242 VarBoolImpl *pVarRepeat = (VarBoolImpl*)m_cVarRepeat.get();
243 VarBoolImpl *pVarDvdActive = (VarBoolImpl*)m_cVarDvdActive.get();
244 VarBoolImpl *pVarFullscreen = (VarBoolImpl*)m_cVarFullscreen.get();
245 VarBoolImpl *pVarHasVout = (VarBoolImpl*)m_cVarHasVout.get();
246 VarText *pBitrate = (VarText*)m_cVarStreamBitRate.get();
247 VarText *pSampleRate = (VarText*)m_cVarStreamSampleRate.get();
249 // Refresh audio variables
253 if( getIntf()->p_sys->p_input == NULL )
255 getIntf()->p_sys->p_input = getIntf()->p_sys->p_playlist->p_input;
256 if( getIntf()->p_sys->p_input )
257 vlc_object_yield( getIntf()->p_sys->p_input );
259 else if( getIntf()->p_sys->p_input->b_dead )
261 vlc_object_release( getIntf()->p_sys->p_input );
262 getIntf()->p_sys->p_input = NULL;
265 input_thread_t *pInput = getIntf()->p_sys->p_input;
267 if( pInput && !pInput->b_die )
269 // Refresh time variables
271 var_Get( pInput, "position", &pos );
272 pTime->set( pos.f_float, false );
274 // Get the status of the playlist
275 playlist_status_t status =
276 getIntf()->p_sys->p_playlist->status.i_status;
278 pVarPlaying->set( status == PLAYLIST_RUNNING );
279 pVarStopped->set( status == PLAYLIST_STOPPED );
280 pVarPaused->set( status == PLAYLIST_PAUSED );
282 pVarSeekable->set( pos.f_float != 0.0 );
284 // Refresh DVD detection
285 vlc_value_t chapters_count;
286 var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT,
287 &chapters_count, NULL );
288 pVarDvdActive->set( chapters_count.i_int > 0 );
290 // Refresh fullscreen status
291 vout_thread_t *pVout = (vout_thread_t *)vlc_object_find( pInput,
292 VLC_OBJECT_VOUT, FIND_CHILD );
293 pVarHasVout->set( pVout != NULL );
296 pVarFullscreen->set( pVout->b_fullscreen );
297 vlc_object_release( pVout );
300 // Get the input bitrate
301 int bitrate = var_GetInteger( pInput, "bit-rate" ) / 1000;
302 pBitrate->set( UString::fromInt( getIntf(), bitrate ) );
304 // Get the audio sample rate
305 int sampleRate = var_GetInteger( pInput, "sample-rate" ) / 1000;
306 pSampleRate->set( UString::fromInt( getIntf(), sampleRate ) );
310 pVarPlaying->set( false );
311 pVarPaused->set( false );
312 pVarStopped->set( true );
313 pVarSeekable->set( false );
314 pVarDvdActive->set( false );
315 pTime->set( 0, false );
316 pVarFullscreen->set( false );
317 pVarHasVout->set( false );
320 // Refresh the random variable
322 var_Get( getIntf()->p_sys->p_playlist, "random", &val );
323 pVarRandom->set( val.b_bool != 0 );
325 // Refresh the loop variable
326 var_Get( getIntf()->p_sys->p_playlist, "loop", &val );
327 pVarLoop->set( val.b_bool != 0 );
329 // Refresh the repeat variable
330 var_Get( getIntf()->p_sys->p_playlist, "repeat", &val );
331 pVarRepeat->set( val.b_bool != 0 );
337 void VlcProc::CmdManage::execute()
339 // Just forward to VlcProc
344 void VlcProc::refreshAudio()
346 char *pFilters = NULL;
348 // Check if the audio output has changed
349 aout_instance_t *pAout = (aout_instance_t *)vlc_object_find( getIntf(),
350 VLC_OBJECT_AOUT, FIND_ANYWHERE );
353 if( pAout != m_pAout )
355 // Register the equalizer callbacks
356 if( !var_AddCallback( pAout, "equalizer-bands",
357 onEqBandsChange, this ) &&
358 !var_AddCallback( pAout, "equalizer-preamp",
359 onEqPreampChange, this ) )
362 //char * psz_bands = var_GetString( p_aout, "equalizer-bands" );
365 // Get the audio filters
366 pFilters = var_GetString( pAout, "audio-filter" );
367 vlc_object_release( pAout );
371 // Get the audio filters
372 pFilters = config_GetPsz( getIntf(), "audio-filter" );
375 // Refresh sound volume
376 audio_volume_t volume;
377 aout_VolumeGet( getIntf(), &volume );
378 Volume *pVolume = (Volume*)m_cVarVolume.get();
379 pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX );
381 // Set the mute variable
382 VarBoolImpl *pVarMute = (VarBoolImpl*)m_cVarMute.get();
383 pVarMute->set( volume == 0 );
385 // Refresh the equalizer variable
386 VarBoolImpl *pVarEqualizer = (VarBoolImpl*)m_cVarEqualizer.get();
387 pVarEqualizer->set( pFilters && strstr( pFilters, "equalizer" ) );
391 int VlcProc::onIntfChange( vlc_object_t *pObj, const char *pVariable,
392 vlc_value_t oldVal, vlc_value_t newVal,
395 VlcProc *pThis = (VlcProc*)pParam;
397 // Update the stream variable
398 playlist_t *p_playlist = (playlist_t*)pObj;
399 pThis->updateStreamName(p_playlist);
401 // Create a playlist notify command (for old style playlist)
402 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
403 // Create a playtree notify command (for new style playtree)
404 CmdPlaytreeChanged *pCmdTree = new CmdPlaytreeChanged( pThis->getIntf() );
406 // Push the command in the asynchronous command queue
407 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
408 pQueue->push( CmdGenericPtr( pCmd ) );
409 pQueue->push( CmdGenericPtr( pCmdTree ) );
415 int VlcProc::onIntfShow( vlc_object_t *pObj, const char *pVariable,
416 vlc_value_t oldVal, vlc_value_t newVal,
421 VlcProc *pThis = (VlcProc*)pParam;
423 // Create a raise all command
424 CmdRaiseAll *pCmd = new CmdRaiseAll( pThis->getIntf(),
425 pThis->getIntf()->p_sys->p_theme->getWindowManager() );
427 // Push the command in the asynchronous command queue
428 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
429 pQueue->push( CmdGenericPtr( pCmd ) );
436 int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
437 vlc_value_t oldVal, vlc_value_t newVal,
440 VlcProc *pThis = (VlcProc*)pParam;
442 // Update the stream variable
443 playlist_t *p_playlist = (playlist_t*)pObj;
444 pThis->updateStreamName(p_playlist);
446 // Create a playlist notify command
447 // TODO: selective update
448 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
449 // Create a playtree notify command
450 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
453 // Push the command in the asynchronous command queue
454 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
455 pQueue->push( CmdGenericPtr( pCmd ) );
456 pQueue->push( CmdGenericPtr( pCmdTree ), true );
461 int VlcProc::onItemAppend( vlc_object_t *pObj, const char *pVariable,
462 vlc_value_t oldVal, vlc_value_t newVal,
465 VlcProc *pThis = (VlcProc*)pParam;
467 playlist_add_t *p_add = (playlist_add_t*)malloc( sizeof(
470 memcpy( p_add, newVal.p_address, sizeof( playlist_add_t ) ) ;
472 CmdGenericPtr ptrTree;
473 CmdPlaytreeAppend *pCmdTree = new CmdPlaytreeAppend( pThis->getIntf(),
475 ptrTree = CmdGenericPtr( pCmdTree );
477 // Create a playlist notify command (for old style playlist)
478 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
480 // Push the command in the asynchronous command queue
481 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
482 pQueue->push( CmdGenericPtr( pCmd ) );
483 pQueue->push( ptrTree , false );
488 int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
489 vlc_value_t oldVal, vlc_value_t newVal,
492 VlcProc *pThis = (VlcProc*)pParam;
494 int i_id = newVal.i_int;
496 CmdGenericPtr ptrTree;
497 CmdPlaytreeDelete *pCmdTree = new CmdPlaytreeDelete( pThis->getIntf(),
499 ptrTree = CmdGenericPtr( pCmdTree );
501 // Create a playlist notify command (for old style playlist)
502 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
504 // Push the command in the asynchronous command queue
505 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
506 pQueue->push( CmdGenericPtr( pCmd ) );
507 pQueue->push( ptrTree , false );
515 int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
516 vlc_value_t oldVal, vlc_value_t newVal,
519 VlcProc *pThis = (VlcProc*)pParam;
521 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
523 // Update the stream variable
524 playlist_t *p_playlist = (playlist_t*)pObj;
525 pThis->updateStreamName(p_playlist);
527 // Create a playlist notify command (old style playlist)
528 // TODO: selective update
529 CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
530 pQueue->push( CmdGenericPtr( pCmd ) );
531 // Create two playtree notify commands: one for old item, one for new
532 CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
534 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
535 pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), newVal.i_int );
536 pQueue->push( CmdGenericPtr( pCmdTree ) , true );
542 int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
543 vlc_value_t oldVal, vlc_value_t newVal,
546 VlcProc *pThis = (VlcProc*)pParam;
548 // Create a playlist notify command
549 CmdChangeSkin *pCmd =
550 new CmdChangeSkin( pThis->getIntf(), newVal.psz_string );
552 // Push the command in the asynchronous command queue
553 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
554 pQueue->push( CmdGenericPtr( pCmd ) );
559 int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
560 vlc_value_t oldVal, vlc_value_t newVal,
563 VlcProc *pThis = (VlcProc*)pParam;
564 interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);
566 CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
567 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
568 pQueue->push( CmdGenericPtr( pCmd ) );
573 void VlcProc::updateStreamName( playlist_t *p_playlist )
575 if( p_playlist && p_playlist->p_input )
577 // Get playlist item information
578 input_item_t *pItem = p_playlist->p_input->input.p_item;
580 VarText &rStreamName = getStreamNameVar();
581 VarText &rStreamURI = getStreamURIVar();
582 // XXX: we should not need to access p_input->psz_source directly, a
583 // getter should be provided by VLC core
584 string name = pItem->psz_name;
585 // XXX: This should be done in VLC core, not here...
586 // Remove path information if any
587 OSFactory *pFactory = OSFactory::instance( getIntf() );
588 string::size_type pos = name.rfind( pFactory->getDirSeparator() );
589 if( pos != string::npos )
591 name = name.substr( pos + 1, name.size() - pos + 1 );
593 UString srcName( getIntf(), name.c_str() );
594 UString srcURI( getIntf(), pItem->psz_uri );
596 // Create commands to update the stream variables
597 CmdSetText *pCmd1 = new CmdSetText( getIntf(), rStreamName, srcName );
598 CmdSetText *pCmd2 = new CmdSetText( getIntf(), rStreamURI, srcURI );
599 // Push the commands in the asynchronous command queue
600 AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
601 pQueue->push( CmdGenericPtr( pCmd1 ), false );
602 pQueue->push( CmdGenericPtr( pCmd2 ), false );
607 void *VlcProc::getWindow( intf_thread_t *pIntf, vout_thread_t *pVout,
608 int *pXHint, int *pYHint,
609 unsigned int *pWidthHint,
610 unsigned int *pHeightHint )
612 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
613 pThis->m_pVout = pVout;
614 if( pThis->m_handleSet.empty() )
620 // Get the window handle
621 void *pWindow = *pThis->m_handleSet.begin();
622 // Post a resize vout command
623 CmdResizeVout *pCmd = new CmdResizeVout( pThis->getIntf(), pWindow,
624 *pWidthHint, *pHeightHint );
625 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
626 pQueue->push( CmdGenericPtr( pCmd ) );
632 void VlcProc::releaseWindow( intf_thread_t *pIntf, void *pWindow )
634 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
635 pThis->m_pVout = NULL;
639 int VlcProc::controlWindow( intf_thread_t *pIntf, void *pWindow,
640 int query, va_list args )
642 VlcProc *pThis = pIntf->p_sys->p_vlcProc;
650 unsigned int i_width = va_arg( args, unsigned int );
651 unsigned int i_height = va_arg( args, unsigned int );
652 if( !i_width ) i_width = pThis->m_pVout->i_window_width;
653 if( !i_height ) i_height = pThis->m_pVout->i_window_height;
655 // Post a resize vout command
656 CmdResizeVout *pCmd =
657 new CmdResizeVout( pThis->getIntf(), pWindow,
659 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
660 pQueue->push( CmdGenericPtr( pCmd ) );
665 msg_Dbg( pIntf, "control query not supported" );
673 int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
674 vlc_value_t oldVal, vlc_value_t newVal,
677 VlcProc *pThis = (VlcProc*)pParam;
679 // Post a set equalizer bands command
680 CmdSetEqBands *pCmd = new CmdSetEqBands( pThis->getIntf(),
683 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
684 pQueue->push( CmdGenericPtr( pCmd ) );
690 int VlcProc::onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
691 vlc_value_t oldVal, vlc_value_t newVal,
694 VlcProc *pThis = (VlcProc*)pParam;
695 EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)(pThis->m_cVarEqPreamp.get());
697 // Post a set preamp command
698 CmdSetEqPreamp *pCmd = new CmdSetEqPreamp( pThis->getIntf(), *pVarPreamp,
699 (newVal.f_float + 20.0) / 40.0 );
700 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
701 pQueue->push( CmdGenericPtr( pCmd ) );