VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
dialog.c File Reference

User dialogs core. More...

Include dependency graph for dialog.c:

Functions

int dialog_Register (((vlc_object_t *)(vlc_object_t *obj)))
 Registers an object as the dialog provider.
int dialog_Unregister (((vlc_object_t *)(vlc_object_t *obj)))
 Unregisters the dialog provider.
static vlc_object_tdialog_GetProvider (vlc_object_t *obj)
void dialog_VFatal (vlc_object_t *obj, bool modal, const char *title, const char *fmt, va_list ap)
 Sends an error message through the user interface (if any).
void dialog_Login (((vlc_object_t *)(vlc_object_t *obj)), char **username, char **password, const char *title, const char *fmt,...)
 Requests a username and password through the user interface.
int dialog_Question (((vlc_object_t *)(vlc_object_t *obj)), const char *title, const char *fmt, const char *yes, const char *no, const char *cancel,...)
 Asks a total (Yes/No/Cancel) question through the user interface.
dialog_progress_bar_tdialog_ProgressCreate (((vlc_object_t *)(vlc_object_t *obj)), const char *title, const char *message, const char *cancel)
 Creates a progress bar dialog.
void dialog_ProgressDestroy (dialog_progress_bar_t *dialog)
void dialog_ProgressSet (dialog_progress_bar_t *dialog, const char *text, float value)
bool dialog_ProgressCancelled (dialog_progress_bar_t *dialog)
int dialog_ExtensionUpdate (((vlc_object_t *)(vlc_object_t *obj)), extension_dialog_t *dialog)

Variables

static vlc_mutex_t provider_lock = PTHREAD_MUTEX_INITIALIZER

Detailed Description

User dialogs core.

Function Documentation

int dialog_ExtensionUpdate ( ((vlc_object_t *)(vlc_object_t *obj))  ,
extension_dialog_t dialog 
)
static vlc_object_t* dialog_GetProvider ( vlc_object_t obj)
static
void dialog_Login ( ((vlc_object_t *)(vlc_object_t *obj))  ,
char **  username,
char **  password,
const char *  title,
const char *  fmt,
  ... 
)

Requests a username and password through the user interface.

Parameters
objthe VLC object requesting credential information
usernamea pointer to the specified username [OUT]
passworda pointer to the specified password [OUT]
titletitle for the dialog
textformat string for the message in the dialog
Returns
Nothing. If a user name resp. a password was specified, it will be returned as a heap-allocated character array into the username resp password pointer. Those must be freed with free(). Otherwise *username resp *password will be NULL.

References dialog_GetProvider(), vlc_object_t::i_flags, OBJECT_FLAGS_NOINTERACT, text, var_SetAddress, vasprintf(), and vlc_object_release.

bool dialog_ProgressCancelled ( dialog_progress_bar_t dialog)
dialog_progress_bar_t* dialog_ProgressCreate ( ((vlc_object_t *)(vlc_object_t *obj))  ,
const char *  title,
const char *  message,
const char *  cancel 
)
void dialog_ProgressDestroy ( dialog_progress_bar_t dialog)
void dialog_ProgressSet ( dialog_progress_bar_t dialog,
const char *  text,
float  value 
)
int dialog_Question ( ((vlc_object_t *)(vlc_object_t *obj))  ,
const char *  title,
const char *  fmt,
const char *  yes,
const char *  no,
const char *  cancel,
  ... 
)

Asks a total (Yes/No/Cancel) question through the user interface.

Parameters
objVLC object emitting the question
titledialog box title
fmtformat string for the dialog box text
yesfirst choice/button text
nosecond choice/button text
cancelthird answer/button text, or NULL if no third option
Returns
0 if the user could not answer the question (e.g. there is no UI), 1, 2 resp. 3 if the user pressed the first, second resp. third button.

References dialog_question_t::answer, dialog_GetProvider(), vlc_object_t::i_flags, OBJECT_FLAGS_NOINTERACT, text, var_SetAddress, vasprintf(), and vlc_object_release.

int dialog_Register ( ((vlc_object_t *)(vlc_object_t *obj))  )

Registers an object as the dialog provider.

It is assumed that the appropriate variable callbacks are already registered.

< Unspecified error

< No error

References libvlc_priv(), libvlc_priv_t::p_dialog_provider, vlc_object_t::p_libvlc, provider_lock, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.

int dialog_Unregister ( ((vlc_object_t *)(vlc_object_t *obj))  )

Unregisters the dialog provider.

Note that unless you have unregistered the callbacks already, the provider might still be in use by other threads. Also, you need to cancel all pending dialogs yourself.

< Unspecified error

< No error

References libvlc_priv(), libvlc_priv_t::p_dialog_provider, vlc_object_t::p_libvlc, provider_lock, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.

void dialog_VFatal ( vlc_object_t obj,
bool  modal,
const char *  title,
const char *  fmt,
va_list  ap 
)

Sends an error message through the user interface (if any).

Parameters
objthe VLC object emitting the error
modalwhether to wait for user to acknowledge the error before returning control to the caller
titletitle of the error dialog
fmtformat string for the error message
apparameters list for the formatted error message

References dialog_GetProvider(), vlc_object_t::i_flags, msg_Err, msg_GenericVa, OBJECT_FLAGS_NOINTERACT, text, var_SetAddress, vasprintf(), VLC_MSG_ERR, and vlc_object_release.

Referenced by dialog_Fatal(), and dialog_FatalWait().

Variable Documentation

vlc_mutex_t provider_lock = PTHREAD_MUTEX_INITIALIZER
static