Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
89518a71
Commit
89518a71
authored
Dec 12, 2005
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for Yes/No questions (Refs:#27)
parent
e8279dba
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
4 deletions
+51
-4
include/vlc/vlc.h
include/vlc/vlc.h
+1
-1
include/vlc_interaction.h
include/vlc_interaction.h
+4
-1
include/vlc_symbols.h
include/vlc_symbols.h
+5
-1
src/interface/interaction.c
src/interface/interaction.c
+41
-1
No files found.
include/vlc/vlc.h
View file @
89518a71
include/vlc_interaction.h
View file @
89518a71
...
@@ -74,7 +74,8 @@ struct interaction_dialog_t
...
@@ -74,7 +74,8 @@ struct interaction_dialog_t
#define DIALOG_OK_CANCEL 0x02
#define DIALOG_OK_CANCEL 0x02
#define DIALOG_YES_NO 0x04
#define DIALOG_YES_NO 0x04
#define DIALOG_YES_NO_CANCEL 0x04
#define DIALOG_YES_NO_CANCEL 0x04
#define DIALOG_GOT_ANSWER 0x08
#define DIALOG_CLEAR_NOSHOW 0x08
#define DIALOG_GOT_ANSWER 0x10
/**
/**
* Possible return codes
* Possible return codes
...
@@ -159,6 +160,8 @@ VLC_EXPORT( int,__intf_Interact,( vlc_object_t *,interaction_dialog_t * ) );
...
@@ -159,6 +160,8 @@ VLC_EXPORT( int,__intf_Interact,( vlc_object_t *,interaction_dialog_t * ) );
VLC_EXPORT
(
void
,
__intf_UserFatal
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
...)
);
VLC_EXPORT
(
void
,
__intf_UserFatal
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
...)
);
#define intf_UserLoginPassword( a, b, c, d, e... ) __intf_UserLoginPassword( a,b,c,d,e)
#define intf_UserLoginPassword( a, b, c, d, e... ) __intf_UserLoginPassword( a,b,c,d,e)
VLC_EXPORT
(
int
,
__intf_UserLoginPassword
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
char
**
,
char
**
)
);
VLC_EXPORT
(
int
,
__intf_UserLoginPassword
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
char
**
,
char
**
)
);
#define intf_UserYesNo( a, b, c ) __intf_UserYesNo( a,b,c )
VLC_EXPORT
(
int
,
__intf_UserYesNo
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
)
);
VLC_EXPORT
(
void
,
intf_InteractionManage
,(
playlist_t
*
)
);
VLC_EXPORT
(
void
,
intf_InteractionManage
,(
playlist_t
*
)
);
VLC_EXPORT
(
void
,
intf_InteractionDestroy
,(
interaction_t
*
)
);
VLC_EXPORT
(
void
,
intf_InteractionDestroy
,(
interaction_t
*
)
);
include/vlc_symbols.h
View file @
89518a71
...
@@ -332,9 +332,9 @@ void intf_InteractionManage (playlist_t *);
...
@@ -332,9 +332,9 @@ void intf_InteractionManage (playlist_t *);
char
*
mstrtime
(
char
*
psz_buffer
,
mtime_t
date
);
char
*
mstrtime
(
char
*
psz_buffer
,
mtime_t
date
);
void
aout_FormatPrepare
(
audio_sample_format_t
*
p_format
);
void
aout_FormatPrepare
(
audio_sample_format_t
*
p_format
);
void
spu_DisplaySubpicture
(
spu_t
*
,
subpicture_t
*
);
void
spu_DisplaySubpicture
(
spu_t
*
,
subpicture_t
*
);
int
intf_RunThread
(
intf_thread_t
*
);
int
httpd_StreamSend
(
httpd_stream_t
*
,
uint8_t
*
p_data
,
int
i_data
);
int
httpd_StreamSend
(
httpd_stream_t
*
,
uint8_t
*
p_data
,
int
i_data
);
decoder_t
*
input_DecoderNew
(
input_thread_t
*
,
es_format_t
*
,
vlc_bool_t
b_force_decoder
);
decoder_t
*
input_DecoderNew
(
input_thread_t
*
,
es_format_t
*
,
vlc_bool_t
b_force_decoder
);
int
intf_RunThread
(
intf_thread_t
*
);
xml_t
*
__xml_Create
(
vlc_object_t
*
);
xml_t
*
__xml_Create
(
vlc_object_t
*
);
msg_subscription_t
*
__msg_Subscribe
(
vlc_object_t
*
);
msg_subscription_t
*
__msg_Subscribe
(
vlc_object_t
*
);
const
char
*
VLC_Version
(
void
);
const
char
*
VLC_Version
(
void
);
...
@@ -387,6 +387,7 @@ vlm_schedule_t * vlm_ScheduleNew (vlm_t *, const char *);
...
@@ -387,6 +387,7 @@ vlm_schedule_t * vlm_ScheduleNew (vlm_t *, const char *);
int
osd_ShowTextAbsolute
(
spu_t
*
,
int
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
,
mtime_t
);
int
osd_ShowTextAbsolute
(
spu_t
*
,
int
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
,
mtime_t
);
void
net_Close
(
int
fd
);
void
net_Close
(
int
fd
);
int
__vlc_threads_init
(
vlc_object_t
*
);
int
__vlc_threads_init
(
vlc_object_t
*
);
int
__intf_UserYesNo
(
vlc_object_t
*
,
const
char
*
,
const
char
*
);
void
__vout_CopyPicture
(
vlc_object_t
*
p_this
,
picture_t
*
p_dst
,
picture_t
*
p_src
);
void
__vout_CopyPicture
(
vlc_object_t
*
p_this
,
picture_t
*
p_dst
,
picture_t
*
p_src
);
void
sout_MuxDeleteStream
(
sout_mux_t
*
,
sout_input_t
*
);
void
sout_MuxDeleteStream
(
sout_mux_t
*
,
sout_input_t
*
);
char
*
httpd_MsgGet
(
httpd_message_t
*
,
char
*
psz_name
);
char
*
httpd_MsgGet
(
httpd_message_t
*
,
char
*
psz_name
);
...
@@ -861,6 +862,7 @@ struct module_symbols_t
...
@@ -861,6 +862,7 @@ struct module_symbols_t
void
(
*
intf_InteractionDestroy_inner
)
(
interaction_t
*
);
void
(
*
intf_InteractionDestroy_inner
)
(
interaction_t
*
);
void
(
*
__intf_UserFatal_inner
)
(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
...);
void
(
*
__intf_UserFatal_inner
)
(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
...);
int
(
*
__intf_UserLoginPassword_inner
)
(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
char
**
,
char
**
);
int
(
*
__intf_UserLoginPassword_inner
)
(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
char
**
,
char
**
);
int
(
*
__intf_UserYesNo_inner
)
(
vlc_object_t
*
,
const
char
*
,
const
char
*
);
};
};
# if defined (__PLUGIN__)
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
...
@@ -1277,6 +1279,7 @@ struct module_symbols_t
...
@@ -1277,6 +1279,7 @@ struct module_symbols_t
# define intf_InteractionDestroy (p_symbols)->intf_InteractionDestroy_inner
# define intf_InteractionDestroy (p_symbols)->intf_InteractionDestroy_inner
# define __intf_UserFatal (p_symbols)->__intf_UserFatal_inner
# define __intf_UserFatal (p_symbols)->__intf_UserFatal_inner
# define __intf_UserLoginPassword (p_symbols)->__intf_UserLoginPassword_inner
# define __intf_UserLoginPassword (p_symbols)->__intf_UserLoginPassword_inner
# define __intf_UserYesNo (p_symbols)->__intf_UserYesNo_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
...
@@ -1696,6 +1699,7 @@ struct module_symbols_t
...
@@ -1696,6 +1699,7 @@ struct module_symbols_t
((p_symbols)->intf_InteractionDestroy_inner) = intf_InteractionDestroy; \
((p_symbols)->intf_InteractionDestroy_inner) = intf_InteractionDestroy; \
((p_symbols)->__intf_UserFatal_inner) = __intf_UserFatal; \
((p_symbols)->__intf_UserFatal_inner) = __intf_UserFatal; \
((p_symbols)->__intf_UserLoginPassword_inner) = __intf_UserLoginPassword; \
((p_symbols)->__intf_UserLoginPassword_inner) = __intf_UserLoginPassword; \
((p_symbols)->__intf_UserYesNo_inner) = __intf_UserYesNo; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
# endif
/* __PLUGIN__ */
# endif
/* __PLUGIN__ */
...
...
src/interface/interaction.c
View file @
89518a71
...
@@ -286,6 +286,8 @@ void __intf_UserFatal( vlc_object_t *p_this,
...
@@ -286,6 +286,8 @@ void __intf_UserFatal( vlc_object_t *p_this,
p_new
->
i_widgets
,
p_new
->
i_widgets
,
p_widget
);
p_widget
);
p_new
->
i_flags
|=
DIALOG_CLEAR_NOSHOW
;
intf_Interact
(
p_this
,
p_new
);
intf_Interact
(
p_this
,
p_new
);
}
}
...
@@ -295,7 +297,41 @@ void __intf_UserFatal( vlc_object_t *p_this,
...
@@ -295,7 +297,41 @@ void __intf_UserFatal( vlc_object_t *p_this,
* \param psz_description A description
* \param psz_description A description
* \param ppsz_login Returned login
* \param ppsz_login Returned login
* \param ppsz_password Returned password
* \param ppsz_password Returned password
* \return 1 if user clicked Cancel, 0 if OK
* \return Clicked button code
*/
int
__intf_UserYesNo
(
vlc_object_t
*
p_this
,
const
char
*
psz_title
,
const
char
*
psz_description
)
{
int
i_ret
;
interaction_dialog_t
*
p_new
=
NULL
;
user_widget_t
*
p_widget
=
NULL
;
INTERACT_INIT
(
p_new
);
p_new
->
i_type
=
INTERACT_DIALOG_TWOWAY
;
p_new
->
psz_title
=
strdup
(
psz_title
);
/* Text */
p_widget
=
(
user_widget_t
*
)
malloc
(
sizeof
(
user_widget_t
)
);
p_widget
->
i_type
=
WIDGET_TEXT
;
p_widget
->
psz_text
=
strdup
(
psz_description
);
p_widget
->
val
.
psz_string
=
NULL
;
INSERT_ELEM
(
p_new
->
pp_widgets
,
p_new
->
i_widgets
,
p_new
->
i_widgets
,
p_widget
);
p_new
->
i_flags
=
DIALOG_YES_NO_CANCEL
;
i_ret
=
intf_Interact
(
p_this
,
p_new
);
return
i_ret
;
}
/** Helper function to ask a yes-no question
* \param p_this Parent vlc_object
* \param psz_title Title for the dialog
* \param psz_description A description
* \return Clicked button code
*/
*/
int
__intf_UserLoginPassword
(
vlc_object_t
*
p_this
,
int
__intf_UserLoginPassword
(
vlc_object_t
*
p_this
,
const
char
*
psz_title
,
const
char
*
psz_title
,
...
@@ -348,6 +384,10 @@ int __intf_UserLoginPassword( vlc_object_t *p_this,
...
@@ -348,6 +384,10 @@ int __intf_UserLoginPassword( vlc_object_t *p_this,
return
i_ret
;
return
i_ret
;
}
}
/**********************************************************************
/**********************************************************************
* The following functions are local
* The following functions are local
**********************************************************************/
**********************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment