Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
23c79e06
Commit
23c79e06
authored
Mar 08, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dialog_Progress replacement for intf_UserProgress
parent
8cf0a7fc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
0 deletions
+87
-0
include/vlc_dialog.h
include/vlc_dialog.h
+20
-0
src/interface/dialog.c
src/interface/dialog.c
+63
-0
src/libvlccore.sym
src/libvlccore.sym
+4
-0
No files found.
include/vlc_dialog.h
View file @
23c79e06
...
...
@@ -96,6 +96,26 @@ VLC_EXPORT( int, dialog_Question, (vlc_object_t *, const char *, const char *, c
#define dialog_Question(o, t, m, y, n, c) \
dialog_Question(VLC_OBJECT(o), t, m, y, n, c)
typedef
struct
dialog_progress_bar_t
{
/* Request-time parameters */
const
char
*
title
;
const
char
*
message
;
const
char
*
cancel
;
/* Permanent parameters */
vlc_mutex_t
lock
;
void
(
*
pf_update
)
(
void
*
,
float
);
bool
(
*
pf_check
)
(
void
*
);
void
(
*
pf_destroy
)
(
void
*
);
void
*
p_sys
;
}
dialog_progress_bar_t
;
VLC_EXPORT
(
dialog_progress_bar_t
*
,
dialog_ProgressCreate
,
(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
const
char
*
)
);
#define dialog_ProgressCreate(o, t, m, c) \
dialog_ProgressCreate(VLC_OBJECT(o), t, m, c)
VLC_EXPORT
(
void
,
dialog_ProgressDestroy
,
(
dialog_progress_bar_t
*
)
);
VLC_EXPORT
(
void
,
dialog_ProgressSet
,
(
dialog_progress_bar_t
*
,
float
)
);
VLC_EXPORT
(
bool
,
dialog_ProgressCancelled
,
(
dialog_progress_bar_t
*
)
);
VLC_EXPORT
(
int
,
dialog_Register
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
int
,
dialog_Unregister
,
(
vlc_object_t
*
)
);
#define dialog_Register(o) dialog_Register(VLC_OBJECT(o))
...
...
src/interface/dialog.c
View file @
23c79e06
...
...
@@ -194,3 +194,66 @@ int dialog_Question (vlc_object_t *obj, const char *title, const char *text,
vlc_object_release
(
provider
);
return
dialog
.
answer
;
}
#undef dialog_ProgressCreate
/**
* Creates a progress bar dialog.
*/
dialog_progress_bar_t
*
dialog_ProgressCreate
(
vlc_object_t
*
obj
,
const
char
*
title
,
const
char
*
message
,
const
char
*
cancel
)
{
if
(
obj
->
i_flags
&
OBJECT_FLAGS_NOINTERACT
)
return
NULL
;
vlc_object_t
*
provider
=
dialog_GetProvider
(
obj
);
if
(
provider
==
NULL
)
return
NULL
;
dialog_progress_bar_t
*
dialog
=
malloc
(
sizeof
(
*
dialog
));
if
(
dialog
!=
NULL
)
{
dialog
->
title
=
title
;
dialog
->
message
=
message
;
dialog
->
cancel
=
cancel
;
var_SetAddress
(
provider
,
"dialog-progress-bar"
,
dialog
);
#ifndef NDEBUG
dialog
->
title
=
dialog
->
message
=
dialog
->
cancel
=
NULL
;
#endif
assert
(
dialog
->
pf_update
);
assert
(
dialog
->
pf_check
);
assert
(
dialog
->
pf_destroy
);
}
/* FIXME: This could conceivably crash if the dialog provider is destroyed
* before the dialog user. Holding the provider does not help, as it only
* protects object variable operations. For instance, it does not prevent
* unloading of the interface plugin. In the short term, the only solution
* is to not use progress dialog after deinitialization of the interfaces.
*/
vlc_object_release
(
provider
);
return
dialog
;
}
void
dialog_ProgressDestroy
(
dialog_progress_bar_t
*
dialog
)
{
assert
(
dialog
);
dialog
->
pf_destroy
(
dialog
->
p_sys
);
free
(
dialog
);
}
void
dialog_ProgressSet
(
dialog_progress_bar_t
*
dialog
,
float
value
)
{
assert
(
dialog
);
dialog
->
pf_update
(
dialog
->
p_sys
,
value
);
}
bool
dialog_ProgressCancelled
(
dialog_progress_bar_t
*
dialog
)
{
assert
(
dialog
);
return
dialog
->
pf_check
(
dialog
->
p_sys
);
}
src/libvlccore.sym
View file @
23c79e06
...
...
@@ -103,6 +103,10 @@ demux_PacketizerDestroy
demux_PacketizerNew
demux_vaControlHelper
dialog_Login
dialog_ProgressCancelled
dialog_ProgressCreate
dialog_ProgressDestroy
dialog_ProgressSet
dialog_Question
dialog_Register
dialog_Unregister
...
...
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