Commit 45056557 authored by Ilkka Ollakka's avatar Ilkka Ollakka

add rate-change variable in core to inform when rate changes, and change

qt4-interface to use it. var_Change doesn't trigger callback so earlier
version about adding callback to it worked someway as intented only by
luck ;)
parent f6aab8b8
...@@ -137,9 +137,7 @@ void InputManager::addCallbacks() ...@@ -137,9 +137,7 @@ void InputManager::addCallbacks()
/* src/input/es-out.c:551 */ /* src/input/es-out.c:551 */
var_AddCallback( p_input, "video-es", ChangeVideo, this ); var_AddCallback( p_input, "video-es", ChangeVideo, this );
/* src/input/input.c:1765 */ /* src/input/input.c:1765 */
var_AddCallback( p_input, "rate", ItemRateChanged, this ); var_AddCallback( p_input, "rate-change", ItemRateChanged, this );
var_AddCallback( p_input, "rate-faster", ItemRateChanged, this );
var_AddCallback( p_input, "rate-slower", ItemRateChanged, this );
/* src/input/input.c:2003 */ /* src/input/input.c:2003 */
var_AddCallback( p_input, "title", ItemTitleChanged, this ); var_AddCallback( p_input, "title", ItemTitleChanged, this );
/* src/input/input.c:734 for timers update*/ /* src/input/input.c:734 for timers update*/
...@@ -152,9 +150,7 @@ void InputManager::delCallbacks() ...@@ -152,9 +150,7 @@ void InputManager::delCallbacks()
var_DelCallback( p_input, "audio-es", ChangeAudio, this ); var_DelCallback( p_input, "audio-es", ChangeAudio, this );
var_DelCallback( p_input, "video-es", ChangeVideo, this ); var_DelCallback( p_input, "video-es", ChangeVideo, this );
var_DelCallback( p_input, "state", ItemStateChanged, this ); var_DelCallback( p_input, "state", ItemStateChanged, this );
var_DelCallback( p_input, "rate", ItemRateChanged, this ); var_DelCallback( p_input, "rate-change", ItemRateChanged, this );
var_DelCallback( p_input, "rate-faster", ItemRateChanged, this );
var_DelCallback( p_input, "rate-slower", ItemRateChanged, this );
var_DelCallback( p_input, "title", ItemTitleChanged, this ); var_DelCallback( p_input, "title", ItemTitleChanged, this );
var_DelCallback( p_input, "intf-change", InterfaceChanged, this ); var_DelCallback( p_input, "intf-change", InterfaceChanged, this );
} }
......
...@@ -116,6 +116,7 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta ...@@ -116,6 +116,7 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta
* - can-pause * - can-pause
* * For intf callback upon changes * * For intf callback upon changes
* - intf-change * - intf-change
* - rate-change for when playback rate changes
* TODO explain when Callback is called * TODO explain when Callback is called
* TODO complete this list (?) * TODO complete this list (?)
*****************************************************************************/ *****************************************************************************/
...@@ -1768,6 +1769,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1768,6 +1769,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
{ {
val.i_int = i_rate; val.i_int = i_rate;
var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL );
var_SetBool( p_input, "rate-change", VLC_TRUE );
p_input->p->i_rate = i_rate; p_input->p->i_rate = i_rate;
......
...@@ -194,9 +194,14 @@ void input_ControlVarInit ( input_thread_t *p_input ) ...@@ -194,9 +194,14 @@ void input_ControlVarInit ( input_thread_t *p_input )
{ {
/* Special "intf-change" variable, it allows intf to set up a callback /* Special "intf-change" variable, it allows intf to set up a callback
* to be notified of some changes. * to be notified of some changes.
*
* Add rate-change to inform about rate changin
*
* TODO list all changes warn by this callbacks */ * TODO list all changes warn by this callbacks */
var_Create( p_input, "intf-change", VLC_VAR_BOOL ); var_Create( p_input, "intf-change", VLC_VAR_BOOL );
var_SetBool( p_input, "intf-change", VLC_TRUE ); var_SetBool( p_input, "intf-change", VLC_TRUE );
var_Create( p_input, "rate-change", VLC_VAR_BOOL );
var_SetBool( p_input, "rate-change", VLC_TRUE );
} }
#undef ADD_CALLBACK #undef ADD_CALLBACK
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment