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
72c96052
Commit
72c96052
authored
Nov 22, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/gme: move gme_container_scan() down
parent
2ab16873
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
32 deletions
+32
-32
GmeDecoderPlugin.cxx
src/decoder/plugins/GmeDecoderPlugin.cxx
+32
-32
No files found.
src/decoder/plugins/GmeDecoderPlugin.cxx
View file @
72c96052
...
@@ -103,38 +103,6 @@ ParseContainerPath(Path path_fs)
...
@@ -103,38 +103,6 @@ ParseContainerPath(Path path_fs)
return
{
path_fs
.
GetDirectoryName
(),
track
-
1
};
return
{
path_fs
.
GetDirectoryName
(),
track
-
1
};
}
}
static
std
::
forward_list
<
std
::
string
>
gme_container_scan
(
Path
path_fs
)
{
std
::
forward_list
<
std
::
string
>
list
;
Music_Emu
*
emu
;
const
char
*
gme_err
=
gme_open_file
(
path_fs
.
c_str
(),
&
emu
,
GME_SAMPLE_RATE
);
if
(
gme_err
!=
nullptr
)
{
LogWarning
(
gme_domain
,
gme_err
);
return
list
;
}
const
unsigned
num_songs
=
gme_track_count
(
emu
);
gme_delete
(
emu
);
/* if it only contains a single tune, don't treat as container */
if
(
num_songs
<
2
)
return
list
;
const
char
*
subtune_suffix
=
uri_get_suffix
(
path_fs
.
c_str
());
auto
tail
=
list
.
before_begin
();
for
(
unsigned
i
=
1
;
i
<=
num_songs
;
++
i
)
{
char
track_name
[
64
];
snprintf
(
track_name
,
sizeof
(
track_name
),
SUBTUNE_PREFIX
"%03u.%s"
,
i
,
subtune_suffix
);
tail
=
list
.
emplace_after
(
tail
,
track_name
);
}
return
list
;
}
static
void
static
void
gme_file_decode
(
DecoderClient
&
client
,
Path
path_fs
)
gme_file_decode
(
DecoderClient
&
client
,
Path
path_fs
)
{
{
...
@@ -298,6 +266,38 @@ gme_scan_file(Path path_fs,
...
@@ -298,6 +266,38 @@ gme_scan_file(Path path_fs,
return
ScanMusicEmu
(
emu
,
container
.
track
,
handler
,
handler_ctx
);
return
ScanMusicEmu
(
emu
,
container
.
track
,
handler
,
handler_ctx
);
}
}
static
std
::
forward_list
<
std
::
string
>
gme_container_scan
(
Path
path_fs
)
{
std
::
forward_list
<
std
::
string
>
list
;
Music_Emu
*
emu
;
const
char
*
gme_err
=
gme_open_file
(
path_fs
.
c_str
(),
&
emu
,
GME_SAMPLE_RATE
);
if
(
gme_err
!=
nullptr
)
{
LogWarning
(
gme_domain
,
gme_err
);
return
list
;
}
const
unsigned
num_songs
=
gme_track_count
(
emu
);
gme_delete
(
emu
);
/* if it only contains a single tune, don't treat as container */
if
(
num_songs
<
2
)
return
list
;
const
char
*
subtune_suffix
=
uri_get_suffix
(
path_fs
.
c_str
());
auto
tail
=
list
.
before_begin
();
for
(
unsigned
i
=
1
;
i
<=
num_songs
;
++
i
)
{
char
track_name
[
64
];
snprintf
(
track_name
,
sizeof
(
track_name
),
SUBTUNE_PREFIX
"%03u.%s"
,
i
,
subtune_suffix
);
tail
=
list
.
emplace_after
(
tail
,
track_name
);
}
return
list
;
}
static
const
char
*
const
gme_suffixes
[]
=
{
static
const
char
*
const
gme_suffixes
[]
=
{
"ay"
,
"gbs"
,
"gym"
,
"hes"
,
"kss"
,
"nsf"
,
"ay"
,
"gbs"
,
"gym"
,
"hes"
,
"kss"
,
"nsf"
,
"nsfe"
,
"sap"
,
"spc"
,
"vgm"
,
"vgz"
,
"nsfe"
,
"sap"
,
"spc"
,
"vgm"
,
"vgz"
,
...
...
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