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
2c7bf61e
Commit
2c7bf61e
authored
Nov 14, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mikmod: no CamelCase
parent
7efb5489
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
28 deletions
+34
-28
mikmod_plugin.c
src/decoder/mikmod_plugin.c
+34
-28
No files found.
src/decoder/mikmod_plugin.c
View file @
2c7bf61e
...
@@ -31,23 +31,27 @@
...
@@ -31,23 +31,27 @@
#define MIKMOD_FRAME_SIZE 4096
#define MIKMOD_FRAME_SIZE 4096
static
BOOL
mod_mpd_Init
(
void
)
static
BOOL
mikmod_mpd_init
(
void
)
{
{
return
VC_Init
();
return
VC_Init
();
}
}
static
void
mod_mpd_Exit
(
void
)
static
void
mikmod_mpd_exit
(
void
)
{
{
VC_Exit
();
VC_Exit
();
}
}
static
void
mod_mpd_Update
(
void
)
static
void
mikmod_mpd_update
(
void
)
{
{
}
}
static
BOOL
mod_mpd_IsThere
(
void
)
static
BOOL
mikmod_mpd_is_present
(
void
)
{
{
return
1
;
return
true
;
}
}
static
char
drv_name
[]
=
"MPD"
;
static
char
drv_name
[]
=
"MPD"
;
...
@@ -70,18 +74,18 @@ static MDRIVER drv_mpd = {
...
@@ -70,18 +74,18 @@ static MDRIVER drv_mpd = {
#endif
#endif
NULL
,
/* CommandLine */
NULL
,
/* CommandLine */
#endif
#endif
m
od_mpd_IsThere
,
m
ikmod_mpd_is_present
,
VC_SampleLoad
,
VC_SampleLoad
,
VC_SampleUnload
,
VC_SampleUnload
,
VC_SampleSpace
,
VC_SampleSpace
,
VC_SampleLength
,
VC_SampleLength
,
m
od_mpd_I
nit
,
m
ikmod_mpd_i
nit
,
m
od_mpd_E
xit
,
m
ikmod_mpd_e
xit
,
NULL
,
NULL
,
VC_SetNumVoices
,
VC_SetNumVoices
,
VC_PlayStart
,
VC_PlayStart
,
VC_PlayStop
,
VC_PlayStop
,
m
od_mpd_U
pdate
,
m
ikmod_mpd_u
pdate
,
NULL
,
NULL
,
VC_VoiceSetVolume
,
VC_VoiceSetVolume
,
VC_VoiceGetVolume
,
VC_VoiceGetVolume
,
...
@@ -97,7 +101,7 @@ static MDRIVER drv_mpd = {
...
@@ -97,7 +101,7 @@ static MDRIVER drv_mpd = {
};
};
static
bool
static
bool
m
od_initMikMod
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
m
ikmod_decoder_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
{
static
char
params
[]
=
""
;
static
char
params
[]
=
""
;
...
@@ -121,13 +125,14 @@ mod_initMikMod(G_GNUC_UNUSED const struct config_param *param)
...
@@ -121,13 +125,14 @@ mod_initMikMod(G_GNUC_UNUSED const struct config_param *param)
return
true
;
return
true
;
}
}
static
void
mod_finishMikMod
(
void
)
static
void
mikmod_decoder_finish
(
void
)
{
{
MikMod_Exit
();
MikMod_Exit
();
}
}
static
void
static
void
m
od_decode
(
struct
decoder
*
decoder
,
const
char
*
path
)
m
ikmod_decoder_file_decode
(
struct
decoder
*
decoder
,
const
char
*
path_fs
)
{
{
char
*
path2
;
char
*
path2
;
MODULE
*
handle
;
MODULE
*
handle
;
...
@@ -138,12 +143,12 @@ mod_decode(struct decoder *decoder, const char *path)
...
@@ -138,12 +143,12 @@ mod_decode(struct decoder *decoder, const char *path)
SBYTE
buffer
[
MIKMOD_FRAME_SIZE
];
SBYTE
buffer
[
MIKMOD_FRAME_SIZE
];
enum
decoder_command
cmd
=
DECODE_COMMAND_NONE
;
enum
decoder_command
cmd
=
DECODE_COMMAND_NONE
;
path2
=
g_strdup
(
path
);
path2
=
g_strdup
(
path
_fs
);
handle
=
Player_Load
(
path2
,
128
,
0
);
handle
=
Player_Load
(
path2
,
128
,
0
);
g_free
(
path2
);
g_free
(
path2
);
if
(
handle
==
NULL
)
{
if
(
handle
==
NULL
)
{
g_warning
(
"failed to open mod: %s
\n
"
,
path
);
g_warning
(
"failed to open mod: %s
"
,
path_fs
);
return
;
return
;
}
}
...
@@ -171,29 +176,30 @@ mod_decode(struct decoder *decoder, const char *path)
...
@@ -171,29 +176,30 @@ mod_decode(struct decoder *decoder, const char *path)
Player_Free
(
handle
);
Player_Free
(
handle
);
}
}
static
struct
tag
*
modTagDup
(
const
char
*
file
)
static
struct
tag
*
mikmod_decoder_tag_dup
(
const
char
*
path_fs
)
{
{
char
*
path2
;
char
*
path2
;
struct
tag
*
ret
=
NULL
;
struct
tag
*
ret
=
NULL
;
MODULE
*
moduleH
andle
;
MODULE
*
h
andle
;
char
*
title
;
char
*
title
;
path2
=
g_strdup
(
file
);
path2
=
g_strdup
(
path_fs
);
moduleH
andle
=
Player_Load
(
path2
,
128
,
0
);
h
andle
=
Player_Load
(
path2
,
128
,
0
);
g_free
(
path2
);
g_free
(
path2
);
if
(
moduleH
andle
==
NULL
)
{
if
(
h
andle
==
NULL
)
{
g_debug
(
"Failed to open file: %s"
,
file
);
g_debug
(
"Failed to open file: %s"
,
path_fs
);
return
NULL
;
return
NULL
;
}
}
Player_Free
(
moduleH
andle
);
Player_Free
(
h
andle
);
ret
=
tag_new
();
ret
=
tag_new
();
ret
->
time
=
0
;
ret
->
time
=
0
;
path2
=
g_strdup
(
file
);
path2
=
g_strdup
(
path_fs
);
title
=
g_strdup
(
Player_LoadTitle
(
path2
));
title
=
g_strdup
(
Player_LoadTitle
(
path2
));
g_free
(
path2
);
g_free
(
path2
);
if
(
title
)
if
(
title
)
...
@@ -202,7 +208,7 @@ static struct tag *modTagDup(const char *file)
...
@@ -202,7 +208,7 @@ static struct tag *modTagDup(const char *file)
return
ret
;
return
ret
;
}
}
static
const
char
*
const
m
odS
uffixes
[]
=
{
static
const
char
*
const
m
ikmod_decoder_s
uffixes
[]
=
{
"amf"
,
"amf"
,
"dsm"
,
"dsm"
,
"far"
,
"far"
,
...
@@ -223,9 +229,9 @@ static const char *const modSuffixes[] = {
...
@@ -223,9 +229,9 @@ static const char *const modSuffixes[] = {
const
struct
decoder_plugin
mikmod_decoder_plugin
=
{
const
struct
decoder_plugin
mikmod_decoder_plugin
=
{
.
name
=
"mikmod"
,
.
name
=
"mikmod"
,
.
init
=
m
od_initMikMod
,
.
init
=
m
ikmod_decoder_init
,
.
finish
=
m
od_finishMikMod
,
.
finish
=
m
ikmod_decoder_finish
,
.
file_decode
=
m
od
_decode
,
.
file_decode
=
m
ikmod_decoder_file
_decode
,
.
tag_dup
=
m
odTagD
up
,
.
tag_dup
=
m
ikmod_decoder_tag_d
up
,
.
suffixes
=
m
odS
uffixes
,
.
suffixes
=
m
ikmod_decoder_s
uffixes
,
};
};
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