VLC 4.0.0-dev

In order to interact with the user. More...

Collaboration diagram for VLC dialog functions:

Macros

#define vlc_dialog_display_error(a, b, c, ...)    vlc_dialog_display_error(VLC_OBJECT(a), b, c, ##__VA_ARGS__)
 
#define vlc_dialog_wait_login(a, b, c, d, e, f, g, ...)    vlc_dialog_wait_login(VLC_OBJECT(a), b, c, d, e, f, g, ##__VA_ARGS__)
 
#define vlc_dialog_wait_question(a, b, c, d, e, f, g, ...)    vlc_dialog_wait_question(VLC_OBJECT(a), b, c, d, e, f, g, ##__VA_ARGS__)
 
#define vlc_dialog_display_progress(a, b, c, d, e, f, ...)    vlc_dialog_display_progress(VLC_OBJECT(a), b, c, d, e, f, ##__VA_ARGS__)
 
#define vlc_dialog_update_progress(a, b, c)    vlc_dialog_update_progress(VLC_OBJECT(a), b, c)
 
#define vlc_dialog_update_progress_text(a, b, c, d, ...)    vlc_dialog_update_progress_text(VLC_OBJECT(a), b, c, d, ##__VA_ARGS__)
 
#define vlc_dialog_release(a, b)    vlc_dialog_release(VLC_OBJECT(a), b)
 
#define vlc_dialog_is_cancelled(a, b)    vlc_dialog_is_cancelled(VLC_OBJECT(a), b)
 

Typedefs

typedef enum vlc_dialog_question_type vlc_dialog_question_type
 Dialog question type, see vlc_dialog_wait_question() More...
 

Enumerations

enum  vlc_dialog_question_type { VLC_DIALOG_QUESTION_NORMAL , VLC_DIALOG_QUESTION_WARNING , VLC_DIALOG_QUESTION_CRITICAL }
 Dialog question type, see vlc_dialog_wait_question() More...
 

Functions

int vlc_dialog_display_error (vlc_object_t *p_obj, const char *psz_title, const char *psz_fmt,...)
 Sends an error message. More...
 
int vlc_dialog_display_error_va (vlc_object_t *p_obj, const char *psz_title, const char *psz_fmt, va_list ap)
 Sends an error message. More...
 
int vlc_dialog_wait_login (vlc_object_t *p_obj, char **ppsz_username, char **ppsz_password, bool *p_store, const char *psz_default_username, const char *psz_title, const char *psz_fmt,...)
 Requests an user name and a password. More...
 
int vlc_dialog_wait_login_va (vlc_object_t *p_obj, char **ppsz_username, char **ppsz_password, bool *p_store, const char *psz_default_username, const char *psz_title, const char *psz_fmt, va_list ap)
 Requests an user name and a password. More...
 
int vlc_dialog_wait_question (vlc_object_t *p_obj, vlc_dialog_question_type i_type, const char *psz_cancel, const char *psz_action1, const char *psz_action2, const char *psz_title, const char *psz_fmt,...)
 Asks a total (Yes/No/Cancel) question. More...
 
int vlc_dialog_wait_question_va (vlc_object_t *p_obj, vlc_dialog_question_type i_type, const char *psz_cancel, const char *psz_action1, const char *psz_action2, const char *psz_title, const char *psz_fmt, va_list ap)
 Asks a total (Yes/No/Cancel) question. More...
 
vlc_dialog_idvlc_dialog_display_progress (vlc_object_t *p_obj, bool b_indeterminate, float f_position, const char *psz_cancel, const char *psz_title, const char *psz_fmt,...)
 Display a progress dialog. More...
 
vlc_dialog_idvlc_dialog_display_progress_va (vlc_object_t *p_obj, bool b_indeterminate, float f_position, const char *psz_cancel, const char *psz_title, const char *psz_fmt, va_list ap)
 Display a progress dialog. More...
 
int vlc_dialog_update_progress (vlc_object_t *p_obj, vlc_dialog_id *p_id, float f_position)
 Update the position of the progress dialog. More...
 
int vlc_dialog_update_progress_text (vlc_object_t *p_obj, vlc_dialog_id *p_id, float f_position, const char *psz_fmt,...)
 Update the position and the message of the progress dialog. More...
 
int vlc_dialog_update_progress_text_va (vlc_object_t *p_obj, vlc_dialog_id *p_id, float f_position, const char *psz_fmt, va_list ap)
 Update the position and the message of the progress dialog. More...
 
void vlc_dialog_release (vlc_object_t *p_obj, vlc_dialog_id *p_id)
 Release the dialog id returned by vlc_dialog_display_progress() More...
 
bool vlc_dialog_is_cancelled (vlc_object_t *p_obj, vlc_dialog_id *p_id)
 Return true if the dialog id is cancelled. More...
 

Detailed Description

In order to interact with the user.

Macro Definition Documentation

◆ vlc_dialog_display_error

