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
b8928141
Commit
b8928141
authored
Dec 16, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cue_tag: added function cue_tag()
Merge code from cue_tag_file() and cue_tag_string().
parent
67c41033
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
17 deletions
+29
-17
cue_tag.c
src/cue/cue_tag.c
+25
-17
cue_tag.h
src/cue/cue_tag.h
+4
-0
No files found.
src/cue/cue_tag.c
View file @
b8928141
...
@@ -172,20 +172,15 @@ cue_tag_merge(struct tag *a, struct tag *b)
...
@@ -172,20 +172,15 @@ cue_tag_merge(struct tag *a, struct tag *b)
}
}
struct
tag
*
struct
tag
*
cue_tag
_file
(
FILE
*
fp
,
unsigned
tnum
)
cue_tag
(
struct
Cd
*
cd
,
unsigned
tnum
)
{
{
struct
Cd
*
cd
;
struct
tag
*
cd_tag
,
*
track_tag
;
struct
tag
*
cd_tag
,
*
track_tag
;
assert
(
fp
!=
NULL
);
assert
(
cd
!=
NULL
);
if
(
tnum
>
256
)
if
(
tnum
>
256
)
return
NULL
;
return
NULL
;
cd
=
cue_parse_file
(
fp
);
if
(
cd
==
NULL
)
return
NULL
;
/* tag from CDtext info */
/* tag from CDtext info */
cd_tag
=
cue_tag_cd
(
cd_get_cdtext
(
cd
),
cd_get_rem
(
cd
));
cd_tag
=
cue_tag_cd
(
cd_get_cdtext
(
cd
),
cd_get_rem
(
cd
));
...
@@ -193,16 +188,35 @@ cue_tag_file(FILE *fp, unsigned tnum)
...
@@ -193,16 +188,35 @@ cue_tag_file(FILE *fp, unsigned tnum)
track_tag
=
cue_tag_track
(
track_get_cdtext
(
cd_get_track
(
cd
,
tnum
)),
track_tag
=
cue_tag_track
(
track_get_cdtext
(
cd_get_track
(
cd
,
tnum
)),
track_get_rem
(
cd_get_track
(
cd
,
tnum
)));
track_get_rem
(
cd_get_track
(
cd
,
tnum
)));
return
cue_tag_merge
(
cd_tag
,
track_tag
);
}
struct
tag
*
cue_tag_file
(
FILE
*
fp
,
unsigned
tnum
)
{
struct
Cd
*
cd
;
struct
tag
*
tag
;
assert
(
fp
!=
NULL
);
if
(
tnum
>
256
)
return
NULL
;
cd
=
cue_parse_file
(
fp
);
if
(
cd
==
NULL
)
return
NULL
;
tag
=
cue_tag
(
cd
,
tnum
);
cd_delete
(
cd
);
cd_delete
(
cd
);
return
cue_tag_merge
(
cd_tag
,
track_tag
)
;
return
tag
;
}
}
struct
tag
*
struct
tag
*
cue_tag_string
(
const
char
*
str
,
unsigned
tnum
)
cue_tag_string
(
const
char
*
str
,
unsigned
tnum
)
{
{
struct
Cd
*
cd
;
struct
Cd
*
cd
;
struct
tag
*
cd_tag
,
*
track_
tag
;
struct
tag
*
tag
;
assert
(
str
!=
NULL
);
assert
(
str
!=
NULL
);
...
@@ -213,14 +227,8 @@ cue_tag_string(const char *str, unsigned tnum)
...
@@ -213,14 +227,8 @@ cue_tag_string(const char *str, unsigned tnum)
if
(
cd
==
NULL
)
if
(
cd
==
NULL
)
return
NULL
;
return
NULL
;
/* tag from CDtext info */
tag
=
cue_tag
(
cd
,
tnum
);
cd_tag
=
cue_tag_cd
(
cd_get_cdtext
(
cd
),
cd_get_rem
(
cd
));
/* tag from TRACKtext info */
track_tag
=
cue_tag_track
(
track_get_cdtext
(
cd_get_track
(
cd
,
tnum
)),
track_get_rem
(
cd_get_track
(
cd
,
tnum
)));
cd_delete
(
cd
);
cd_delete
(
cd
);
return
cue_tag_merge
(
cd_tag
,
track_tag
)
;
return
tag
;
}
}
src/cue/cue_tag.h
View file @
b8928141
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
#include <stdio.h>
#include <stdio.h>
struct
tag
;
struct
tag
;
struct
Cd
;
struct
tag
*
cue_tag
(
struct
Cd
*
cd
,
unsigned
tnum
);
struct
tag
*
struct
tag
*
cue_tag_file
(
FILE
*
file
,
unsigned
tnum
);
cue_tag_file
(
FILE
*
file
,
unsigned
tnum
);
...
...
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