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
85216966
Commit
85216966
authored
Aug 10, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/wildmidi: use class Path for the "timidity.cfg" location
parent
1c823e9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
WildmidiDecoderPlugin.cxx
src/decoder/WildmidiDecoderPlugin.cxx
+14
-10
No files found.
src/decoder/WildmidiDecoderPlugin.cxx
View file @
85216966
...
...
@@ -21,7 +21,9 @@
#include "WildmidiDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
#include "TagHandler.hxx"
#include "glib_compat.h"
#include "fs/Path.hxx"
#include "fs/FileSystem.hxx"
#include "system/FatalError.hxx"
#include <glib.h>
...
...
@@ -37,18 +39,20 @@ static constexpr unsigned WILDMIDI_SAMPLE_RATE = 48000;
static
bool
wildmidi_init
(
const
config_param
&
param
)
{
const
char
*
config_file
;
int
ret
;
config_file
=
param
.
GetBlockValue
(
"config_file"
,
"/etc/timidity/timidity.cfg"
);
if
(
!
g_file_test
(
config_file
,
G_FILE_TEST_IS_REGULAR
))
{
g_debug
(
"configuration file does not exist: %s"
,
config_file
);
GError
*
error
=
nullptr
;
const
Path
path
=
param
.
GetBlockPath
(
"config_file"
,
"/etc/timidity/timidity.cfg"
,
&
error
);
if
(
path
.
IsNull
())
FatalError
(
error
);
if
(
!
FileExists
(
path
))
{
const
auto
utf8
=
path
.
ToUTF8
();
g_debug
(
"configuration file does not exist: %s"
,
utf8
.
c_str
());
return
false
;
}
ret
=
WildMidi_Init
(
config_file
,
WILDMIDI_SAMPLE_RATE
,
0
);
return
ret
==
0
;
return
WildMidi_Init
(
path
.
c_str
(),
WILDMIDI_SAMPLE_RATE
,
0
)
==
0
;
}
static
void
...
...
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