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
ffb9874d
Commit
ffb9874d
authored
8 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/sidplay: move code to ScanSidTuneInfo()
parent
228cdbe6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
28 deletions
+35
-28
SidplayDecoderPlugin.cxx
src/decoder/plugins/SidplayDecoderPlugin.cxx
+35
-28
No files found.
src/decoder/plugins/SidplayDecoderPlugin.cxx
View file @
ffb9874d
...
...
@@ -410,31 +410,10 @@ GetInfoString(const SidTuneInfo &info, unsigned i)
#endif
}
static
bool
sidplay_scan_file
(
Path
path_f
s
,
static
void
ScanSidTuneInfo
(
const
SidTuneInfo
&
info
,
unsigned
track
,
unsigned
n_track
s
,
const
TagHandler
&
handler
,
void
*
handler_ctx
)
{
const
auto
container
=
ParseContainerPath
(
path_fs
);
const
unsigned
song_num
=
container
.
track
;
#ifdef HAVE_SIDPLAYFP
SidTune
tune
(
container
.
path
.
c_str
());
#else
SidTuneMod
tune
(
container
.
path
.
c_str
());
#endif
if
(
!
tune
.
getStatus
())
return
false
;
tune
.
selectSong
(
song_num
);
#ifdef HAVE_SIDPLAYFP
const
SidTuneInfo
&
info
=
*
tune
.
getInfo
();
const
unsigned
n_tracks
=
info
.
songs
();
#else
const
SidTuneInfo
&
info
=
tune
.
getInfo
();
const
unsigned
n_tracks
=
info
.
songs
;
#endif
/* title */
const
char
*
title
=
GetInfoString
(
info
,
0
);
if
(
title
==
nullptr
)
...
...
@@ -443,8 +422,8 @@ sidplay_scan_file(Path path_fs,
if
(
n_tracks
>
1
)
{
char
tag_title
[
1024
];
snprintf
(
tag_title
,
sizeof
(
tag_title
),
"%s (%
d
/%u)"
,
title
,
song_num
,
n_tracks
);
"%s (%
u
/%u)"
,
title
,
track
,
n_tracks
);
tag_handler_invoke_tag
(
handler
,
handler_ctx
,
TAG_TITLE
,
tag_title
);
}
else
...
...
@@ -463,9 +442,37 @@ sidplay_scan_file(Path path_fs,
date
);
/* track */
char
track
[
16
];
sprintf
(
track
,
"%d"
,
song_num
);
tag_handler_invoke_tag
(
handler
,
handler_ctx
,
TAG_TRACK
,
track
);
char
track_buffer
[
16
];
sprintf
(
track_buffer
,
"%d"
,
track
);
tag_handler_invoke_tag
(
handler
,
handler_ctx
,
TAG_TRACK
,
track_buffer
);
}
static
bool
sidplay_scan_file
(
Path
path_fs
,
const
TagHandler
&
handler
,
void
*
handler_ctx
)
{
const
auto
container
=
ParseContainerPath
(
path_fs
);
const
unsigned
song_num
=
container
.
track
;
#ifdef HAVE_SIDPLAYFP
SidTune
tune
(
container
.
path
.
c_str
());
#else
SidTuneMod
tune
(
container
.
path
.
c_str
());
#endif
if
(
!
tune
.
getStatus
())
return
false
;
tune
.
selectSong
(
song_num
);
#ifdef HAVE_SIDPLAYFP
const
SidTuneInfo
&
info
=
*
tune
.
getInfo
();
const
unsigned
n_tracks
=
info
.
songs
();
#else
const
SidTuneInfo
&
info
=
tune
.
getInfo
();
const
unsigned
n_tracks
=
info
.
songs
;
#endif
ScanSidTuneInfo
(
info
,
song_num
,
n_tracks
,
handler
,
handler_ctx
);
/* time */
const
auto
duration
=
get_song_length
(
tune
);
...
...
This diff is collapsed.
Click to expand it.
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