Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gautam Chitnis
web-ui-redesign
Commits
f17e985a
Commit
f17e985a
authored
Sep 24, 2006
by
zorglub
Browse files
Skeleton for taglib art downloader and tags writer
parent
937b6249
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/vlc_common.h
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
;
...
...
include/vlc_meta.h
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
modules/meta_engine/taglib.cpp
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
;
}
Write
Preview
Supports
Markdown
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