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
0ff0aca2
Commit
0ff0aca2
authored
Jul 17, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/Init: use struct ConfigData
parent
7b02c022
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
18 deletions
+20
-18
Main.cxx
src/Main.cxx
+2
-1
Init.cxx
src/input/Init.cxx
+4
-4
Init.hxx
src/input/Init.hxx
+2
-1
dump_playlist.cxx
test/dump_playlist.cxx
+1
-1
dump_text_file.cxx
test/dump_text_file.cxx
+3
-4
read_tags.cxx
test/read_tags.cxx
+1
-1
run_decoder.cxx
test/run_decoder.cxx
+2
-1
run_input.cxx
test/run_input.cxx
+2
-1
visit_archive.cxx
test/visit_archive.cxx
+3
-4
No files found.
src/Main.cxx
View file @
0ff0aca2
...
...
@@ -570,7 +570,8 @@ try {
}
client_manager_init
();
input_stream_global_init
(
instance
->
io_thread
.
GetEventLoop
());
input_stream_global_init
(
GetGlobalConfig
(),
instance
->
io_thread
.
GetEventLoop
());
playlist_list_global_init
();
#ifdef ENABLE_DAEMON
...
...
src/input/Init.cxx
View file @
0ff0aca2
...
...
@@ -21,7 +21,7 @@
#include "Init.hxx"
#include "Registry.hxx"
#include "InputPlugin.hxx"
#include "config/
Global
.hxx"
#include "config/
Data
.hxx"
#include "config/Option.hxx"
#include "config/Block.hxx"
#include "Log.hxx"
...
...
@@ -33,7 +33,7 @@
#include <assert.h>
void
input_stream_global_init
(
EventLoop
&
event_loop
)
input_stream_global_init
(
const
ConfigData
&
config
,
EventLoop
&
event_loop
)
{
const
ConfigBlock
empty
;
...
...
@@ -45,8 +45,8 @@ input_stream_global_init(EventLoop &event_loop)
assert
(
plugin
->
open
!=
nullptr
);
const
auto
*
block
=
config
_find_b
lock
(
ConfigBlockOption
::
INPUT
,
"plugin"
,
plugin
->
name
);
config
.
FindB
lock
(
ConfigBlockOption
::
INPUT
,
"plugin"
,
plugin
->
name
);
if
(
block
==
nullptr
)
{
block
=
&
empty
;
}
else
if
(
!
block
->
GetBlockValue
(
"enabled"
,
true
))
...
...
src/input/Init.hxx
View file @
0ff0aca2
...
...
@@ -20,13 +20,14 @@
#ifndef MPD_INPUT_INIT_HXX
#define MPD_INPUT_INIT_HXX
struct
ConfigData
;
class
EventLoop
;
/**
* Initializes this library and all #InputStream implementations.
*/
void
input_stream_global_init
(
EventLoop
&
event_loop
);
input_stream_global_init
(
const
ConfigData
&
config
,
EventLoop
&
event_loop
);
/**
* Deinitializes this library and all #InputStream implementations.
...
...
test/dump_playlist.cxx
View file @
0ff0aca2
...
...
@@ -67,7 +67,7 @@ try {
EventThread
io_thread
;
io_thread
.
Start
();
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
GetGlobalConfig
(),
io_thread
.
GetEventLoop
());
playlist_list_global_init
();
decoder_plugin_init_all
(
GetGlobalConfig
());
...
...
test/dump_text_file.cxx
View file @
0ff0aca2
...
...
@@ -22,7 +22,7 @@
#include "input/Init.hxx"
#include "input/InputStream.hxx"
#include "input/TextInputStream.hxx"
#include "config/
Global
.hxx"
#include "config/
Data
.hxx"
#include "util/PrintException.hxx"
#ifdef ENABLE_ARCHIVE
...
...
@@ -41,11 +41,11 @@ class GlobalInit {
public
:
GlobalInit
()
{
io_thread
.
Start
();
config_global_init
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
ConfigData
(),
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
...
...
@@ -53,7 +53,6 @@ public:
#ifdef ENABLE_ARCHIVE
archive_plugin_deinit_all
();
#endif
config_global_finish
();
}
};
...
...
test/read_tags.cxx
View file @
0ff0aca2
...
...
@@ -93,7 +93,7 @@ try {
EventThread
io_thread
;
io_thread
.
Start
();
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
ConfigData
(),
io_thread
.
GetEventLoop
());
AtScopeExit
()
{
input_stream_global_finish
();
};
decoder_plugin_init_all
(
ConfigData
());
...
...
test/run_decoder.cxx
View file @
0ff0aca2
...
...
@@ -98,7 +98,8 @@ public:
if
(
!
config_path
.
IsNull
())
ReadConfigFile
(
config_path
);
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
GetGlobalConfig
(),
io_thread
.
GetEventLoop
());
decoder_plugin_init_all
(
GetGlobalConfig
());
}
...
...
test/run_input.cxx
View file @
0ff0aca2
...
...
@@ -116,7 +116,8 @@ public:
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
GetGlobalConfig
(),
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
...
...
test/visit_archive.cxx
View file @
0ff0aca2
...
...
@@ -19,7 +19,7 @@
#include "config.h"
#include "tag/Tag.hxx"
#include "config/
Global
.hxx"
#include "config/
Data
.hxx"
#include "event/Thread.hxx"
#include "input/Init.hxx"
#include "archive/ArchiveList.hxx"
...
...
@@ -41,11 +41,11 @@ class GlobalInit {
public
:
GlobalInit
()
{
io_thread
.
Start
();
config_global_init
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
ConfigData
(),
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
...
...
@@ -53,7 +53,6 @@ public:
#ifdef ENABLE_ARCHIVE
archive_plugin_deinit_all
();
#endif
config_global_finish
();
}
};
...
...
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