Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
8dbb3f39
Commit
8dbb3f39
authored
Jun 24, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverts [20669]
Adds a button into qt4 media information to write modified meta data to the file
parent
10b303d9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
13 deletions
+75
-13
include/vlc_common.h
include/vlc_common.h
+1
-0
include/vlc_meta.h
include/vlc_meta.h
+6
-0
modules/gui/qt4/components/infopanels.cpp
modules/gui/qt4/components/infopanels.cpp
+54
-0
modules/gui/qt4/components/infopanels.hpp
modules/gui/qt4/components/infopanels.hpp
+2
-0
modules/gui/qt4/dialogs/mediainfo.cpp
modules/gui/qt4/dialogs/mediainfo.cpp
+1
-0
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+11
-13
No files found.
include/vlc_common.h
View file @
8dbb3f39
...
...
@@ -429,6 +429,7 @@ typedef struct vlm_message_t vlm_message_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 @
8dbb3f39
...
...
@@ -227,6 +227,12 @@ enum {
ALBUM_ART_ALL
};
struct
meta_export_t
{
input_item_t
*
p_item
;
const
char
*
psz_file
;
};
#define VLC_META_ENGINE_TITLE 0x00000001
#define VLC_META_ENGINE_ARTIST 0x00000004
#define VLC_META_ENGINE_GENRE 0x00000008
...
...
modules/gui/qt4/components/infopanels.cpp
View file @
8dbb3f39
...
...
@@ -114,6 +114,11 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
ADD_META_B
(
VLC_META_ENCODED_BY
,
publisher_text
);
ADD_META_B
(
VLC_META_DESCRIPTION
,
description_text
);
// Comment Two lines?
QPushButton
*
write
=
new
QPushButton
(
qtr
(
"&Write"
)
);
l
->
addWidget
(
write
,
line
,
0
);
BUTTONACT
(
write
,
saveMeta
()
);
/* ADD_META( TRACKID) DO NOT SHOW it */
/* ADD_URI - DO not show it, done outside */
...
...
@@ -127,6 +132,55 @@ MetaPanel::~MetaPanel()
{
}
void
MetaPanel
::
saveMeta
()
{
playlist_t
*
p_playlist
;
meta_export_t
p_export
;
p_export
.
p_item
=
p_input
;
/* we can write meta data only in a file */
if
(
(
p_input
->
i_type
==
ITEM_TYPE_AFILE
)
||
\
(
p_input
->
i_type
==
ITEM_TYPE_VFILE
)
)
/* some audio files are detected as video files */
{
char
*
psz_uri
=
p_input
->
psz_uri
;
if
(
!
strncmp
(
psz_uri
,
"file://"
,
7
)
)
psz_uri
+=
7
;
/* strlen("file://") = 7 */
p_export
.
psz_file
=
strndup
(
psz_uri
,
PATH_MAX
);
}
else
return
;
/* now we read the modified meta data */
free
(
p_input
->
p_meta
->
psz_artist
);
p_input
->
p_meta
->
psz_artist
=
strdup
(
artist_text
->
text
().
toUtf8
()
);
free
(
p_input
->
p_meta
->
psz_album
);
p_input
->
p_meta
->
psz_album
=
strdup
(
collection_text
->
text
().
toUtf8
()
);
free
(
p_input
->
p_meta
->
psz_genre
);
p_input
->
p_meta
->
psz_genre
=
strdup
(
genre_text
->
text
().
toUtf8
()
);
free
(
p_input
->
p_meta
->
psz_date
);
p_input
->
p_meta
->
psz_date
=
(
char
*
)
malloc
(
5
);
snprintf
(
p_input
->
p_meta
->
psz_date
,
5
,
"%d"
,
date_text
->
value
()
);
free
(
p_input
->
p_meta
->
psz_tracknum
);
p_input
->
p_meta
->
psz_tracknum
=
(
char
*
)
malloc
(
5
);
snprintf
(
p_input
->
p_meta
->
psz_tracknum
,
5
,
"%d"
,
seqnum_text
->
value
()
);
free
(
p_input
->
p_meta
->
psz_title
);
p_input
->
p_meta
->
psz_title
=
strdup
(
title_text
->
text
().
toUtf8
()
);
p_playlist
=
pl_Yield
(
p_intf
);
PL_LOCK
;
p_playlist
->
p_private
=
&
p_export
;
module_t
*
p_mod
=
module_Need
(
p_playlist
,
"meta writer"
,
NULL
,
0
);
if
(
p_mod
)
module_Unneed
(
p_playlist
,
p_mod
);
PL_UNLOCK
;
pl_Release
(
p_playlist
);
}
void
MetaPanel
::
update
(
input_item_t
*
p_item
)
{
char
*
psz_meta
;
...
...
modules/gui/qt4/components/infopanels.hpp
View file @
8dbb3f39
...
...
@@ -53,6 +53,7 @@ class MetaPanel: public QWidget
public:
MetaPanel
(
QWidget
*
,
intf_thread_t
*
);
virtual
~
MetaPanel
();
input_item_t
*
p_input
;
private:
intf_thread_t
*
p_intf
;
QLineEdit
*
uri_text
;
...
...
@@ -74,6 +75,7 @@ private:
public
slots
:
void
update
(
input_item_t
*
);
void
clear
();
void
saveMeta
();
signals:
void
uriSet
(
QString
);
};
...
...
modules/gui/qt4/dialogs/mediainfo.cpp
View file @
8dbb3f39
...
...
@@ -142,6 +142,7 @@ void MediaInfoDialog::update()
void
MediaInfoDialog
::
update
(
input_item_t
*
p_item
,
bool
update_info
,
bool
update_meta
)
{
MP
->
p_input
=
p_item
;
if
(
update_info
)
IP
->
update
(
p_item
);
if
(
update_meta
)
...
...
modules/meta_engine/taglib.cpp
View file @
8dbb3f39
...
...
@@ -166,29 +166,25 @@ static int ReadMeta( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
#define SET(a,b) if(b) tag->set##a( b );
static
int
WriteMeta
(
vlc_object_t
*
p_this
)
{
input_item_t
*
p_item
=
(
input_item_t
*
)
p_this
;
char
*
psz_uri
=
p_item
->
psz_uri
;
/* we can write meta data only in a file */
if
(
!
strncmp
(
psz_uri
,
"file://"
,
7
)
)
psz_uri
+=
7
;
/* if the file is specified with its path, not prefixed with file:// */
else
if
(
strncmp
(
psz_uri
,
"/"
,
1
)
)
return
VLC_EGENERIC
;
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
sz_uri
);
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
);
SET
(
Artist
,
p_item
->
p_meta
->
psz_artist
);
if
(
p_item
->
p_meta
->
psz_title
)
tag
->
setTitle
(
p_item
->
p_meta
->
psz_title
);
else
tag
->
setTitle
(
p_item
->
psz_name
);
tag
->
setAlbum
(
p_item
->
p_meta
->
psz_album
);
tag
->
setGenre
(
p_item
->
p_meta
->
psz_genre
);
SET
(
Album
,
p_item
->
p_meta
->
psz_album
);
SET
(
Genre
,
p_item
->
p_meta
->
psz_genre
);
if
(
p_item
->
p_meta
->
psz_date
)
tag
->
setYear
(
atoi
(
p_item
->
p_meta
->
psz_date
)
);
if
(
p_item
->
p_meta
->
psz_tracknum
)
...
...
@@ -196,6 +192,8 @@ static int WriteMeta( vlc_object_t *p_this )
f
.
save
();
return
VLC_SUCCESS
;
}
msg_Err
(
p_this
,
"File %s can't be opened for tag writing
\n
"
,
p_export
->
psz_file
);
return
VLC_EGENERIC
;
}
...
...
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