/**********************************************************************
* InputManager implementation
+ **********************************************************************
+ * The Input Manager can be the main one around the playlist
+ * But can also be used for VLM dialog or similar
**********************************************************************/
InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
delInput();
}
+/* Define the Input used.
+ Add the callbacks on input
+ p_input is yield once here */
void InputManager::setInput( input_thread_t *_p_input )
{
delInput();
}
}
+/* delete Input if it ever existed.
+ Delete the callbacls on input
+ p_input is released once here */
void InputManager::delInput()
{
if( p_input )
}
}
+/* Add the callbacks on Input. Self explanatory */
void InputManager::addCallbacks()
{
/* We don't care about:
var_AddCallback( p_input, "intf-change", InterfaceChanged, this );
}
+/* Delete the callbacks on Input. Self explanatory */
void InputManager::delCallbacks()
{
var_DelCallback( p_input, "audio-es", ChangeAudio, this );
var_DelCallback( p_input, "intf-change", InterfaceChanged, this );
}
+/* Convert the event from the callbacks in actions */
void InputManager::customEvent( QEvent *event )
{
int type = event->type();
- if ( type != PositionUpdate_Type && type != ItemChanged_Type &&
- type != ItemRateChanged_Type && type != ItemTitleChanged_Type &&
+ if ( type != PositionUpdate_Type &&
+ type != ItemChanged_Type &&
+ type != ItemRateChanged_Type &&
+ type != ItemTitleChanged_Type &&
type != ItemStateChanged_Type )
return;
- msg_Dbg( p_intf, "New IM Event, type: %i", type );
-
/* Delete the input */
if( !p_input || p_input->b_dead || p_input->b_die )
{
return;
}
+ /* Actions */
switch( type )
{
case PositionUpdate_Type:
var_SetFloat( p_input, "position", new_pos );
}
+/* User togglePlayPause */
void InputManager::togglePlayPause()
{
vlc_value_t state;
/**********************************************************************
* MainInputManager implementation. Wrap an input manager and
- * take care of updating the main playlist input
+ * take care of updating the main playlist input.
+ * Used in the main playlist Dialog
**********************************************************************/
MainInputManager * MainInputManager::instance = NULL;
p_input = NULL;
im = new InputManager( this, p_intf );
- // No necessary, I think
- //var_AddCallback( THEPL, "intf-change", ItemChanged, im );
-
var_AddCallback( THEPL, "item-change", PLItemChanged, this );
var_AddCallback( THEPL, "playlist-current", PLItemChanged, this );
- var_AddCallback( THEPL, "playlist-current", ItemChanged, im );
var_AddCallback( THEPL, "activity", PLItemChanged, this );
+ var_AddCallback( THEPL, "playlist-current", ItemChanged, im );
+
var_AddCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, this );
+ // No necessary, I think TODO REMOVE ME at the end
+ //var_AddCallback( THEPL, "intf-change", ItemChanged, im );
+
/* Warn our embedded IM about input changes */
CONNECT( this, inputChanged( input_thread_t * ),
im, setInput( input_thread_t * ) );
var_DelCallback( THEPL, "activity", PLItemChanged, this );
var_DelCallback( THEPL, "item-change", PLItemChanged, this );
-// var_DelCallback( THEPL, "intf-change", ItemChanged, this );
+ var_DelCallback( THEPL, "playlist-current", ItemChanged, im );
}
void MainInputManager::customEvent( QEvent *event )
return;
}
- msg_Dbg( p_intf, "New MIM Event, type: %i", type );
- /* Should be PLItemChanged */
+ /* Should be PLItemChanged Event */
if( VLC_OBJECT_INTF == p_intf->i_object_type )
{
vlc_mutex_lock( &p_intf->change_lock );