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
9b8c613d
Commit
9b8c613d
authored
Nov 19, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/control: Implement flat_media_list_view construction.
parent
3d958c18
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
7 deletions
+35
-7
src/control/flat_media_list_view.c
src/control/flat_media_list_view.c
+29
-1
src/control/libvlc_internal.h
src/control/libvlc_internal.h
+2
-2
src/control/media_list_view.c
src/control/media_list_view.c
+4
-4
No files found.
src/control/flat_media_list_view.c
View file @
9b8c613d
...
@@ -42,8 +42,32 @@ struct libvlc_media_list_view_private_t
...
@@ -42,8 +42,32 @@ struct libvlc_media_list_view_private_t
/*
/*
* Private functions
* Private functions
*/
*/
static
void
flat_media_list_view_release
(
libvlc_media_list_view_t
*
p_mlv
);
/**************************************************************************
* ml_item_added (private) (Callback from media_list_view item_added)
**************************************************************************/
static
void
ml_item_added
(
const
libvlc_event_t
*
p_event
,
libvlc_media_list_view_t
*
p_mlv
)
{
libvlc_media_descriptor_t
*
p_md
=
p_event
->
u
.
media_list_item_added
.
item
;
libvlc_media_descriptor_retain
(
p_md
);
vlc_array_append
(
&
p_mlv
->
p_this_view_data
->
array
,
p_md
);
}
/**************************************************************************
* ml_item_removed (private) (Callback from media_list_view)
**************************************************************************/
static
void
ml_item_removed
(
const
libvlc_event_t
*
p_event
,
libvlc_media_list_view_t
*
p_mlv
)
{
libvlc_media_descriptor_t
*
p_md
=
p_event
->
u
.
media_list_item_deleted
.
item
;
int
i
=
vlc_array_index_of_item
(
&
p_mlv
->
p_this_view_data
->
array
,
p_md
);
if
(
i
>=
0
)
{
vlc_array_remove
(
&
p_mlv
->
p_this_view_data
->
array
,
i
);
libvlc_media_descriptor_release
(
p_md
);
}
}
/**************************************************************************
/**************************************************************************
* flat_media_list_view_count (private)
* flat_media_list_view_count (private)
...
@@ -120,5 +144,9 @@ libvlc_media_list_flat_view( libvlc_media_list_t * p_mlist,
...
@@ -120,5 +144,9 @@ libvlc_media_list_flat_view( libvlc_media_list_t * p_mlist,
flat_media_list_view_release
,
flat_media_list_view_release
,
p_this_view_data
,
p_this_view_data
,
p_e
);
p_e
);
libvlc_media_list_view_set_ml_notification_callback
(
p_mlv
,
ml_item_added
,
ml_item_removed
);
return
p_mlv
;
return
p_mlv
;
}
}
src/control/libvlc_internal.h
View file @
9b8c613d
...
@@ -304,8 +304,8 @@ VLC_EXPORT ( libvlc_media_list_view_t *, libvlc_media_list_view_new,
...
@@ -304,8 +304,8 @@ VLC_EXPORT ( libvlc_media_list_view_t *, libvlc_media_list_view_new,
VLC_EXPORT
(
void
,
libvlc_media_list_view_set_ml_notification_callback
,
(
VLC_EXPORT
(
void
,
libvlc_media_list_view_set_ml_notification_callback
,
(
libvlc_media_list_view_t
*
p_mlv
,
libvlc_media_list_view_t
*
p_mlv
,
void
(
*
item_added
)(
const
libvlc_event_t
*
,
void
*
),
void
(
*
item_added
)(
const
libvlc_event_t
*
,
libvlc_media_list_view_t
*
),
void
(
*
item_removed
)(
const
libvlc_event_t
*
,
void
*
)
));
void
(
*
item_removed
)(
const
libvlc_event_t
*
,
libvlc_media_list_view_t
*
)
));
/* 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 @
9b8c613d
...
@@ -56,7 +56,7 @@ media_list_item_added( const libvlc_event_t * p_event, void * p_user_data )
...
@@ -56,7 +56,7 @@ media_list_item_added( const libvlc_event_t * p_event, void * p_user_data )
libvlc_MediaListItemDeleted
,
libvlc_MediaListItemDeleted
,
media_list_item_removed
,
p_mlv
,
NULL
);
media_list_item_removed
,
p_mlv
,
NULL
);
}
}
if
(
p_mlv
->
pf_ml_item_added
)
p_mlv
->
pf_ml_item_added
(
p_event
,
p_
user_data
);
if
(
p_mlv
->
pf_ml_item_added
)
p_mlv
->
pf_ml_item_added
(
p_event
,
p_
mlv
);
}
}
static
void
static
void
...
@@ -74,7 +74,7 @@ media_list_item_removed( const libvlc_event_t * p_event, void * p_user_data )
...
@@ -74,7 +74,7 @@ media_list_item_removed( const libvlc_event_t * p_event, void * p_user_data )
libvlc_MediaListItemDeleted
,
libvlc_MediaListItemDeleted
,
media_list_item_removed
,
p_mlv
,
NULL
);
media_list_item_removed
,
p_mlv
,
NULL
);
}
}
if
(
p_mlv
->
pf_ml_item_removed
)
p_mlv
->
pf_ml_item_removed
(
p_event
,
p_
user_data
);
if
(
p_mlv
->
pf_ml_item_removed
)
p_mlv
->
pf_ml_item_removed
(
p_event
,
p_
mlv
);
}
}
...
@@ -84,8 +84,8 @@ media_list_item_removed( const libvlc_event_t * p_event, void * p_user_data )
...
@@ -84,8 +84,8 @@ media_list_item_removed( const libvlc_event_t * p_event, void * p_user_data )
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
,
void
(
*
item_added
)(
const
libvlc_event_t
*
,
void
*
),
void
(
*
item_added
)(
const
libvlc_event_t
*
,
libvlc_media_list_view_t
*
),
void
(
*
item_removed
)(
const
libvlc_event_t
*
,
void
*
)
)
void
(
*
item_removed
)(
const
libvlc_event_t
*
,
libvlc_media_list_view_t
*
)
)
{
{
p_mlv
->
pf_ml_item_added
=
item_added
;
p_mlv
->
pf_ml_item_added
=
item_added
;
p_mlv
->
pf_ml_item_removed
=
item_removed
;
p_mlv
->
pf_ml_item_removed
=
item_removed
;
...
...
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