#define vlc_dialog_display_error (   a,
  b,
  c,
  ... 
)     vlc_dialog_display_error(VLC_OBJECT(a), b, c, ##__VA_ARGS__)

◆ vlc_dialog_display_progress

#define vlc_dialog_display_progress (   a,
  b,
  c,
  d,
  e,
  f,
  ... 
)     vlc_dialog_display_progress(VLC_OBJECT(a), b, c, d, e, f, ##__VA_ARGS__)

◆ vlc_dialog_is_cancelled

#define vlc_dialog_is_cancelled (   a,
 
)     vlc_dialog_is_cancelled(VLC_OBJECT(a), b)

◆ vlc_dialog_release

#define vlc_dialog_release (   a,
 
)     vlc_dialog_release(VLC_OBJECT(a), b)

◆ vlc_dialog_update_progress

#define vlc_dialog_update_progress (   a,
  b,
 
)     vlc_dialog_update_progress(VLC_OBJECT(a), b, c)

◆ vlc_dialog_update_progress_text

#define vlc_dialog_update_progress_text (   a,
  b,
  c,
  d,
  ... 
)     vlc_dialog_update_progress_text(VLC_OBJECT(a), b, c, d, ##__VA_ARGS__)

◆ vlc_dialog_wait_login

#define vlc_dialog_wait_login (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  ... 
)     vlc_dialog_wait_login(VLC_OBJECT(a), b, c, d, e, f, g, ##__VA_ARGS__)

◆ vlc_dialog_wait_question

#define vlc_dialog_wait_question (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  ... 
)     vlc_dialog_wait_question(VLC_OBJECT(a), b, c, d, e, f, g, ##__VA_ARGS__)

Typedef Documentation

◆ vlc_dialog_question_type

Enumeration Type Documentation

◆ vlc_dialog_question_type

Dialog question type, see vlc_dialog_wait_question()

Enumerator
VLC_DIALOG_QUESTION_NORMAL 
VLC_DIALOG_QUESTION_WARNING 
VLC_DIALOG_QUESTION_CRITICAL 

Function Documentation

◆ vlc_dialog_display_error()

int vlc_dialog_display_error ( vlc_object_t p_obj,
const char *  psz_title,
const char *  psz_fmt,
  ... 
)

Sends an error message.

This function returns immediately

Parameters
p_objthe VLC object emitting the error
psz_titletitle of the error dialog
psz_fmtformat string for the error message
Returns
VLC_SUCCESS on success, or a VLC error code on error

References vlc_dialog_display_error_va().

◆ vlc_dialog_display_error_va()

int vlc_dialog_display_error_va ( vlc_object_t p_obj,
const char *  psz_title,
const char *  psz_fmt,
va_list  ap 
)

Sends an error message.

Equivalent to vlc_dialog_display_error() expect that it's called with a va_list.

References dialog_display_error_va(), get_dialog_provider(), msg_Err, msg_GenericVa, dialog_i11e_context::p_provider, VLC_EGENERIC, VLC_MSG_ERR, and VLC_SUCCESS.

Referenced by vlc_dialog_display_error().

◆ vlc_dialog_display_progress()

vlc_dialog_id * vlc_dialog_display_progress ( vlc_object_t p_obj,
bool  b_indeterminate,
float  f_position,
const char *  psz_cancel,
const char *  psz_title,
const char *  psz_fmt,
  ... 
)

Display a progress dialog.

This function returns immediately

Parameters
p_objthe VLC object emitting the dialog
b_indeterminatetrue if the progress dialog is indeterminate
f_positioninitial position of the progress bar (between 0.0 and 1.0)
psz_canceltext of the cancel button, if NULL the dialog is not cancellable (optional)
psz_titletitle of the progress dialog
psz_fmtformat string for the progress message
Returns
a valid vlc_dialog_id on success, must be released with vlc_dialog_id_release()

References vlc_dialog_display_progress_va().

◆ vlc_dialog_display_progress_va()

vlc_dialog_id * vlc_dialog_display_progress_va ( vlc_object_t p_obj,
bool  b_indeterminate,
float  f_position,
const char *  psz_cancel,
const char *  psz_title,
const char *  psz_fmt,
va_list  ap 
)

Display a progress dialog.

Equivalent to vlc_dialog_display_progress() expect that it's called with a va_list.

References display_progress_va(), get_dialog_provider(), and VLC_SUCCESS.

Referenced by vlc_dialog_display_progress().

◆ vlc_dialog_is_cancelled()

bool vlc_dialog_is_cancelled ( vlc_object_t p_obj,
vlc_dialog_id p_id 
)

Return true if the dialog id is cancelled.

Parameters
p_objthe VLC object emitting the dialog
p_idid of the dialog

References vlc_dialog_id::b_cancelled, vlc_dialog_id::lock, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by dialog_update_progress().

◆ vlc_dialog_release()

void vlc_dialog_release ( vlc_object_t p_obj,
vlc_dialog_id p_id 
)

Release the dialog id returned by vlc_dialog_display_progress()

It causes the vlc_dialog_cbs.pf_cancel() callback to be invoked.

Parameters
p_objthe VLC object emitting the dialog
p_idid of the dialog to release

References dialog_cancel_locked(), dialog_remove_locked(), get_dialog_provider(), vlc_dialog_provider::lock, vlc_mutex_lock(), and vlc_mutex_unlock().

◆ vlc_dialog_update_progress()

int vlc_dialog_update_progress ( vlc_object_t p_obj,
vlc_dialog_id p_id,
float  f_position 
)

Update the position of the progress dialog.

Parameters
p_objthe VLC object emitting the dialog
p_idid of the dialog to update
f_positionposition of the progress bar (between 0.0 and 1.0)
Returns
VLC_SUCCESS on success, or a VLC error code on error

References dialog_update_progress(), and f_value.

◆ vlc_dialog_update_progress_text()

int vlc_dialog_update_progress_text ( vlc_object_t p_obj,
vlc_dialog_id p_id,
float  f_position,
const char *  psz_fmt,
  ... 
)

Update the position and the message of the progress dialog.

Parameters
p_objthe VLC object emitting the dialog
p_idid of the dialog to update
f_positionposition of the progress bar (between 0.0 and 1.0)
psz_fmtformat string for the progress message
Returns
VLC_SUCCESS on success, or a VLC error code on error

References f_value, and vlc_dialog_update_progress_text_va().

◆ vlc_dialog_update_progress_text_va()

int vlc_dialog_update_progress_text_va ( vlc_object_t p_obj,
vlc_dialog_id p_id,
float  f_position,
const char *  psz_fmt,
va_list  ap 
)

Update the position and the message of the progress dialog.

Equivalent to vlc_dialog_update_progress_text() expect that it's called with a va_list.

References dialog_update_progress(), f_value, vasprintf(), and VLC_ENOMEM.

Referenced by vlc_dialog_update_progress_text().

◆ vlc_dialog_wait_login()

int vlc_dialog_wait_login ( vlc_object_t p_obj,
char **  ppsz_username,
char **  ppsz_password,
bool *  p_store,
const char *  psz_default_username,
const char *  psz_title,
const char *  psz_fmt,
  ... 
)

Requests an user name and a password.

This function waits until the user dismisses the dialog or responds. It's interruptible via vlc_interrupt. In that case, vlc_dialog_cbs.pf_cancel() will be invoked. If p_store is not NULL, the user will be asked to store the password or not.

Parameters
p_objthe VLC object emitting the dialog
ppsz_usernamea pointer to the user name provided by the user, it must be freed with free() on success
ppsz_passworda pointer to the password provided by the user, it must be freed with free() on success
p_storea pointer to the store answer provided by the user (optional)
psz_default_usernamedefault user name proposed
psz_titletitle of the login dialog
psz_fmtformat string for the login message
Returns
< 0 on error, 0 if the user cancelled it, and 1 if ppsz_username and ppsz_password are valid.

References vlc_dialog_wait_login_va().

◆ vlc_dialog_wait_login_va()

int vlc_dialog_wait_login_va ( vlc_object_t p_obj,
char **  ppsz_username,
char **  ppsz_password,
bool *  p_store,
const char *  psz_default_username,
const char *  psz_title,
const char *  psz_fmt,
va_list  ap 
)

◆ vlc_dialog_wait_question()

int vlc_dialog_wait_question ( vlc_object_t p_obj,
vlc_dialog_question_type  i_type,
const char *  psz_cancel,
const char *  psz_action1,
const char *  psz_action2,
const char *  psz_title,
const char *  psz_fmt,
  ... 
)

Asks a total (Yes/No/Cancel) question.

This function waits until the user dismisses the dialog or responds. It's interruptible via vlc_interrupt. In that case, vlc_dialog_cbs.pf_cancel() will be invoked. The psz_cancel is mandatory since this dialog is always cancellable by the user.

Parameters
p_objthe VLC object emitting the dialog
i_typequestion type (severity of the question)
psz_canceltext of the cancel button
psz_action1first choice/button text (optional)
psz_action2second choice/button text (optional)
psz_titletitle of the question dialog
psz_fmtformat string for the question message
Returns
< 0 on error, 0 if the user cancelled it, 1 on action1, 2 on action2

References i_type, and vlc_dialog_wait_question_va().

◆ vlc_dialog_wait_question_va()

int vlc_dialog_wait_question_va ( vlc_object_t p_obj,
vlc_dialog_question_type  i_type,
const char *  psz_cancel,
const char *  psz_action1,
const char *  psz_action2,
const char *  psz_title,
const char *  psz_fmt,
va_list  ap 
)

Asks a total (Yes/No/Cancel) question.

Equivalent to vlc_dialog_wait_question() expect that it's called with a va_list.

References dialog_display_question_va(), dialog_wait(), get_dialog_provider(), dialog_answer::i_action, i_type, dialog_answer::question, dialog_answer::u, VLC_DIALOG_QUESTION, and VLC_EGENERIC.

Referenced by vlc_dialog_wait_question().