Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
b269d0ed
Commit
b269d0ed
authored
Nov 20, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/control/media_list_view.c: Facilities to send WillAdd/Added WillDelete/Deleted events.
parent
9bf66bda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
2 deletions
+125
-2
include/vlc/libvlc_structures.h
include/vlc/libvlc_structures.h
+27
-0
src/control/libvlc_internal.h
src/control/libvlc_internal.h
+13
-0
src/control/media_list_view.c
src/control/media_list_view.c
+85
-2
No files found.
include/vlc/libvlc_structures.h
View file @
b269d0ed
...
@@ -310,6 +310,11 @@ typedef enum libvlc_event_type_t {
...
@@ -310,6 +310,11 @@ typedef enum libvlc_event_type_t {
libvlc_MediaListItemDeleted
,
libvlc_MediaListItemDeleted
,
libvlc_MediaListWillDeleteItem
,
libvlc_MediaListWillDeleteItem
,
libvlc_MediaListViewItemAdded
,
libvlc_MediaListViewWillAddItem
,
libvlc_MediaListViewItemDeleted
,
libvlc_MediaListViewWillDeleteItem
,
libvlc_MediaListPlayerPlayed
,
libvlc_MediaListPlayerPlayed
,
libvlc_MediaListPlayerNextItemSet
,
libvlc_MediaListPlayerNextItemSet
,
libvlc_MediaListPlayerStopped
,
libvlc_MediaListPlayerStopped
,
...
@@ -378,6 +383,28 @@ typedef struct libvlc_event_t
...
@@ -378,6 +383,28 @@ typedef struct libvlc_event_t
libvlc_media_descriptor_t
*
item
;
libvlc_media_descriptor_t
*
item
;
int
index
;
int
index
;
}
media_list_will_delete_item
;
}
media_list_will_delete_item
;
/* media list view */
struct
{
libvlc_media_descriptor_t
*
item
;
int
index
;
}
media_list_view_item_added
;
struct
{
libvlc_media_descriptor_t
*
item
;
int
index
;
}
media_list_view_will_add_item
;
struct
{
libvlc_media_descriptor_t
*
item
;
int
index
;
}
media_list_view_item_deleted
;
struct
{
libvlc_media_descriptor_t
*
item
;
int
index
;
}
media_list_view_will_delete_item
;
}
u
;
}
u
;
}
libvlc_event_t
;
}
libvlc_event_t
;
...
...
src/control/libvlc_internal.h
View file @
b269d0ed
...
@@ -307,6 +307,19 @@ VLC_EXPORT ( void, libvlc_media_list_view_set_ml_notification_callback, (
...
@@ -307,6 +307,19 @@ VLC_EXPORT ( void, libvlc_media_list_view_set_ml_notification_callback, (
void
(
*
item_added
)(
const
libvlc_event_t
*
,
libvlc_media_list_view_t
*
),
void
(
*
item_added
)(
const
libvlc_event_t
*
,
libvlc_media_list_view_t
*
),
void
(
*
item_removed
)(
const
libvlc_event_t
*
,
libvlc_media_list_view_t
*
)
));
void
(
*
item_removed
)(
const
libvlc_event_t
*
,
libvlc_media_list_view_t
*
)
));
VLC_EXPORT
(
void
,
libvlc_media_list_view_will_delete_item
,
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_descriptor_t
*
p_item
,
int
index
));
VLC_EXPORT
(
void
,
libvlc_media_list_view_item_deleted
,
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_descriptor_t
*
p_item
,
int
index
));
VLC_EXPORT
(
void
,
libvlc_media_list_view_will_add_item
,
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_descriptor_t
*
p_item
,
int
index
));
VLC_EXPORT
(
void
,
libvlc_media_list_view_item_added
,
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_descriptor_t
*
p_item
,
int
index
));
/* Events */
/* Events */
VLC_EXPORT
(
libvlc_event_manager_t
*
,
libvlc_event_manager_new
,
(
void
*
p_obj
,
libvlc_instance_t
*
p_libvlc_inst
,
libvlc_exception_t
*
p_e
)
);
VLC_EXPORT
(
libvlc_event_manager_t
*
,
libvlc_event_manager_new
,
(
void
*
p_obj
,
libvlc_instance_t
*
p_libvlc_inst
,
libvlc_exception_t
*
p_e
)
);
...
...
src/control/media_list_view.c
View file @
b269d0ed
...
@@ -81,6 +81,9 @@ media_list_item_removed( const libvlc_event_t * p_event, void * p_user_data )
...
@@ -81,6 +81,9 @@ media_list_item_removed( const libvlc_event_t * p_event, void * p_user_data )
/*
/*
* LibVLC Internal functions
* LibVLC Internal functions
*/
*/
/**************************************************************************
* libvlc_media_list_view_set_ml_notification_callback (Internal)
**************************************************************************/
void
void
libvlc_media_list_view_set_ml_notification_callback
(
libvlc_media_list_view_set_ml_notification_callback
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_list_view_t
*
p_mlv
,
...
@@ -97,6 +100,86 @@ libvlc_media_list_view_set_ml_notification_callback(
...
@@ -97,6 +100,86 @@ libvlc_media_list_view_set_ml_notification_callback(
media_list_item_removed
,
p_mlv
,
NULL
);
media_list_item_removed
,
p_mlv
,
NULL
);
}
}
/**************************************************************************
* libvlc_media_list_view_notify_deletion (Internal)
**************************************************************************/
void
libvlc_media_list_view_will_delete_item
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_descriptor_t
*
p_item
,
int
index
)
{
libvlc_event_t
event
;
/* Construct the event */
event
.
type
=
libvlc_MediaListViewWillDeleteItem
;
event
.
u
.
media_list_view_will_delete_item
.
item
=
p_item
;
event
.
u
.
media_list_view_will_delete_item
.
index
=
index
;
/* Send the event */
libvlc_event_send
(
p_mlv
->
p_event_manager
,
&
event
);
}
/**************************************************************************
* libvlc_media_list_view_item_deleted (Internal)
**************************************************************************/
void
libvlc_media_list_view_item_deleted
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_descriptor_t
*
p_item
,
int
index
)
{
libvlc_event_t
event
;
/* Construct the event */
event
.
type
=
libvlc_MediaListViewItemDeleted
;
event
.
u
.
media_list_view_item_deleted
.
item
=
p_item
;
event
.
u
.
media_list_view_item_deleted
.
index
=
index
;
/* Send the event */
libvlc_event_send
(
p_mlv
->
p_event_manager
,
&
event
);
}
/**************************************************************************
* libvlc_media_list_view_will_add_item (Internal)
**************************************************************************/
void
libvlc_media_list_view_will_add_item
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_descriptor_t
*
p_item
,
int
index
)
{
libvlc_event_t
event
;
/* Construct the event */
event
.
type
=
libvlc_MediaListViewWillAddItem
;
event
.
u
.
media_list_view_will_add_item
.
item
=
p_item
;
event
.
u
.
media_list_view_will_add_item
.
index
=
index
;
/* Send the event */
libvlc_event_send
(
p_mlv
->
p_event_manager
,
&
event
);
}
/**************************************************************************
* libvlc_media_list_view_item_added (Internal)
**************************************************************************/
void
libvlc_media_list_view_item_added
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_descriptor_t
*
p_item
,
int
index
)
{
libvlc_event_t
event
;
/* Construct the event */
event
.
type
=
libvlc_MediaListViewItemAdded
;
event
.
u
.
media_list_view_item_added
.
item
=
p_item
;
event
.
u
.
media_list_view_item_added
.
index
=
index
;
/* Send the event */
libvlc_event_send
(
p_mlv
->
p_event_manager
,
&
event
);
}
/**************************************************************************
/**************************************************************************
* libvlc_media_list_view_new (Internal)
* libvlc_media_list_view_new (Internal)
**************************************************************************/
**************************************************************************/
...
@@ -171,14 +254,14 @@ libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv )
...
@@ -171,14 +254,14 @@ libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv )
{
{
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemAdded
,
libvlc_MediaListItemAdded
,
p_mlv
->
pf_ml_item_added
,
p_mlv
,
NULL
);
(
void
(
*
)(
const
libvlc_event_t
*
,
void
*
))
p_mlv
->
pf_ml_item_added
,
p_mlv
,
NULL
);
/* XXX: descend the whole tree and remove observer */
/* XXX: descend the whole tree and remove observer */
}
}
if
(
p_mlv
->
pf_ml_item_removed
)
if
(
p_mlv
->
pf_ml_item_removed
)
{
{
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemDeleted
,
libvlc_MediaListItemDeleted
,
p_mlv
->
pf_ml_item_removed
,
p_mlv
,
NULL
);
(
void
(
*
)(
const
libvlc_event_t
*
,
void
*
))
p_mlv
->
pf_ml_item_removed
,
p_mlv
,
NULL
);
/* XXX: descend the whole tree and remove observer */
/* XXX: descend the whole tree and remove observer */
}
}
...
...
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