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"
34 #include <QApplication>
38 static int ItemChanged( vlc_object_t *, const char *,
39 vlc_value_t, vlc_value_t, void * );
40 static int PLItemChanged( vlc_object_t *, const char *,
41 vlc_value_t, vlc_value_t, void * );
42 static int VolumeChanged( vlc_object_t *, const char *,
43 vlc_value_t, vlc_value_t, void * );
45 static int InputEvent( vlc_object_t *, const char *,
46 vlc_value_t, vlc_value_t, void * );
47 static int VbiEvent( vlc_object_t *, const char *,
48 vlc_value_t, vlc_value_t, void * );
51 /**********************************************************************
52 * InputManager implementation
53 **********************************************************************
54 * The Input Manager can be the main one around the playlist
55 * But can also be used for VLM dialog or similar
56 **********************************************************************/
58 InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
59 QObject( parent ), p_intf( _p_intf )
61 i_old_playing_status = END_S;
70 f_cache = -1.; /* impossible initial value, different from all */
73 InputManager::~InputManager()
78 /* Define the Input used.
79 Add the callbacks on input
80 p_input is held once here */
81 void InputManager::setInput( input_thread_t *_p_input )
85 if( p_input && !( p_input->b_dead || !vlc_object_alive (p_input) ) )
87 msg_Dbg( p_intf, "IM: Setting an input" );
88 vlc_object_hold( p_input );
89 emit statusChanged( PLAYING_S );
96 i_input_id = input_GetItem( p_input )->i_id;
102 emit rateChanged( INPUT_RATE_DEFAULT );
106 /* delete Input if it ever existed.
107 Delete the callbacls on input
108 p_input is released once here */
109 void InputManager::delInput()
111 if( !p_input ) return;
112 msg_Dbg( p_intf, "IM: Deleting the input" );
115 i_old_playing_status = END_S;
123 vlc_object_release( p_input );
126 emit positionUpdated( -1.0, 0 ,0 );
127 emit rateChanged( INPUT_RATE_DEFAULT ); /* TODO: Do we want this ? */
128 emit nameChanged( "" );
129 emit chapterChanged( 0 );
130 emit titleChanged( 0 );
131 emit statusChanged( END_S );
133 emit teletextPossible( false );
134 emit AtoBchanged( false, false );
135 emit voutChanged( false );
136 emit voutListChanged( NULL, 0 );
138 /* Reset all InfoPanels but stats */
139 emit artChanged( NULL );
140 emit infoChanged( NULL );
141 emit metaChanged( (input_item_t *)NULL );
143 emit encryptionChanged( false );
144 emit recordingStateChanged( false );
147 /* Convert the event from the callbacks in actions */
148 void InputManager::customEvent( QEvent *event )
150 int i_type = event->type();
151 IMEvent *ple = static_cast<IMEvent *>(event);
157 if( i_type != PositionUpdate_Type &&
158 i_type != StatisticsUpdate_Type &&
159 i_type != ItemChanged_Type )
160 msg_Dbg( p_intf, "New Event: type %i", i_type );
166 case PositionUpdate_Type:
169 case StatisticsUpdate_Type:
172 case ItemChanged_Type:
173 /* Ignore ItemChanged_Type event that does not apply to our input */
174 if( i_input_id == ple->i_id )
179 /* Update duration of file */
181 UpdateMeta( ple->i_id );
183 case ItemStateChanged_Type:
184 // TODO: Fusion with above state
187 // UpdateNavigation(); This shouldn't be useful now
188 // UpdateTeletext(); Same
190 case NameChanged_Type:
193 case MetaChanged_Type:
195 UpdateName(); /* Needed for NowPlaying */
196 UpdateArt(); /* Art is part of meta in the core */
198 case InfoChanged_Type:
201 case ItemTitleChanged_Type:
203 UpdateName(); /* Display the name of the Chapter, if exists */
205 case ItemRateChanged_Type:
208 case ItemEsChanged_Type:
210 // We don't do anything ES related. Why ?
212 case ItemTeletextChanged_Type:
215 case InterfaceVoutUpdate_Type:
218 case SynchroChanged_Type:
219 emit synchroChanged();
221 case CachingEvent_Type:
224 case BookmarksChanged_Type:
225 emit bookmarksChanged();
227 case InterfaceAoutUpdate_Type:
230 case RecordingEvent_Type:
233 case ProgramChanged_Type:
234 UpdateProgramEvent();
237 msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
242 /* Add the callbacks on Input. Self explanatory */
243 inline void InputManager::addCallbacks()
245 var_AddCallback( p_input, "intf-event", InputEvent, this );
248 /* Delete the callbacks on Input. Self explanatory */
249 inline void InputManager::delCallbacks()
251 var_DelCallback( p_input, "intf-event", InputEvent, this );
254 /* Static callbacks for IM */
255 static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
256 vlc_value_t oldval, vlc_value_t newval, void *param )
258 InputManager *im = (InputManager*)param;
260 IMEvent *event = new IMEvent( ItemChanged_Type, newval.i_int );
261 QApplication::postEvent( im, event );
265 static int InputEvent( vlc_object_t *p_this, const char *,
266 vlc_value_t, vlc_value_t newval, void *param )
268 InputManager *im = (InputManager*)param;
271 switch( newval.i_int )
273 case INPUT_EVENT_STATE:
274 event = new IMEvent( ItemStateChanged_Type, 0 );
276 case INPUT_EVENT_RATE:
277 event = new IMEvent( ItemRateChanged_Type, 0 );
279 case INPUT_EVENT_TIMES:
280 event = new IMEvent( PositionUpdate_Type, 0 );
283 case INPUT_EVENT_TITLE:
284 case INPUT_EVENT_CHAPTER:
285 event = new IMEvent( ItemTitleChanged_Type, 0 );
289 event = new IMEvent( ItemEsChanged_Type, 0 );
291 case INPUT_EVENT_TELETEXT:
292 event = new IMEvent( ItemTeletextChanged_Type, 0 );
295 case INPUT_EVENT_STATISTICS:
296 event = new IMEvent( StatisticsUpdate_Type, 0 );
299 case INPUT_EVENT_VOUT:
300 event = new IMEvent( InterfaceVoutUpdate_Type, 0 );
302 case INPUT_EVENT_AOUT:
303 event = new IMEvent( InterfaceAoutUpdate_Type, 0 );
306 case INPUT_EVENT_ITEM_META: /* Codec MetaData + Art */
307 event = new IMEvent( MetaChanged_Type, 0 );
309 case INPUT_EVENT_ITEM_INFO: /* Codec Info */
310 event = new IMEvent( InfoChanged_Type, 0 );
312 case INPUT_EVENT_ITEM_NAME:
313 event = new IMEvent( NameChanged_Type, 0 );
316 case INPUT_EVENT_AUDIO_DELAY:
317 case INPUT_EVENT_SUBTITLE_DELAY:
318 event = new IMEvent( SynchroChanged_Type, 0 );
321 case INPUT_EVENT_CACHE:
322 event = new IMEvent( CachingEvent_Type, 0 );
325 case INPUT_EVENT_BOOKMARK:
326 event = new IMEvent( BookmarksChanged_Type, 0 );
329 case INPUT_EVENT_RECORD:
330 event = new IMEvent( RecordingEvent_Type, 0 );
333 case INPUT_EVENT_PROGRAM:
334 /* This is for PID changes */
335 event = new IMEvent( ProgramChanged_Type, 0 );
338 case INPUT_EVENT_SIGNAL:
339 /* This is for capture-card signals */
340 /* event = new IMEvent( SignalChanged_Type, 0 );
348 QApplication::postEvent( im, event );
352 static int VbiEvent( vlc_object_t *, const char *,
353 vlc_value_t, vlc_value_t, void *param )
355 InputManager *im = (InputManager*)param;
356 IMEvent *event = new IMEvent( ItemTeletextChanged_Type, 0 );
358 QApplication::postEvent( im, event );
362 void InputManager::UpdatePosition()
364 /* Update position */
365 int i_length, i_time; /* Int is enough, since we store seconds */
367 i_length = var_GetTime( p_input , "length" ) / 1000000;
368 i_time = var_GetTime( p_input , "time") / 1000000;
369 f_pos = var_GetFloat( p_input , "position" );
370 emit positionUpdated( f_pos, i_time, i_length );
373 void InputManager::UpdateNavigation()
375 /* Update navigation status */
376 vlc_value_t val; val.i_int = 0;
379 var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL );
383 emit titleChanged( true );
384 msg_Dbg( p_intf, "Title %i", val.i_int );
385 /* p_input != NULL since val.i_int != 0 */
387 var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val, NULL );
388 emit chapterChanged( (val.i_int > 0) );
389 msg_Dbg( p_intf, "Chapter: %i", val.i_int );
392 emit titleChanged( false );
395 void InputManager::UpdateStatus()
397 /* Update playing status */
398 vlc_value_t val; val.i_int = 0;
399 var_Get( p_input, "state", &val );
400 if( i_old_playing_status != val.i_int )
402 i_old_playing_status = val.i_int;
403 emit statusChanged( val.i_int );
407 void InputManager::UpdateRate()
410 int i_new_rate = var_GetInteger( p_input, "rate");
411 if( i_new_rate != i_rate )
415 emit rateChanged( i_rate );
419 void InputManager::UpdateName()
421 /* Update text, name and nowplaying */
424 /* Try to get the Title, then the Name */
425 char *psz_name = input_item_GetTitleFbName( input_GetItem( p_input ) );
427 /* Try to get the nowplaying */
428 char *psz_nowplaying =
429 input_item_GetNowPlaying( input_GetItem( p_input ) );
430 if( !EMPTY_STR( psz_nowplaying ) )
432 text.sprintf( "%s - %s", psz_nowplaying, psz_name );
434 else /* Do it ourself */
436 char *psz_artist = input_item_GetArtist( input_GetItem( p_input ) );
438 if( !EMPTY_STR( psz_artist ) )
439 text.sprintf( "%s - %s", psz_artist, psz_name );
441 text.sprintf( "%s", psz_name );
445 /* Free everything */
447 free( psz_nowplaying );
449 /* If we have Nothing */
452 psz_name = input_item_GetURI( input_GetItem( p_input ) );
453 text.sprintf( "%s", psz_name );
454 text = text.remove( 0, text.lastIndexOf( DIR_SEP ) + 1 );
458 if( oldName != text )
460 emit nameChanged( text );
465 bool InputManager::hasAudio()
470 var_Change( p_input, "audio-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
471 return val.i_int > 0;
476 void InputManager::UpdateTeletext()
480 const bool b_enabled = var_CountChoices( p_input, "teletext-es" ) > 0;
481 const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
483 /* Teletext is possible. Show the buttons */
484 emit teletextPossible( b_enabled );
486 /* If Teletext is selected */
487 if( b_enabled && i_teletext_es >= 0 )
489 /* Then, find the current page */
491 bool b_transparent = false;
493 vlc_object_t *p_vbi = (vlc_object_t *)
494 vlc_object_find_name( p_input, "zvbi", FIND_CHILD );
498 /* We deleted it (if not here, it does not harm), because
499 * var_AddCallback will silently add a duplicated one */
500 var_DelCallback( p_vbi, "vbi-page", VbiEvent, this );
501 /* This callback is not remove explicitly, but interfaces
502 * are guaranted to outlive input */
503 var_AddCallback( p_vbi, "vbi-page", VbiEvent, this );
505 i_page = var_GetInteger( p_vbi, "vbi-page" );
506 b_transparent = !var_GetBool( p_vbi, "vbi-opaque" );
507 vlc_object_release( p_vbi );
509 emit newTelexPageSet( i_page );
510 emit teletextTransparencyActivated( b_transparent );
513 emit teletextActivated( b_enabled && i_teletext_es >= 0 );
517 emit teletextActivated( false );
518 emit teletextPossible( false );
522 void InputManager::UpdateVout()
526 /* Get current vout lists from input */
528 vout_thread_t **pp_vout;
529 if( input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) )
536 emit voutListChanged( pp_vout, i_vout );
539 bool b_old_video = b_video;
540 b_video = i_vout > 0;
541 if( !!b_old_video != !!b_video )
542 emit voutChanged( b_video );
544 /* Release the vout list */
545 for( int i = 0; i < i_vout; i++ )
546 vlc_object_release( (vlc_object_t*)pp_vout[i] );
550 void InputManager::UpdateAout()
557 void InputManager::UpdateCaching()
559 if(!hasInput()) return;
561 float f_newCache = var_GetFloat ( p_input, "cache" );
562 if( f_newCache != f_cache )
564 f_cache = f_newCache;
566 emit cachingChanged( f_cache );
570 void InputManager::requestArtUpdate()
574 playlist_t *p_playlist = pl_Hold( p_intf );
575 playlist_AskForArtEnqueue( p_playlist, input_GetItem( p_input ), pl_Unlocked );
576 pl_Release( p_intf );
580 /* No input will signal the cover art to update,
581 * let's do it ourself */
586 void InputManager::UpdateArt()
592 char *psz_art = input_item_GetArtURL( input_GetItem( p_input ) );
593 if( psz_art && !strncmp( psz_art, "file://", 7 ) &&
594 decode_URI( psz_art + 7 ) )
595 url = qfu( psz_art + 7);
599 /* Update Art meta */
600 emit artChanged( url );
603 inline void InputManager::UpdateStats()
605 emit statisticsUpdated( input_GetItem( p_input ) );
608 inline void InputManager::UpdateMeta( int id )
610 emit metaChanged( id );
613 inline void InputManager::UpdateMeta()
615 emit metaChanged( input_GetItem( p_input ) );
618 inline void InputManager::UpdateInfo()
620 emit infoChanged( input_GetItem( p_input ) );
623 void InputManager::UpdateRecord()
627 emit recordingStateChanged( var_GetBool( p_input, "record" ) );
631 void InputManager::UpdateProgramEvent()
635 bool b_scrambled = var_GetBool( p_input, "program-scrambled" );
636 emit encryptionChanged( b_scrambled );
640 /* User update of the slider */
641 void InputManager::sliderUpdate( float new_pos )
644 var_SetFloat( p_input, "position", new_pos );
647 /* User togglePlayPause */
648 void InputManager::togglePlayPause()
652 int state = var_GetInteger( p_input, "state" );
653 state = ( state != PLAYING_S ) ? PLAYING_S : PAUSE_S;
654 var_SetInteger( p_input, "state", state );
655 emit statusChanged( state );
659 void InputManager::sectionPrev()
663 int i_type = var_Type( p_input, "next-chapter" );
664 var_SetVoid( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
665 "prev-chapter":"prev-title" );
669 void InputManager::sectionNext()
673 int i_type = var_Type( p_input, "next-chapter" );
674 var_SetVoid( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
675 "next-chapter":"next-title" );
679 void InputManager::sectionMenu()
683 vlc_value_t val, text;
685 if( var_Change( p_input, "title 0", VLC_VAR_GETLIST, &val, &text ) < 0 )
688 /* XXX is it "Root" or "Title" we want here ?" (set 0 by default) */
690 for( int i = 0; i < val.p_list->i_count; i++ )
692 if( !strcmp( text.p_list->p_values[i].psz_string, "Title" ) )
695 var_Change( p_input, "title 0", VLC_VAR_FREELIST, &val, &text );
697 var_SetInteger( p_input, "title 0", root );
705 /* Set a new Teletext Page */
706 void InputManager::telexSetPage( int page )
710 const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
712 if( i_teletext_es >= 0 )
714 vlc_object_t *p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
715 "zvbi", FIND_CHILD );
718 var_SetInteger( p_vbi, "vbi-page", page );
719 vlc_object_release( p_vbi );
720 emit newTelexPageSet( page );
726 /* Set the transparency on teletext */
727 void InputManager::telexSetTransparency( bool b_transparentTelextext )
731 vlc_object_t *p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
732 "zvbi", FIND_CHILD );
735 var_SetBool( p_vbi, "vbi-opaque", !b_transparentTelextext );
736 vlc_object_release( p_vbi );
737 emit teletextTransparencyActivated( b_transparentTelextext );
742 void InputManager::activateTeletext( bool b_enable )
746 if( hasInput() && !var_Change( p_input, "teletext-es", VLC_VAR_GETLIST, &list, &text ) )
748 if( list.p_list->i_count > 0 )
750 /* Prefer the page 100 if it is present */
752 for( i = 0; i < text.p_list->i_count; i++ )
754 /* The description is the page number as a string */
755 const char *psz_page = text.p_list->p_values[i].psz_string;
756 if( psz_page && !strcmp( psz_page, "100" ) )
759 if( i >= list.p_list->i_count )
761 var_SetInteger( p_input, "spu-es", b_enable ? list.p_list->p_values[i].i_int : -1 );
763 var_Change( p_input, "teletext-es", VLC_VAR_FREELIST, &list, &text );
767 void InputManager::reverse()
771 int i_rate = var_GetInteger( p_input, "rate" );
772 var_SetInteger( p_input, "rate", -i_rate );
776 void InputManager::slower()
779 var_SetVoid( p_input, "rate-slower" );
782 void InputManager::faster()
785 var_SetVoid( p_input, "rate-faster" );
788 void InputManager::littlefaster()
790 var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_RATE_FASTER_FINE );
793 void InputManager::littleslower()
795 var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_RATE_SLOWER_FINE );
798 void InputManager::normalRate()
801 var_SetInteger( p_input, "rate", INPUT_RATE_DEFAULT );
804 void InputManager::setRate( int new_rate )
807 var_SetInteger( p_input, "rate", new_rate );
810 void InputManager::jumpFwd()
812 int i_interval = config_GetInt( p_input, "short-jump-size" );
815 mtime_t val = (mtime_t)(i_interval) * 1000000L;
816 var_SetTime( p_input, "time-offset", val );
820 void InputManager::jumpBwd()
822 int i_interval = config_GetInt( p_input, "short-jump-size" );
825 mtime_t val = -1 *(mtime_t)(i_interval) * 1000000L;
826 var_SetTime( p_input, "time-offset", val );
830 void InputManager::setAtoB()
834 timeA = var_GetTime( THEMIM->getInput(), "time" );
838 timeB = var_GetTime( THEMIM->getInput(), "time" );
839 var_SetTime( THEMIM->getInput(), "time" , timeA );
840 CONNECT( this, positionUpdated( float, int, int ),
841 this, AtoBLoop( float, int, int ) );
847 disconnect( this, SIGNAL( positionUpdated( float, int, int ) ),
848 this, SLOT( AtoBLoop( float, int, int ) ) );
850 emit AtoBchanged( (timeA != 0 ), (timeB != 0 ) );
853 /* Function called regularly when in an AtoB loop */
854 void InputManager::AtoBLoop( float, int i_time, int )
858 if( ( i_time >= (int)( timeB/1000000 ) )
859 || ( i_time < (int)( timeA/1000000 ) ) )
860 var_SetTime( THEMIM->getInput(), "time" , timeA );
864 /**********************************************************************
865 * MainInputManager implementation. Wrap an input manager and
866 * take care of updating the main playlist input.
867 * Used in the main playlist Dialog
868 **********************************************************************/
869 MainInputManager * MainInputManager::instance = NULL;
871 MainInputManager::MainInputManager( intf_thread_t *_p_intf )
872 : QObject(NULL), p_intf( _p_intf )
875 im = new InputManager( this, p_intf );
877 var_AddCallback( THEPL, "item-change", ItemChanged, im );
878 var_AddCallback( THEPL, "item-current", PLItemChanged, this );
879 var_AddCallback( THEPL, "activity", PLItemChanged, this );
881 var_AddCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, this );
883 /* Warn our embedded IM about input changes */
884 CONNECT( this, inputChanged( input_thread_t * ),
885 im, setInput( input_thread_t * ) );
887 /* emit check if playlist has already started playing */
888 IMEvent *event = new IMEvent( ItemChanged_Type,
889 var_GetInteger( THEPL, "item-current" ) );
890 customEvent( event );
894 MainInputManager::~MainInputManager()
898 emit inputChanged( NULL );
899 var_DelCallback( p_input, "state", PLItemChanged, this );
900 vlc_object_release( p_input );
903 var_DelCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, this );
905 var_DelCallback( THEPL, "activity", PLItemChanged, this );
906 var_DelCallback( THEPL, "item-change", ItemChanged, im );
908 var_DelCallback( THEPL, "item-current", PLItemChanged, this );
911 vout_thread_t* MainInputManager::getVout()
913 return p_input ? input_GetVout( p_input ) : NULL;
916 aout_instance_t * MainInputManager::getAout()
918 return p_input ? input_GetAout( p_input ) : NULL;
921 void MainInputManager::customEvent( QEvent *event )
923 int type = event->type();
924 if ( type != ItemChanged_Type && type != VolumeChanged_Type )
927 // msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
928 if( type == VolumeChanged_Type )
930 emit volumeChanged();
934 /* Should be PLItemChanged Event */
935 if( !p_intf->p_sys->b_isDialogProvider )
937 if( p_input && ( p_input->b_dead || !vlc_object_alive (p_input) ) )
939 emit inputChanged( p_input );
940 var_DelCallback( p_input, "state", PLItemChanged, this );
941 vlc_object_release( p_input );
948 p_input = playlist_CurrentInput(THEPL);
951 var_AddCallback( p_input, "state", PLItemChanged, this );
952 emit inputChanged( p_input );
958 /* remove previous stored p_input */
961 vlc_object_release( p_input );
964 /* we are working as a dialogs provider */
965 playlist_t *p_playlist = pl_Hold( p_intf );
966 p_input = playlist_CurrentInput( p_playlist );
969 emit inputChanged( p_input );
971 pl_Release( p_intf );
975 /* Playlist Control functions */
976 void MainInputManager::stop()
978 playlist_Stop( THEPL );
981 void MainInputManager::next()
983 playlist_Next( THEPL );
986 void MainInputManager::prev()
988 playlist_Prev( THEPL );
991 void MainInputManager::togglePlayPause()
995 playlist_Play( THEPL );
997 getIM()->togglePlayPause();
1000 void MainInputManager::activatePlayQuit( bool b_exit )
1002 var_SetBool( THEPL, "play-and-exit", b_exit );
1005 /* Static callbacks for MIM */
1006 static int PLItemChanged( vlc_object_t *p_this, const char *psz_var,
1007 vlc_value_t oldval, vlc_value_t newval, void *param )
1009 MainInputManager *mim = (MainInputManager*)param;
1011 IMEvent *event = new IMEvent( ItemChanged_Type, newval.i_int );
1012 QApplication::postEvent( mim, event );
1016 static int VolumeChanged( vlc_object_t *p_this, const char *psz_var,
1017 vlc_value_t oldval, vlc_value_t newval, void *param )
1019 MainInputManager *mim = (MainInputManager*)param;
1021 IMEvent *event = new IMEvent( VolumeChanged_Type, newval.i_int );
1022 QApplication::postEvent( mim, event );