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
5821bd1a
Commit
5821bd1a
authored
Dec 16, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cue_tag: fixed indent and code style
parent
c5cdac96
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
72 deletions
+37
-72
cue_tag.c
src/cue/cue_tag.c
+33
-66
cue_tag.h
src/cue/cue_tag.h
+4
-6
No files found.
src/cue/cue_tag.c
View file @
5821bd1a
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
#include <libcue/libcue.h>
#include <libcue/libcue.h>
static
struct
tag
*
static
struct
tag
*
cue_tag_cd
(
struct
Cdtext
*
cdtext
,
struct
Rem
*
rem
)
cue_tag_cd
(
struct
Cdtext
*
cdtext
,
struct
Rem
*
rem
)
{
{
char
*
tmp
=
NULL
;
struct
tag
*
tag
;
struct
tag
*
tag
=
NULL
;
char
*
tmp
;
//if (cdtext == NULL)
//if (cdtext == NULL)
//return NULL;
//return NULL;
...
@@ -17,7 +17,7 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
...
@@ -17,7 +17,7 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
tag_begin_add
(
tag
);
tag_begin_add
(
tag
);
{
/* TAG_ALBUM_ARTIST */
/* TAG_ALBUM_ARTIST */
if
((
tmp
=
cdtext_get
(
PTI_PERFORMER
,
cdtext
))
!=
NULL
)
if
((
tmp
=
cdtext_get
(
PTI_PERFORMER
,
cdtext
))
!=
NULL
)
tag_add_item
(
tag
,
TAG_ALBUM_ARTIST
,
tmp
);
tag_add_item
(
tag
,
TAG_ALBUM_ARTIST
,
tmp
);
...
@@ -29,9 +29,8 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
...
@@ -29,9 +29,8 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
else
if
((
tmp
=
cdtext_get
(
PTI_ARRANGER
,
cdtext
))
!=
NULL
)
else
if
((
tmp
=
cdtext_get
(
PTI_ARRANGER
,
cdtext
))
!=
NULL
)
tag_add_item
(
tag
,
TAG_ALBUM_ARTIST
,
tmp
);
tag_add_item
(
tag
,
TAG_ALBUM_ARTIST
,
tmp
);
/* TAG_ALBUM_ARTIST */
}
{
/* TAG_ARTIST */
/* TAG_ARTIST */
if
((
tmp
=
cdtext_get
(
PTI_PERFORMER
,
cdtext
))
!=
NULL
)
if
((
tmp
=
cdtext_get
(
PTI_PERFORMER
,
cdtext
))
!=
NULL
)
tag_add_item
(
tag
,
TAG_ARTIST
,
tmp
);
tag_add_item
(
tag
,
TAG_ARTIST
,
tmp
);
...
@@ -43,7 +42,6 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
...
@@ -43,7 +42,6 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
else
if
((
tmp
=
cdtext_get
(
PTI_ARRANGER
,
cdtext
))
!=
NULL
)
else
if
((
tmp
=
cdtext_get
(
PTI_ARRANGER
,
cdtext
))
!=
NULL
)
tag_add_item
(
tag
,
TAG_ARTIST
,
tmp
);
tag_add_item
(
tag
,
TAG_ARTIST
,
tmp
);
/* TAG_ARTIST */
}
/* TAG_PERFORMER */
/* TAG_PERFORMER */
if
((
tmp
=
cdtext_get
(
PTI_PERFORMER
,
cdtext
))
!=
NULL
)
if
((
tmp
=
cdtext_get
(
PTI_PERFORMER
,
cdtext
))
!=
NULL
)
...
@@ -94,11 +92,11 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
...
@@ -94,11 +92,11 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
return
tag
;
return
tag
;
}
}
static
struct
tag
*
static
struct
tag
*
cue_tag_track
(
struct
Cdtext
*
cdtext
,
struct
Rem
*
rem
)
cue_tag_track
(
struct
Cdtext
*
cdtext
,
struct
Rem
*
rem
)
{
{
char
*
tmp
=
NULL
;
struct
tag
*
tag
;
struct
tag
*
tag
=
NULL
;
char
*
tmp
;
//if (cdtext == NULL)
//if (cdtext == NULL)
//return NULL;
//return NULL;
...
@@ -107,7 +105,7 @@ cue_tag_track(struct Cdtext* cdtext, struct Rem* rem)
...
@@ -107,7 +105,7 @@ cue_tag_track(struct Cdtext* cdtext, struct Rem* rem)
tag_begin_add
(
tag
);
tag_begin_add
(
tag
);
{
/* TAG_ARTIST */
/* TAG_ARTIST */
if
((
tmp
=
cdtext_get
(
PTI_PERFORMER
,
cdtext
))
!=
NULL
)
if
((
tmp
=
cdtext_get
(
PTI_PERFORMER
,
cdtext
))
!=
NULL
)
tag_add_item
(
tag
,
TAG_ARTIST
,
tmp
);
tag_add_item
(
tag
,
TAG_ARTIST
,
tmp
);
...
@@ -119,7 +117,6 @@ cue_tag_track(struct Cdtext* cdtext, struct Rem* rem)
...
@@ -119,7 +117,6 @@ cue_tag_track(struct Cdtext* cdtext, struct Rem* rem)
else
if
((
tmp
=
cdtext_get
(
PTI_ARRANGER
,
cdtext
))
!=
NULL
)
else
if
((
tmp
=
cdtext_get
(
PTI_ARRANGER
,
cdtext
))
!=
NULL
)
tag_add_item
(
tag
,
TAG_ARTIST
,
tmp
);
tag_add_item
(
tag
,
TAG_ARTIST
,
tmp
);
/* TAG_ARTIST */
}
/* TAG_TITLE */
/* TAG_TITLE */
if
((
tmp
=
cdtext_get
(
PTI_TITLE
,
cdtext
))
!=
NULL
)
if
((
tmp
=
cdtext_get
(
PTI_TITLE
,
cdtext
))
!=
NULL
)
...
@@ -159,14 +156,11 @@ cue_tag_track(struct Cdtext* cdtext, struct Rem* rem)
...
@@ -159,14 +156,11 @@ cue_tag_track(struct Cdtext* cdtext, struct Rem* rem)
return
tag
;
return
tag
;
}
}
struct
tag
*
struct
tag
*
cue_tag_file
(
FILE
*
fp
,
cue_tag_file
(
FILE
*
fp
,
unsigned
tnum
)
const
unsigned
int
tnum
)
{
{
struct
tag
*
cd_tag
=
NULL
;
struct
Cd
*
cd
;
struct
tag
*
track_tag
=
NULL
;
struct
tag
*
cd_tag
,
*
track_tag
;
struct
tag
*
merge_tag
=
NULL
;
struct
Cd
*
cd
=
NULL
;
if
(
tnum
>
256
)
if
(
tnum
>
256
)
return
NULL
;
return
NULL
;
...
@@ -178,49 +172,34 @@ cue_tag_file( FILE* fp,
...
@@ -178,49 +172,34 @@ cue_tag_file( FILE* fp,
if
(
cd
==
NULL
)
if
(
cd
==
NULL
)
return
NULL
;
return
NULL
;
else
{
/* tag from CDtext info */
/* tag from CDtext info */
cd_tag
=
cue_tag_cd
(
cd_get_cdtext
(
cd
),
cd_tag
=
cue_tag_cd
(
cd_get_cdtext
(
cd
),
cd_get_rem
(
cd
));
cd_get_rem
(
cd
));
/* tag from TRACKtext info */
/* tag from TRACKtext info */
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
)));
cd_delete
(
cd
);
cd_delete
(
cd
);
}
if
((
cd_tag
!=
NULL
)
&&
(
track_tag
!=
NULL
))
if
(
cd_tag
!=
NULL
&&
track_tag
!=
NULL
)
{
{
struct
tag
*
merge_tag
=
tag_merge
(
cd_tag
,
track_tag
);
merge_tag
=
tag_merge
(
cd_tag
,
track_tag
);
tag_free
(
cd_tag
);
tag_free
(
cd_tag
);
tag_free
(
track_tag
);
tag_free
(
track_tag
);
return
merge_tag
;
return
merge_tag
;
}
}
else
if
(
cd_tag
!=
NULL
)
else
if
(
cd_tag
!=
NULL
)
{
return
cd_tag
;
return
cd_tag
;
}
else
if
(
track_tag
!=
NULL
)
else
if
(
track_tag
!=
NULL
)
{
return
track_tag
;
return
track_tag
;
}
else
else
return
NULL
;
return
NULL
;
}
}
struct
tag
*
struct
tag
*
cue_tag_string
(
char
*
str
,
cue_tag_string
(
char
*
str
,
unsigned
tnum
)
const
unsigned
int
tnum
)
{
{
struct
tag
*
cd_tag
=
NULL
;
struct
Cd
*
cd
;
struct
tag
*
track_tag
=
NULL
;
struct
tag
*
cd_tag
,
*
track_tag
;
struct
tag
*
merge_tag
=
NULL
;
struct
Cd
*
cd
=
NULL
;
if
(
tnum
>
256
)
if
(
tnum
>
256
)
return
NULL
;
return
NULL
;
...
@@ -232,37 +211,25 @@ cue_tag_string( char* str,
...
@@ -232,37 +211,25 @@ cue_tag_string( char* str,
if
(
cd
==
NULL
)
if
(
cd
==
NULL
)
return
NULL
;
return
NULL
;
else
{
/* tag from CDtext info */
/* tag from CDtext info */
cd_tag
=
cue_tag_cd
(
cd_get_cdtext
(
cd
),
cd_tag
=
cue_tag_cd
(
cd_get_cdtext
(
cd
),
cd_get_rem
(
cd
));
cd_get_rem
(
cd
));
/* tag from TRACKtext info */
/* tag from TRACKtext info */
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
)));
cd_delete
(
cd
);
cd_delete
(
cd
);
}
if
((
cd_tag
!=
NULL
)
&&
(
track_tag
!=
NULL
))
if
(
cd_tag
!=
NULL
&&
track_tag
!=
NULL
)
{
{
struct
tag
*
merge_tag
=
tag_merge
(
cd_tag
,
track_tag
);
merge_tag
=
tag_merge
(
cd_tag
,
track_tag
);
tag_free
(
cd_tag
);
tag_free
(
cd_tag
);
tag_free
(
track_tag
);
tag_free
(
track_tag
);
return
merge_tag
;
return
merge_tag
;
}
}
else
if
(
cd_tag
!=
NULL
)
else
if
(
cd_tag
!=
NULL
)
{
return
cd_tag
;
return
cd_tag
;
}
else
if
(
track_tag
!=
NULL
)
else
if
(
track_tag
!=
NULL
)
{
return
track_tag
;
return
track_tag
;
}
else
else
return
NULL
;
return
NULL
;
}
}
src/cue/cue_tag.h
View file @
5821bd1a
...
@@ -9,13 +9,11 @@
...
@@ -9,13 +9,11 @@
struct
tag
;
struct
tag
;
struct
tag
*
struct
tag
*
cue_tag_file
(
FILE
*
,
cue_tag_file
(
FILE
*
file
,
unsigned
tnum
);
const
unsigned
int
);
struct
tag
*
struct
tag
*
cue_tag_string
(
char
*
,
cue_tag_string
(
char
*
str
,
unsigned
tnum
);
const
unsigned
int
);
#endif
/* libcue */
#endif
/* libcue */
#endif
#endif
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