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
c7e71cb6
Commit
c7e71cb6
authored
Dec 25, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control/media_list.c: Implement read-only media_list.
parent
ee9c15aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
1 deletion
+61
-1
include/vlc/libvlc.h
include/vlc/libvlc.h
+4
-0
src/control/libvlc_internal.h
src/control/libvlc_internal.h
+16
-0
src/control/media_list.c
src/control/media_list.c
+41
-1
No files found.
include/vlc/libvlc.h
View file @
c7e71cb6
...
...
@@ -546,6 +546,10 @@ VLC_PUBLIC_API int
libvlc_media_descriptor_t
*
,
libvlc_exception_t
*
);
/* This indicates if this media list is read-only from a user point of view */
VLC_PUBLIC_API
vlc_bool_t
libvlc_media_list_is_readonly
(
libvlc_media_list_t
*
p_mlist
);
VLC_PUBLIC_API
void
libvlc_media_list_lock
(
libvlc_media_list_t
*
);
VLC_PUBLIC_API
void
...
...
src/control/libvlc_internal.h
View file @
c7e71cb6
...
...
@@ -114,6 +114,10 @@ struct libvlc_media_list_t
/* Other way to see that media list */
/* Used in flat_media_list.c */
libvlc_media_list_t
*
p_flat_mlist
;
/* This indicates if this media list is read-only
* from a user point of view */
vlc_bool_t
b_read_only
;
};
typedef
void
(
*
libvlc_media_list_view_release_func_t
)(
libvlc_media_list_view_t
*
p_mlv
)
;
...
...
@@ -297,6 +301,18 @@ VLC_EXPORT (libvlc_media_descriptor_t *, libvlc_media_descriptor_duplicate,
VLC_EXPORT
(
void
,
libvlc_media_descriptor_set_state
,
(
libvlc_media_descriptor_t
*
,
libvlc_state_t
,
libvlc_exception_t
*
)
);
/* Media List */
VLC_EXPORT
(
void
,
_libvlc_media_list_insert_media_descriptor
,
(
libvlc_media_list_t
*
p_mlist
,
libvlc_media_descriptor_t
*
p_md
,
int
index
,
libvlc_exception_t
*
p_e
)
);
VLC_EXPORT
(
void
,
_libvlc_media_list_remove_index
,
(
libvlc_media_list_t
*
p_mlist
,
int
index
,
libvlc_exception_t
*
p_e
)
);
/* Media List View */
VLC_EXPORT
(
libvlc_media_list_view_t
*
,
libvlc_media_list_view_new
,
(
libvlc_media_list_t
*
p_mlist
,
...
...
src/control/media_list.c
View file @
c7e71cb6
...
...
@@ -124,6 +124,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
/* Code for that one should be handled in flat_media_list.c */
p_mlist
->
p_flat_mlist
=
NULL
;
p_mlist
->
b_read_only
=
VLC_FALSE
;
libvlc_event_manager_register_event_type
(
p_mlist
->
p_event_manager
,
libvlc_MediaListItemAdded
,
p_e
);
...
...
@@ -322,6 +323,22 @@ void libvlc_media_list_insert_media_descriptor(
libvlc_media_descriptor_t
*
p_md
,
int
index
,
libvlc_exception_t
*
p_e
)
{
if
(
p_mlist
->
b_read_only
)
{
/* We are read only from user side */
libvlc_exception_raise
(
p_e
,
"Trying to write into a read-only media list."
);
return
;
}
_libvlc_media_list_insert_media_descriptor
(
p_mlist
,
p_md
,
index
,
p_e
);
}
/* LibVLC internal version */
void
_libvlc_media_list_insert_media_descriptor
(
libvlc_media_list_t
*
p_mlist
,
libvlc_media_descriptor_t
*
p_md
,
int
index
,
libvlc_exception_t
*
p_e
)
{
(
void
)
p_e
;
libvlc_media_descriptor_retain
(
p_md
);
...
...
@@ -339,6 +356,20 @@ void libvlc_media_list_insert_media_descriptor(
void
libvlc_media_list_remove_index
(
libvlc_media_list_t
*
p_mlist
,
int
index
,
libvlc_exception_t
*
p_e
)
{
if
(
p_mlist
->
b_read_only
)
{
/* We are read only from user side */
libvlc_exception_raise
(
p_e
,
"Trying to write into a read-only media list."
);
return
;
}
_libvlc_media_list_remove_index
(
p_mlist
,
index
,
p_e
);
}
/* LibVLC internal version */
void
_libvlc_media_list_remove_index
(
libvlc_media_list_t
*
p_mlist
,
int
index
,
libvlc_exception_t
*
p_e
)
{
libvlc_media_descriptor_t
*
p_md
;
...
...
@@ -388,6 +419,16 @@ int libvlc_media_list_index_of_item( libvlc_media_list_t * p_mlist,
return
-
1
;
}
/**************************************************************************
* libvlc_media_list_is_readonly (Public)
*
* This indicates if this media list is read-only from a user point of view
**************************************************************************/
vlc_bool_t
libvlc_media_list_is_readonly
(
libvlc_media_list_t
*
p_mlist
)
{
return
p_mlist
->
b_read_only
;
}
/**************************************************************************
* libvlc_media_list_lock (Public)
*
...
...
@@ -411,7 +452,6 @@ void libvlc_media_list_unlock( libvlc_media_list_t * p_mlist )
}
/**************************************************************************
* libvlc_media_list_p_event_manager (Public)
*
...
...
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