#define intf_IntfProgress( a, b, c ) __intf_Progress( VLC_OBJECT(a), NULL, b,c, -1 )
#define intf_UserProgress( a, b, c, d, e ) __intf_Progress( VLC_OBJECT(a),b,c,d,e )
VLC_EXPORT( interaction_dialog_t *, __intf_Progress,( vlc_object_t*, const char*, const char*, float, int) );
-#define intf_ProgressUpdate( a, b, c, d, e ) __intf_ProgressUpdate( VLC_OBJECT(a),b,c,d,e )
-VLC_EXPORT( void, __intf_ProgressUpdate,( vlc_object_t*, interaction_dialog_t *, const char*, float, int) );
-#define intf_ProgressIsCancelled( a, b ) __intf_UserProgressIsCancelled( VLC_OBJECT(a),b )
-VLC_EXPORT( bool, __intf_UserProgressIsCancelled,( vlc_object_t*, interaction_dialog_t * ) );
-#define intf_UserHide( a, b ) __intf_UserHide( VLC_OBJECT(a), b )
-VLC_EXPORT( void, __intf_UserHide,( vlc_object_t *, interaction_dialog_t * ));
+VLC_EXPORT( void, intf_ProgressUpdate,( interaction_dialog_t *, const char*, float, int) );
+VLC_EXPORT( bool, intf_ProgressIsCancelled,( interaction_dialog_t * ) );
+VLC_EXPORT( void, intf_UserHide,( interaction_dialog_t * ));
/** @} */
/** @} */
void scan_Clean( scan_t *p_scan )
{
if( p_scan->p_dialog != NULL )
- intf_UserHide( p_scan->p_obj, p_scan->p_dialog );
+ intf_UserHide( p_scan->p_dialog );
for( int i = 0; i < p_scan->i_service; i++ )
scan_service_Delete( p_scan->pp_service[i] );
if( p_scan->p_dialog == NULL )
p_scan->p_dialog = intf_UserProgress( p_scan->p_obj, _("Scanning DVB-T"), psz_text, 100.0 * f_position, -1 );
else
- intf_ProgressUpdate( p_scan->p_obj, p_scan->p_dialog, psz_text, 100 * f_position, -1 );
+ intf_ProgressUpdate( p_scan->p_dialog, psz_text, 100 * f_position, -1 );
free( psz_text );
}
bool scan_IsCancelled( scan_t *p_scan )
{
- return p_scan->p_dialog && intf_ProgressIsCancelled( p_scan->p_obj, p_scan->p_dialog );
+ return p_scan->p_dialog && intf_ProgressIsCancelled( p_scan->p_dialog );
}
static scan_service_t *ScanFindService( scan_t *p_scan, int i_service_start, int i_program )
/* Don't update/check dialog too often */
if( p_dialog && mdate() - i_dialog_update > 100000 )
{
- if( intf_ProgressIsCancelled( p_demux, p_dialog ) )
+ if( intf_ProgressIsCancelled( p_dialog ) )
break;
double f_pos = 100.0 * stream_Tell( p_demux->s ) /
stream_Size( p_demux->s );
- intf_ProgressUpdate( p_demux, p_dialog,
+ intf_ProgressUpdate( p_dialog,
_( "Fixing AVI Index..." ), f_pos, -1 );
i_dialog_update = mdate();
print_stat:
if( p_dialog != NULL )
- intf_UserHide( p_demux, p_dialog );
+ intf_UserHide( p_dialog );
for( i_stream = 0; i_stream < p_sys->i_track; i_stream++ )
{
/**
* Update a progress bar in a dialogue
*
- * \param p_this Parent vlc_object
* \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( vlc_object_t *p_this,
- interaction_dialog_t *p_dialog,
+void intf_ProgressUpdate( interaction_dialog_t *p_dialog,
const char *psz_status, float f_pos, int i_time )
{
- interaction_t *p_interaction = InteractionGet( p_this );
-
- if( !p_interaction ) return;
+ interaction_t *p_interaction = InteractionGet( p_dialog->p_parent );
+ assert( p_interaction );
vlc_object_lock( p_interaction );
free( p_dialog->psz_description );
* Helper function to communicate dialogue cancellations between the
* interface module and the caller
*
- * \param p_this Parent vlc_object
* \param p_dialog Dialog
* \return Either true or false
*/
-bool __intf_UserProgressIsCancelled( vlc_object_t *p_this,
- interaction_dialog_t *p_dialog )
+bool intf_ProgressIsCancelled( interaction_dialog_t *p_dialog )
{
- interaction_t *p_interaction = InteractionGet( p_this );
+ interaction_t *p_interaction = InteractionGet( p_dialog->p_parent );
bool b_cancel;
- if( !p_interaction ) return true;
-
+ assert( p_interaction );
vlc_object_lock( p_interaction );
b_cancel = p_dialog->b_cancelled;
vlc_object_unlock( p_interaction );
/**
* Hide an interaction dialog
*
- * \param p_this the parent vlc object
* \param p_dialog the dialog to hide
* \return nothing
*/
-void __intf_UserHide( vlc_object_t *p_this, interaction_dialog_t *p_dialog )
+void intf_UserHide( interaction_dialog_t *p_dialog )
{
- interaction_t *p_interaction = InteractionGet( p_this );
-
- if( !p_interaction ) return;
+ interaction_t *p_interaction = InteractionGet( p_dialog->p_parent );
+ assert( p_interaction );
vlc_object_lock( p_interaction );
p_dialog->i_status = ANSWERED_DIALOG;
* The following functions are local
**********************************************************************/
-/* Get the interaction object. Create it if needed */
+/* Get the interaction object */
static interaction_t * InteractionGet( vlc_object_t *p_this )
{
interaction_t *obj = libvlc_priv(p_this->p_libvlc)->p_interaction;
* if required */
static int DialogSend( vlc_object_t *p_this, interaction_dialog_t *p_dialog )
{
- interaction_t *p_interaction = InteractionGet( p_this );
+ interaction_t *p_interaction = InteractionGet( p_dialog->p_parent );
if( !p_interaction )
return VLC_EGENERIC;
__intf_Create
__intf_Eject
__intf_Progress
-__intf_ProgressUpdate
+intf_ProgressIsCancelled
+intf_ProgressUpdate
intf_RunThread
intf_StopThread
__intf_UserFatal
-__intf_UserHide
+intf_UserHide
__intf_UserLoginPassword
-__intf_UserProgressIsCancelled
__intf_UserStringInput
__intf_UserWarn
__intf_UserYesNo
vlc_object_lock( p_udt );
while( vlc_object_alive( p_udt ) &&
( i_read = stream_Read( p_stream, p_buffer, 1 << 10 ) ) &&
- !intf_ProgressIsCancelled( p_udt, p_progress ) )
+ !intf_ProgressIsCancelled( p_progress ) )
{
vlc_object_unlock( p_udt );
if( fwrite( p_buffer, i_read, 1, p_file ) < 1 )
p_update->release.psz_url, psz_downloaded, psz_size,
f_progress ) != -1 )
{
- intf_ProgressUpdate( p_udt, p_progress, psz_status, f_progress, 0 );
+ intf_ProgressUpdate( p_progress, psz_status, f_progress, 0 );
free( psz_status );
}
free( psz_downloaded );
p_file = NULL;
if( vlc_object_alive( p_udt ) &&
- !intf_ProgressIsCancelled( p_udt, p_progress ) )
+ !intf_ProgressIsCancelled( p_progress ) )
{
vlc_object_unlock( p_udt );
if( asprintf( &psz_status, _("%s\nDone %s (100.0%%)"),
p_update->release.psz_url, psz_size ) != -1 )
{
- intf_ProgressUpdate( p_udt, p_progress, psz_status, 100.0, 0 );
+ intf_ProgressUpdate( p_progress, psz_status, 100.0, 0 );
p_progress = NULL
free( psz_status );
}
end:
if( p_progress )
{
- intf_ProgressUpdate( p_udt, p_progress, _("Cancelled"), 100.0, 0 );
+ intf_ProgressUpdate( p_progress, _("Cancelled"), 100.0, 0 );
}
if( p_stream )
stream_Delete( p_stream );