Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
4b36af4a
Commit
4b36af4a
authored
Feb 12, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag: add attribute "has_playlist"
parent
4a23a4bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
0 deletions
+18
-0
song_save.c
src/song_save.c
+7
-0
tag.c
src/tag.c
+2
-0
tag.h
src/tag.h
+6
-0
tag_save.c
src/tag_save.c
+3
-0
No files found.
src/song_save.c
View file @
4b36af4a
...
...
@@ -100,6 +100,13 @@ song_load(FILE *fp, struct directory *parent, const char *uri,
}
song
->
tag
->
time
=
atoi
(
value
);
}
else
if
(
strcmp
(
line
,
"Playlist"
)
==
0
)
{
if
(
!
song
->
tag
)
{
song
->
tag
=
tag_new
();
tag_begin_add
(
song
->
tag
);
}
song
->
tag
->
has_playlist
=
strcmp
(
value
,
"yes"
)
==
0
;
}
else
if
(
strcmp
(
line
,
SONG_MTIME
)
==
0
)
{
song
->
mtime
=
atoi
(
value
);
}
else
if
(
strcmp
(
line
,
"Range"
)
==
0
)
{
...
...
src/tag.c
View file @
4b36af4a
...
...
@@ -158,6 +158,7 @@ struct tag *tag_new(void)
struct
tag
*
ret
=
g_new
(
struct
tag
,
1
);
ret
->
items
=
NULL
;
ret
->
time
=
-
1
;
ret
->
has_playlist
=
false
;
ret
->
num_items
=
0
;
return
ret
;
}
...
...
@@ -226,6 +227,7 @@ struct tag *tag_dup(const struct tag *tag)
ret
=
tag_new
();
ret
->
time
=
tag
->
time
;
ret
->
has_playlist
=
tag
->
has_playlist
;
ret
->
num_items
=
tag
->
num_items
;
ret
->
items
=
ret
->
num_items
>
0
?
g_malloc
(
items_size
(
tag
))
:
NULL
;
...
...
src/tag.h
View file @
4b36af4a
...
...
@@ -88,6 +88,12 @@ struct tag {
*/
int
time
;
/**
* Does this file have an embedded playlist (e.g. embedded CUE
* sheet)?
*/
bool
has_playlist
;
/** an array of tag items */
struct
tag_item
**
items
;
...
...
src/tag_save.c
View file @
4b36af4a
...
...
@@ -28,6 +28,9 @@ void tag_save(FILE *file, const struct tag *tag)
if
(
tag
->
time
>=
0
)
fprintf
(
file
,
SONG_TIME
"%i
\n
"
,
tag
->
time
);
if
(
tag
->
has_playlist
)
fprintf
(
file
,
"Playlist: yes
\n
"
);
for
(
unsigned
i
=
0
;
i
<
tag
->
num_items
;
i
++
)
fprintf
(
file
,
"%s: %s
\n
"
,
tag_item_names
[
tag
->
items
[
i
]
->
type
],
...
...
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