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
450
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
f17e985a
Commit
f17e985a
authored
18 years ago
by
zorglub
Browse files
Options
Downloads
Patches
Plain Diff
Skeleton for taglib art downloader and tags writer
parent
937b6249
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/vlc_common.h
+1
-0
1 addition, 0 deletions
include/vlc_common.h
include/vlc_meta.h
+6
-0
6 additions, 0 deletions
include/vlc_meta.h
modules/meta_engine/taglib.cpp
+35
-1
35 additions, 1 deletion
modules/meta_engine/taglib.cpp
with
42 additions
and
1 deletion
include/vlc_common.h
+
1
−
0
View file @
f17e985a
...
...
@@ -431,6 +431,7 @@ typedef struct vlm_schedule_t vlm_schedule_t;
/* divers */
typedef
struct
vlc_meta_t
vlc_meta_t
;
typedef
struct
meta_export_t
meta_export_t
;
/* Stats */
typedef
struct
counter_t
counter_t
;
...
...
This diff is collapsed.
Click to expand it.
include/vlc_meta.h
+
6
−
0
View file @
f17e985a
...
...
@@ -185,4 +185,10 @@ enum {
ALBUM_ART_WHEN_PLAYED
,
ALBUM_ART_ALL
};
struct
meta_export_t
{
input_item_t
*
p_item
;
const
char
*
psz_file
;
};
#endif
This diff is collapsed.
Click to expand it.
modules/meta_engine/taglib.cpp
+
35
−
1
View file @
f17e985a
...
...
@@ -30,11 +30,19 @@
#include
<mpegfile.h>
#include
<flacfile.h>
static
int
ReadMeta
(
vlc_object_t
*
);
static
int
ReadMeta
(
vlc_object_t
*
);
static
int
DownloadArt
(
vlc_object_t
*
);
static
int
WriteMeta
(
vlc_object_t
*
);
vlc_module_begin
();
set_capability
(
"meta reader"
,
1000
);
set_callbacks
(
ReadMeta
,
NULL
);
add_submodule
();
set_capability
(
"art downloader"
,
50
);
set_callbacks
(
DownloadArt
,
NULL
);
add_submodule
();
set_capability
(
"meta writer"
,
50
);
set_callbacks
(
WriteMeta
,
NULL
);
vlc_module_end
();
static
bool
checkID3Image
(
const
TagLib
::
ID3v2
::
Tag
*
tag
)
...
...
@@ -101,3 +109,29 @@ static int ReadMeta( vlc_object_t *p_this )
}
return
VLC_EGENERIC
;
}
static
int
WriteMeta
(
vlc_object_t
*
p_this
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
p_this
;
meta_export_t
*
p_export
=
(
meta_export_t
*
)
p_playlist
->
p_private
;
input_item_t
*
p_item
=
p_export
->
p_item
;
TagLib
::
FileRef
f
(
p_export
->
psz_file
);
if
(
!
f
.
isNull
()
&&
f
.
tag
()
)
{
TagLib
::
Tag
*
tag
=
f
.
tag
();
tag
->
setArtist
(
p_item
->
p_meta
->
psz_artist
);
f
.
save
();
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
}
static
int
DownloadArt
(
vlc_object_t
*
p_this
)
{
/* We need to be passed the file name
* Fetch the thing from the file, save it to the cache folder
*/
return
VLC_EGENERIC
;
}
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