Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
440
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
c7a10410
Commit
c7a10410
authored
2 years ago
by
Hugo Beauzée-Luyssen
Browse files
Options
Downloads
Patches
Plain Diff
medialibrary: Bind folder modifications callbacks
parent
25d20933
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1459
medialibrary: Bind folder modifications callbacks
Pipeline
#194304
passed with stage
in 1 hour, 12 minutes, and 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/vlc_media_library.h
+4
-0
4 additions, 0 deletions
include/vlc_media_library.h
modules/misc/medialibrary/medialibrary.cpp
+10
-6
10 additions, 6 deletions
modules/misc/medialibrary/medialibrary.cpp
with
14 additions
and
6 deletions
include/vlc_media_library.h
+
4
−
0
View file @
c7a10410
...
...
@@ -644,6 +644,9 @@ enum vlc_ml_event_type
VLC_ML_EVENT_BOOKMARKS_ADDED
,
VLC_ML_EVENT_BOOKMARKS_UPDATED
,
VLC_ML_EVENT_BOOKMARKS_DELETED
,
VLC_ML_EVENT_FOLDER_ADDED
,
VLC_ML_EVENT_FOLDER_UPDATED
,
VLC_ML_EVENT_FOLDER_DELETED
,
/**
* A discovery started.
*
...
...
@@ -783,6 +786,7 @@ typedef struct vlc_ml_event_t
const
vlc_ml_playlist_t
*
p_playlist
;
const
vlc_ml_genre_t
*
p_genre
;
const
vlc_ml_bookmark_t
*
p_bookmark
;
const
vlc_ml_folder_t
*
p_folder
;
}
creation
;
struct
{
...
...
This diff is collapsed.
Click to expand it.
modules/misc/medialibrary/medialibrary.cpp
+
10
−
6
View file @
c7a10410
...
...
@@ -86,6 +86,7 @@ void assignToEvent( vlc_ml_event_t* ev, vlc_ml_genre_t* g ) { ev->creation.p_
void
assignToEvent
(
vlc_ml_event_t
*
ev
,
vlc_ml_group_t
*
g
)
{
ev
->
creation
.
p_group
=
g
;
}
void
assignToEvent
(
vlc_ml_event_t
*
ev
,
vlc_ml_playlist_t
*
p
)
{
ev
->
creation
.
p_playlist
=
p
;
}
void
assignToEvent
(
vlc_ml_event_t
*
ev
,
vlc_ml_bookmark_t
*
b
)
{
ev
->
creation
.
p_bookmark
=
b
;
}
void
assignToEvent
(
vlc_ml_event_t
*
ev
,
vlc_ml_folder_t
*
f
)
{
ev
->
creation
.
p_folder
=
f
;
}
template
<
typename
To
,
typename
From
>
void
wrapEntityCreatedEventCallback
(
vlc_medialibrary_module_t
*
ml
,
...
...
@@ -251,19 +252,22 @@ void MediaLibrary::onBookmarksDeleted( std::set<int64_t> bookmarkIds )
VLC_ML_EVENT_BOOKMARKS_DELETED
);
}
void
MediaLibrary
::
onFoldersAdded
(
std
::
vector
<
medialibrary
::
FolderPtr
>
)
void
MediaLibrary
::
onFoldersAdded
(
std
::
vector
<
medialibrary
::
FolderPtr
>
folders
)
{
wrapEntityCreatedEventCallback
<
vlc_ml_folder_t
>
(
m_vlc_ml
,
folders
,
VLC_ML_EVENT_FOLDER_ADDED
);
}
void
MediaLibrary
::
onFoldersModified
(
std
::
set
<
int64_t
>
)
void
MediaLibrary
::
onFoldersModified
(
std
::
set
<
int64_t
>
folderIds
)
{
wrapEntityModifiedEventCallback
(
m_vlc_ml
,
folderIds
,
VLC_ML_EVENT_FOLDER_UPDATED
);
}
void
MediaLibrary
::
onFoldersDeleted
(
std
::
set
<
int64_t
>
)
void
MediaLibrary
::
onFoldersDeleted
(
std
::
set
<
int64_t
>
folderIds
)
{
wrapEntityDeletedEventCallback
(
m_vlc_ml
,
folderIds
,
VLC_ML_EVENT_FOLDER_DELETED
);
}
void
MediaLibrary
::
onDiscoveryStarted
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment