Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
85be5949
Commit
85be5949
authored
Nov 20, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control/hierarchical_media_list_view.c: Send WillAdd/Added and WillDelete/Deleted events.
parent
0601ce74
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
3 deletions
+68
-3
src/control/hierarchical_media_list_view.c
src/control/hierarchical_media_list_view.c
+68
-3
No files found.
src/control/hierarchical_media_list_view.c
View file @
85be5949
...
...
@@ -85,18 +85,71 @@ hierarch_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
}
/**************************************************************************
* flat_media_list_view_release (private)
* (called by media_list_view_release)
* media_list_(item|will)_* (private) (Event callback)
**************************************************************************/
static
void
hierarch_media_list_view_release
(
libvlc_media_list_view_t
*
p_mlv
)
media_list_item_added
(
const
libvlc_event_t
*
p_event
,
void
*
user_data
)
{
libvlc_media_descriptor_t
*
p_md
;
libvlc_media_list_view_t
*
p_mlv
=
user_data
;
int
index
=
p_event
->
u
.
media_list_item_added
.
index
;
p_md
=
p_event
->
u
.
media_list_item_added
.
item
;
libvlc_media_list_view_item_added
(
p_mlv
,
p_md
,
index
);
}
static
void
media_list_will_add_item
(
const
libvlc_event_t
*
p_event
,
void
*
user_data
)
{
libvlc_media_descriptor_t
*
p_md
;
libvlc_media_list_view_t
*
p_mlv
=
user_data
;
int
index
=
p_event
->
u
.
media_list_will_add_item
.
index
;
p_md
=
p_event
->
u
.
media_list_will_add_item
.
item
;
libvlc_media_list_view_will_add_item
(
p_mlv
,
p_md
,
index
);
}
static
void
media_list_item_deleted
(
const
libvlc_event_t
*
p_event
,
void
*
user_data
)
{
libvlc_media_descriptor_t
*
p_md
;
libvlc_media_list_view_t
*
p_mlv
=
user_data
;
int
index
=
p_event
->
u
.
media_list_item_deleted
.
index
;
p_md
=
p_event
->
u
.
media_list_item_deleted
.
item
;
libvlc_media_list_view_item_deleted
(
p_mlv
,
p_md
,
index
);
}
static
void
media_list_will_delete_item
(
const
libvlc_event_t
*
p_event
,
void
*
user_data
)
{
libvlc_media_descriptor_t
*
p_md
;
libvlc_media_list_view_t
*
p_mlv
=
user_data
;
int
index
=
p_event
->
u
.
media_list_will_delete_item
.
index
;
p_md
=
p_event
->
u
.
media_list_will_delete_item
.
item
;
libvlc_media_list_view_will_delete_item
(
p_mlv
,
p_md
,
index
);
}
/*
* Public libvlc functions
*/
/**************************************************************************
* flat_media_list_view_release (private)
* (called by media_list_view_release)
**************************************************************************/
static
void
hierarch_media_list_view_release
(
libvlc_media_list_view_t
*
p_mlv
)
{
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemAdded
,
media_list_item_added
,
p_mlv
,
NULL
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListWillAddItem
,
media_list_will_add_item
,
p_mlv
,
NULL
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemDeleted
,
media_list_item_deleted
,
p_mlv
,
NULL
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListWillDeleteItem
,
media_list_will_delete_item
,
p_mlv
,
NULL
);
}
/**************************************************************************
* libvlc_media_list_flat_view (Public)
**************************************************************************/
...
...
@@ -114,6 +167,18 @@ libvlc_media_list_hierarchical_view( libvlc_media_list_t * p_mlist,
hierarch_media_list_view_release
,
NULL
,
p_e
);
libvlc_event_attach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemAdded
,
media_list_item_added
,
p_mlv
,
NULL
);
libvlc_event_attach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListWillAddItem
,
media_list_will_add_item
,
p_mlv
,
NULL
);
libvlc_event_attach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemDeleted
,
media_list_item_deleted
,
p_mlv
,
NULL
);
libvlc_event_attach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListWillDeleteItem
,
media_list_will_delete_item
,
p_mlv
,
NULL
);
libvlc_media_list_unlock
(
p_mlist
);
return
p_mlv
;
}
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