-/**
- * Helper function to create a dialogue showing a progress-bar with some info
- *
- * \param p_this Parent vlc_object
- * \param psz_title Title for the dialog (NULL implies main intf )
- * \param psz_status Current status
- * \param f_position Current position (0.0->100.0)
- * \param i_timeToGo Time (in sec) to go until process is finished
- * \return Dialog, for use with UserProgressUpdate
- */
-interaction_dialog_t *
-__intf_Progress( vlc_object_t *p_this, const char *psz_title,
- const char *psz_status, float f_pos, int i_time )
-{
- DIALOG_INIT( ONEWAY, NULL );
- p_new->psz_description = strdup( psz_status );
- p_new->val.f_float = f_pos;
- p_new->i_timeToGo = i_time;
- p_new->psz_alternate_button = strdup( _( "Cancel" ) );
-
- if( psz_title )
- {
- p_new->psz_title = strdup( psz_title );
- p_new->i_flags = DIALOG_USER_PROGRESS;
- }
- else
- p_new->i_flags = DIALOG_INTF_PROGRESS;
-
- if( DialogSend( p_new ) == VLC_EGENERIC )
- {
- DialogDestroy( p_new );
- return NULL;
- }
- return p_new;
-}
-
-/**
- * Update a progress bar in a dialogue
- *
- * \param p_dialog Dialog
- * \param psz_status New status
- * \param f_position New position (0.0->100.0)
- * \param i_timeToGo Time (in sec) to go until process is finished
- * \return nothing
- */
-void intf_ProgressUpdate( interaction_dialog_t *p_dialog,
- const char *psz_status, float f_pos, int i_time )
-{
- interaction_t *p_interaction = InteractionGet( p_dialog->p_parent );
- assert( p_interaction );
-
- vlc_mutex_lock( &p_interaction->lock );
- free( p_dialog->psz_description );
- p_dialog->psz_description = strdup( psz_status );
-
- p_dialog->val.f_float = f_pos;
- p_dialog->i_timeToGo = i_time;
-
- p_dialog->i_status = UPDATED_DIALOG;
-
- vlc_cond_signal( &p_interaction->wait );
- vlc_mutex_unlock( &p_interaction->lock );
- vlc_object_release( p_interaction );
-}
-
-/**
- * Helper function to communicate dialogue cancellations between the
- * interface module and the caller
- *
- * \param p_dialog Dialog
- * \return Either true or false
- */
-bool intf_ProgressIsCancelled( interaction_dialog_t *p_dialog )
-{
- interaction_t *p_interaction = InteractionGet( p_dialog->p_parent );
- bool b_cancel;
-
- assert( p_interaction );
- vlc_mutex_lock( &p_interaction->lock );
- b_cancel = p_dialog->b_cancelled;
- vlc_mutex_unlock( &p_interaction->lock );
- vlc_object_release( p_interaction );
- return b_cancel;
-}
-
-/**
- * Hide an interaction dialog
- *
- * \param p_dialog the dialog to hide
- * \return nothing
- */
-void intf_UserHide( interaction_dialog_t *p_dialog )
-{
- interaction_t *p_interaction = InteractionGet( p_dialog->p_parent );
- assert( p_interaction );
-
- vlc_mutex_lock( &p_interaction->lock );
- p_dialog->i_status = ANSWERED_DIALOG;
- vlc_cond_signal( &p_interaction->wait );
- vlc_mutex_unlock( &p_interaction->lock );
- vlc_object_release( p_interaction );
-}
-