1 /*****************************************************************************
2 * input_manager.cpp : Manage an input and interact with its GUI elements
3 ****************************************************************************
4 * Copyright (C) 2006-2008 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Ilkka Ollakka <ileoo@videolan.org>
9 * Jean-Baptiste <jb@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
30 #include "input_manager.hpp"
33 #include <QApplication>
37 static int ItemChanged( vlc_object_t *, const char *,
38 vlc_value_t, vlc_value_t, void * );
39 static int PLItemChanged( vlc_object_t *, const char *,
40 vlc_value_t, vlc_value_t, void * );
41 static int VolumeChanged( vlc_object_t *, const char *,
42 vlc_value_t, vlc_value_t, void * );
44 static int InputEvent( vlc_object_t *, const char *,
45 vlc_value_t, vlc_value_t, void * );
46 static int VbiEvent( vlc_object_t *, const char *,
47 vlc_value_t, vlc_value_t, void * );
50 /**********************************************************************
51 * InputManager implementation
52 **********************************************************************
53 * The Input Manager can be the main one around the playlist
54 * But can also be used for VLM dialog or similar
55 **********************************************************************/
57 InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
58 QObject( parent ), p_intf( _p_intf )
60 i_old_playing_status = END_S;
69 f_cache = -1.; /* impossible initial value, different from all */
72 InputManager::~InputManager()
77 /* Define the Input used.
78 Add the callbacks on input
79 p_input is held once here */
80 void InputManager::setInput( input_thread_t *_p_input )
84 if( p_input && !( p_input->b_dead || !vlc_object_alive (p_input) ) )
86 msg_Dbg( p_intf, "IM: Setting an input" );
87 vlc_object_hold( p_input );
88 emit statusChanged( PLAYING_S );
95 i_input_id = input_GetItem( p_input )->i_id;
101 emit rateChanged( INPUT_RATE_DEFAULT );
105 /* delete Input if it ever existed.
106 Delete the callbacls on input
107 p_input is released once here */
108 void InputManager::delInput()
110 if( !p_input ) return;
111 msg_Dbg( p_intf, "IM: Deleting the input" );
114 i_old_playing_status = END_S;
122 vlc_object_release( p_input );
125 emit positionUpdated( -1.0, 0 ,0 );
126 emit rateChanged( INPUT_RATE_DEFAULT ); /* TODO: Do we want this ? */
127 emit nameChanged( "" );
128 emit chapterChanged( 0 );
129 emit titleChanged( 0 );
130 emit statusChanged( END_S );
132 emit teletextPossible( false );
133 emit AtoBchanged( false, false );
134 emit voutChanged( false );
135 emit voutListChanged( NULL, 0 );
137 /* Reset all InfoPanels but stats */
138 emit artChanged( NULL );
139 emit infoChanged( NULL );
140 emit metaChanged( (input_item_t *)NULL );
142 emit encryptionChanged( false );
143 emit recordingStateChanged( false );
146 /* Convert the event from the callbacks in actions */
147 void InputManager::customEvent( QEvent *event )
149 int i_type = event->type();
150 IMEvent *ple = static_cast<IMEvent *>(event);
156 if( i_type != PositionUpdate_Type &&
157 i_type != StatisticsUpdate_Type &&
158 i_type != ItemChanged_Type )
159 msg_Dbg( p_intf, "New Event: type %i", i_type );
165 case PositionUpdate_Type:
168 case StatisticsUpdate_Type:
171 case ItemChanged_Type:
172 /* Ignore ItemChanged_Type event that does not apply to our input */
173 if( i_input_id == ple->i_id )
178 /* Update duration of file */
180 UpdateMeta( ple->i_id );
182 case ItemStateChanged_Type:
183 // TODO: Fusion with above state
186 // UpdateNavigation(); This shouldn't be useful now
187 // UpdateTeletext(); Same
189 case NameChanged_Type:
192 case MetaChanged_Type:
194 UpdateName(); /* Needed for NowPlaying */
195 UpdateArt(); /* Art is part of meta in the core */
197 case InfoChanged_Type:
200 case ItemTitleChanged_Type:
202 UpdateName(); /* Display the name of the Chapter, if exists */
204 case ItemRateChanged_Type:
207 case ItemEsChanged_Type:
209 // We don't do anything ES related. Why ?
211 case ItemTeletextChanged_Type:
214 case InterfaceVoutUpdate_Type:
217 case SynchroChanged_Type:
218 emit synchroChanged();
220 case CachingEvent_Type:
223 case BookmarksChanged_Type:
224 emit bookmarksChanged();
226 case InterfaceAoutUpdate_Type:
229 case RecordingEvent_Type:
232 case ProgramChanged_Type:
233 UpdateProgramEvent();
236 msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
241 /* Add the callbacks on Input. Self explanatory */
242 inline void InputManager::addCallbacks()
244 var_AddCallback( p_input, "intf-event", InputEvent, this );
247 /* Delete the callbacks on Input. Self explanatory */
248 inline void InputManager::delCallbacks()
250 var_DelCallback( p_input, "intf-event", InputEvent, this );
253 /* Static callbacks for IM */
254 static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
255 vlc_value_t oldval, vlc_value_t newval, void *param )
257 InputManager *im = (InputManager*)param;
259 IMEvent *event = new IMEvent( ItemChanged_Type, newval.i_int );
260 QApplication::postEvent( im, event );
264 static int InputEvent( vlc_object_t *p_this, const char *,
265 vlc_value_t, vlc_value_t newval, void *param )
267 InputManager *im = (InputManager*)param;
270 switch( newval.i_int )
272 case INPUT_EVENT_STATE:
273 event = new IMEvent( ItemStateChanged_Type, 0 );
275 case INPUT_EVENT_RATE:
276 event = new IMEvent( ItemRateChanged_Type, 0 );
278 case INPUT_EVENT_TIMES:
279 event = new IMEvent( PositionUpdate_Type, 0 );
282 case INPUT_EVENT_TITLE:
283 case INPUT_EVENT_CHAPTER:
284 event = new IMEvent( ItemTitleChanged_Type, 0 );
288 event = new IMEvent( ItemEsChanged_Type, 0 );
290 case INPUT_EVENT_TELETEXT:
291 event = new IMEvent( ItemTeletextChanged_Type, 0 );
294 case INPUT_EVENT_STATISTICS:
295 event = new IMEvent( StatisticsUpdate_Type, 0 );
298 case INPUT_EVENT_VOUT:
299 event = new IMEvent( InterfaceVoutUpdate_Type, 0 );
301 case INPUT_EVENT_AOUT:
302 event = new IMEvent( InterfaceAoutUpdate_Type, 0 );
305 case INPUT_EVENT_ITEM_META: /* Codec MetaData + Art */
306 event = new IMEvent( MetaChanged_Type, 0 );
308 case INPUT_EVENT_ITEM_INFO: /* Codec Info */
309 event = new IMEvent( InfoChanged_Type, 0 );
311 case INPUT_EVENT_ITEM_NAME:
312 event = new IMEvent( NameChanged_Type, 0 );
315 case INPUT_EVENT_AUDIO_DELAY:
316 case INPUT_EVENT_SUBTITLE_DELAY:
317 event = new IMEvent( SynchroChanged_Type, 0 );
320 case INPUT_EVENT_CACHE:
321 event = new IMEvent( CachingEvent_Type, 0 );
324 case INPUT_EVENT_BOOKMARK:
325 event = new IMEvent( BookmarksChanged_Type, 0 );
328 case INPUT_EVENT_RECORD:
329 event = new IMEvent( RecordingEvent_Type, 0 );
332 case INPUT_EVENT_PROGRAM:
333 /* This is for PID changes */
334 event = new IMEvent( ProgramChanged_Type, 0 );
337 case INPUT_EVENT_SIGNAL:
338 /* This is for capture-card signals */
339 /* event = new IMEvent( SignalChanged_Type, 0 );
347 QApplication::postEvent( im, event );
351 static int VbiEvent( vlc_object_t *, const char *,
352 vlc_value_t, vlc_value_t, void *param )
354 InputManager *im = (InputManager*)param;
355 IMEvent *event = new IMEvent( ItemTeletextChanged_Type, 0 );
357 QApplication::postEvent( im, event );
361 void InputManager::UpdatePosition()
363 /* Update position */
364 int i_length, i_time; /* Int is enough, since we store seconds */
366 i_length = var_GetTime( p_input , "length" ) / 1000000;
367 i_time = var_GetTime( p_input , "time") / 1000000;
368 f_pos = var_GetFloat( p_input , "position" );
369 emit positionUpdated( f_pos, i_time, i_length );
372 void InputManager::UpdateNavigation()
374 /* Update navigation status */
375 vlc_value_t val; val.i_int = 0;
378 var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL );
382 emit titleChanged( true );
383 msg_Dbg( p_intf, "Title %i", val.i_int );
384 /* p_input != NULL since val.i_int != 0 */
386 var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val, NULL );
387 emit chapterChanged( (val.i_int > 0) );
388 msg_Dbg( p_intf, "Chapter: %i", val.i_int );
391 emit titleChanged( false );
394 void InputManager::UpdateStatus()
396 /* Update playing status */
397 vlc_value_t val; val.i_int = 0;
398 var_Get( p_input, "state", &val );
399 if( i_old_playing_status != val.i_int )
401 i_old_playing_status = val.i_int;
402 emit statusChanged( val.i_int );
406 void InputManager::UpdateRate()
409 int i_new_rate = var_GetInteger( p_input, "rate");
410 if( i_new_rate != i_rate )
414 emit rateChanged( i_rate );
418 void InputManager::UpdateName()
420 /* Update text, name and nowplaying */
423 /* Try to get the Title, then the Name */
424 char *psz_name = input_item_GetTitleFbName( input_GetItem( p_input ) );
426 /* Try to get the nowplaying */
427 char *psz_nowplaying =
428 input_item_GetNowPlaying( input_GetItem( p_input ) );
429 if( !EMPTY_STR( psz_nowplaying ) )
431 text.sprintf( "%s - %s", psz_nowplaying, psz_name );
433 else /* Do it ourself */
435 char *psz_artist = input_item_GetArtist( input_GetItem( p_input ) );
437 if( !EMPTY_STR( psz_artist ) )
438 text.sprintf( "%s - %s", psz_artist, psz_name );
440 text.sprintf( "%s", psz_name );
444 /* Free everything */
446 free( psz_nowplaying );
448 /* If we have Nothing */
451 psz_name = input_item_GetURI( input_GetItem( p_input ) );
452 text.sprintf( "%s", psz_name );
453 text = text.remove( 0, text.lastIndexOf( DIR_SEP ) + 1 );
457 if( oldName != text )
459 emit nameChanged( text );
464 bool InputManager::hasAudio()
469 var_Change( p_input, "audio-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
470 return val.i_int > 0;
475 void InputManager::UpdateTeletext()
479 const bool b_enabled = var_CountChoices( p_input, "teletext-es" ) > 0;
480 const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
482 /* Teletext is possible. Show the buttons */
483 emit teletextPossible( b_enabled );
485 /* If Teletext is selected */
486 if( b_enabled && i_teletext_es >= 0 )
488 /* Then, find the current page */
490 bool b_transparent = false;
492 vlc_object_t *p_vbi = (vlc_object_t *)
493 vlc_object_find_name( p_input, "zvbi", FIND_CHILD );
497 /* We deleted it (if not here, it does not harm), because
498 * var_AddCallback will silently add a duplicated one */
499 var_DelCallback( p_vbi, "vbi-page", VbiEvent, this );
500 /* This callback is not remove explicitly, but interfaces
501 * are guaranted to outlive input */
502 var_AddCallback( p_vbi, "vbi-page", VbiEvent, this );
504 i_page = var_GetInteger( p_vbi, "vbi-page" );
505 b_transparent = !var_GetBool( p_vbi, "vbi-opaque" );
506 vlc_object_release( p_vbi );
508 emit newTelexPageSet( i_page );
509 emit teletextTransparencyActivated( b_transparent );
512 emit teletextActivated( b_enabled && i_teletext_es >= 0 );
516 emit teletextActivated( false );
517 emit teletextPossible( false );
521 void InputManager::UpdateVout()
525 /* Get current vout lists from input */
527 vout_thread_t **pp_vout;
528 if( input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) )
535 emit voutListChanged( pp_vout, i_vout );
538 bool b_old_video = b_video;
539 b_video = i_vout > 0;
540 if( !!b_old_video != !!b_video )
541 emit voutChanged( b_video );
543 /* Release the vout list */
544 for( int i = 0; i < i_vout; i++ )
545 vlc_object_release( (vlc_object_t*)pp_vout[i] );
549 void InputManager::UpdateAout()
556 void InputManager::UpdateCaching()
558 if(!hasInput()) return;
560 float f_newCache = var_GetFloat ( p_input, "cache" );
561 if( f_newCache != f_cache )
563 f_cache = f_newCache;
565 emit cachingChanged( f_cache );
569 void InputManager::requestArtUpdate()
573 playlist_t *p_playlist = pl_Hold( p_intf );
574 playlist_AskForArtEnqueue( p_playlist, input_GetItem( p_input ), pl_Unlocked );
575 pl_Release( p_intf );
579 /* No input will signal the cover art to update,
580 * let's do it ourself */
585 void InputManager::UpdateArt()
591 char *psz_art = input_item_GetArtURL( input_GetItem( p_input ) );
592 url = qfu( psz_art );
595 url = url.replace( "file://", QString("" ) );
596 /* Taglib seems to define a attachment://, It won't work yet */
597 url = url.replace( "attachment://", QString("" ) );
598 /* Update Art meta */
599 emit artChanged( url );
602 inline void InputManager::UpdateStats()
604 emit statisticsUpdated( input_GetItem( p_input ) );
607 inline void InputManager::UpdateMeta( int id )
609 emit metaChanged( id );
612 inline void InputManager::UpdateMeta()
614 emit metaChanged( input_GetItem( p_input ) );
617 inline void InputManager::UpdateInfo()
619 emit infoChanged( input_GetItem( p_input ) );
622 void InputManager::UpdateRecord()
626 emit recordingStateChanged( var_GetBool( p_input, "record" ) );
630 void InputManager::UpdateProgramEvent()
634 bool b_scrambled = var_GetBool( p_input, "program-scrambled" );
635 emit encryptionChanged( b_scrambled );
639 /* User update of the slider */
640 void InputManager::sliderUpdate( float new_pos )
643 var_SetFloat( p_input, "position", new_pos );
646 /* User togglePlayPause */
647 void InputManager::togglePlayPause()
651 int state = var_GetInteger( p_input, "state" );
652 state = ( state != PLAYING_S ) ? PLAYING_S : PAUSE_S;
653 var_SetInteger( p_input, "state", state );
654 emit statusChanged( state );
658 void InputManager::sectionPrev()
662 int i_type = var_Type( p_input, "next-chapter" );
663 var_SetVoid( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
664 "prev-chapter":"prev-title" );
668 void InputManager::sectionNext()
672 int i_type = var_Type( p_input, "next-chapter" );
673 var_SetVoid( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
674 "next-chapter":"next-title" );
678 void InputManager::sectionMenu()
682 vlc_value_t val, text;
684 if( var_Change( p_input, "title 0", VLC_VAR_GETLIST, &val, &text ) < 0 )
687 /* XXX is it "Root" or "Title" we want here ?" (set 0 by default) */
689 for( int i = 0; i < val.p_list->i_count; i++ )
691 if( !strcmp( text.p_list->p_values[i].psz_string, "Title" ) )
694 var_Change( p_input, "title 0", VLC_VAR_FREELIST, &val, &text );
696 var_SetInteger( p_input, "title 0", root );
704 /* Set a new Teletext Page */
705 void InputManager::telexSetPage( int page )
709 const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
711 if( i_teletext_es >= 0 )
713 vlc_object_t *p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
714 "zvbi", FIND_CHILD );
717 var_SetInteger( p_vbi, "vbi-page", page );
718 vlc_object_release( p_vbi );
719 emit newTelexPageSet( page );
725 /* Set the transparency on teletext */
726 void InputManager::telexSetTransparency( bool b_transparentTelextext )
730 vlc_object_t *p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
731 "zvbi", FIND_CHILD );
734 var_SetBool( p_vbi, "vbi-opaque", !b_transparentTelextext );
735 vlc_object_release( p_vbi );
736 emit teletextTransparencyActivated( b_transparentTelextext );
741 void InputManager::activateTeletext( bool b_enable )
745 if( hasInput() && !var_Change( p_input, "teletext-es", VLC_VAR_GETLIST, &list, &text ) )
747 if( list.p_list->i_count > 0 )
749 /* Prefer the page 100 if it is present */
751 for( i = 0; i < text.p_list->i_count; i++ )
753 /* The description is the page number as a string */
754 const char *psz_page = text.p_list->p_values[i].psz_string;
755 if( psz_page && !strcmp( psz_page, "100" ) )
758 if( i >= list.p_list->i_count )
760 var_SetInteger( p_input, "spu-es", b_enable ? list.p_list->p_values[i].i_int : -1 );
762 var_Change( p_input, "teletext-es", VLC_VAR_FREELIST, &list, &text );
766 void InputManager::reverse()
770 int i_rate = var_GetInteger( p_input, "rate" );
771 var_SetInteger( p_input, "rate", -i_rate );
775 void InputManager::slower()
778 var_SetVoid( p_input, "rate-slower" );
781 void InputManager::faster()
784 var_SetVoid( p_input, "rate-faster" );
787 void InputManager::littlefaster()
789 var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_RATE_FASTER_FINE );
792 void InputManager::littleslower()
794 var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_RATE_SLOWER_FINE );
797 void InputManager::normalRate()
800 var_SetInteger( p_input, "rate", INPUT_RATE_DEFAULT );
803 void InputManager::setRate( int new_rate )
806 var_SetInteger( p_input, "rate", new_rate );
809 void InputManager::jumpFwd()
811 int i_interval = config_GetInt( p_input, "short-jump-size" );
814 mtime_t val = (mtime_t)(i_interval) * 1000000L;
815 var_SetTime( p_input, "time-offset", val );
819 void InputManager::jumpBwd()
821 int i_interval = config_GetInt( p_input, "short-jump-size" );
824 mtime_t val = -1 *(mtime_t)(i_interval) * 1000000L;
825 var_SetTime( p_input, "time-offset", val );
829 void InputManager::setAtoB()
833 timeA = var_GetTime( THEMIM->getInput(), "time" );
837 timeB = var_GetTime( THEMIM->getInput(), "time" );
838 var_SetTime( THEMIM->getInput(), "time" , timeA );
839 CONNECT( this, positionUpdated( float, int, int ),
840 this, AtoBLoop( float, int, int ) );
846 disconnect( this, SIGNAL( positionUpdated( float, int, int ) ),
847 this, SLOT( AtoBLoop( float, int, int ) ) );
849 emit AtoBchanged( (timeA != 0 ), (timeB != 0 ) );
852 /* Function called regularly when in an AtoB loop */
853 void InputManager::AtoBLoop( float, int i_time, int )
857 if( ( i_time >= (int)( timeB/1000000 ) )
858 || ( i_time < (int)( timeA/1000000 ) ) )
859 var_SetTime( THEMIM->getInput(), "time" , timeA );
863 /**********************************************************************
864 * MainInputManager implementation. Wrap an input manager and
865 * take care of updating the main playlist input.
866 * Used in the main playlist Dialog
867 **********************************************************************/
868 MainInputManager * MainInputManager::instance = NULL;
870 MainInputManager::MainInputManager( intf_thread_t *_p_intf )
871 : QObject(NULL), p_intf( _p_intf )
874 im = new InputManager( this, p_intf );
876 var_AddCallback( THEPL, "item-change", ItemChanged, im );
877 var_AddCallback( THEPL, "item-current", PLItemChanged, this );
878 var_AddCallback( THEPL, "activity", PLItemChanged, this );
880 var_AddCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, this );
882 /* Warn our embedded IM about input changes */
883 CONNECT( this, inputChanged( input_thread_t * ),
884 im, setInput( input_thread_t * ) );
886 /* emit check if playlist has already started playing */
887 IMEvent *event = new IMEvent( ItemChanged_Type,
888 var_GetInteger( THEPL, "item-current" ) );
889 customEvent( event );
893 MainInputManager::~MainInputManager()
897 emit inputChanged( NULL );
898 var_DelCallback( p_input, "state", PLItemChanged, this );
899 vlc_object_release( p_input );
902 var_DelCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, this );
904 var_DelCallback( THEPL, "activity", PLItemChanged, this );
905 var_DelCallback( THEPL, "item-change", ItemChanged, im );
907 var_DelCallback( THEPL, "item-current", PLItemChanged, this );
910 vout_thread_t* MainInputManager::getVout()
912 return p_input ? input_GetVout( p_input ) : NULL;
915 aout_instance_t * MainInputManager::getAout()
917 return p_input ? input_GetAout( p_input ) : NULL;
920 void MainInputManager::customEvent( QEvent *event )
922 int type = event->type();
923 if ( type != ItemChanged_Type && type != VolumeChanged_Type )
926 // msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
927 if( type == VolumeChanged_Type )
929 emit volumeChanged();
933 /* Should be PLItemChanged Event */
934 if( !p_intf->p_sys->b_isDialogProvider )
936 if( p_input && ( p_input->b_dead || !vlc_object_alive (p_input) ) )
938 emit inputChanged( p_input );
939 var_DelCallback( p_input, "state", PLItemChanged, this );
940 vlc_object_release( p_input );
947 p_input = playlist_CurrentInput(THEPL);
950 var_AddCallback( p_input, "state", PLItemChanged, this );
951 emit inputChanged( p_input );
957 /* remove previous stored p_input */
960 vlc_object_release( p_input );
963 /* we are working as a dialogs provider */
964 playlist_t *p_playlist = pl_Hold( p_intf );
965 p_input = playlist_CurrentInput( p_playlist );
968 emit inputChanged( p_input );
970 pl_Release( p_intf );
974 /* Playlist Control functions */
975 void MainInputManager::stop()
977 playlist_Stop( THEPL );
980 void MainInputManager::next()
982 playlist_Next( THEPL );
985 void MainInputManager::prev()
987 playlist_Prev( THEPL );
990 void MainInputManager::togglePlayPause()
994 playlist_Play( THEPL );
996 getIM()->togglePlayPause();
999 void MainInputManager::activatePlayQuit( bool b_exit )
1001 var_SetBool( THEPL, "play-and-exit", b_exit );
1004 /* Static callbacks for MIM */
1005 static int PLItemChanged( vlc_object_t *p_this, const char *psz_var,
1006 vlc_value_t oldval, vlc_value_t newval, void *param )
1008 MainInputManager *mim = (MainInputManager*)param;
1010 IMEvent *event = new IMEvent( ItemChanged_Type, newval.i_int );
1011 QApplication::postEvent( mim, event );
1015 static int VolumeChanged( vlc_object_t *p_this, const char *psz_var,
1016 vlc_value_t oldval, vlc_value_t newval, void *param )
1018 MainInputManager *mim = (MainInputManager*)param;
1020 IMEvent *event = new IMEvent( VolumeChanged_Type, newval.i_int );
1021 QApplication::postEvent( mim, event );