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
031410c7
Commit
031410c7
authored
Mar 05, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instance: add StateFile* attribute
parent
710def8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
Instance.hxx
src/Instance.hxx
+3
-0
Main.cxx
src/Main.cxx
+9
-11
No files found.
src/Instance.hxx
View file @
031410c7
...
@@ -40,6 +40,7 @@ class UpdateService;
...
@@ -40,6 +40,7 @@ class UpdateService;
class
Error
;
class
Error
;
class
ClientList
;
class
ClientList
;
struct
Partition
;
struct
Partition
;
class
StateFile
;
struct
Instance
final
struct
Instance
final
#if defined(ENABLE_DATABASE) || defined(ENABLE_NEIGHBOR_PLUGINS)
#if defined(ENABLE_DATABASE) || defined(ENABLE_NEIGHBOR_PLUGINS)
...
@@ -79,6 +80,8 @@ struct Instance final
...
@@ -79,6 +80,8 @@ struct Instance final
Partition
*
partition
;
Partition
*
partition
;
StateFile
*
state_file
;
Instance
()
:
global_events
(
event_loop
)
{}
Instance
()
:
global_events
(
event_loop
)
{}
/**
/**
...
...
src/Main.cxx
View file @
031410c7
...
@@ -128,8 +128,6 @@ Context *context;
...
@@ -128,8 +128,6 @@ Context *context;
Instance
*
instance
;
Instance
*
instance
;
static
StateFile
*
state_file
;
#ifdef ENABLE_DAEMON
#ifdef ENABLE_DAEMON
static
bool
static
bool
...
@@ -284,10 +282,10 @@ glue_state_file_init(Error &error)
...
@@ -284,10 +282,10 @@ glue_state_file_init(Error &error)
config_get_unsigned
(
ConfigOption
::
STATE_FILE_INTERVAL
,
config_get_unsigned
(
ConfigOption
::
STATE_FILE_INTERVAL
,
StateFile
::
DEFAULT_INTERVAL
);
StateFile
::
DEFAULT_INTERVAL
);
state_file
=
new
StateFile
(
std
::
move
(
path_fs
),
interval
,
instance
->
state_file
=
new
StateFile
(
std
::
move
(
path_fs
),
interval
,
*
instance
->
partition
,
*
instance
->
partition
,
instance
->
event_loop
);
instance
->
event_loop
);
state_file
->
Read
();
instance
->
state_file
->
Read
();
return
true
;
return
true
;
}
}
...
@@ -380,8 +378,8 @@ idle_event_emitted(void)
...
@@ -380,8 +378,8 @@ idle_event_emitted(void)
instance
->
client_list
->
IdleAdd
(
flags
);
instance
->
client_list
->
IdleAdd
(
flags
);
if
(
flags
&
(
IDLE_PLAYLIST
|
IDLE_PLAYER
|
IDLE_MIXER
|
IDLE_OUTPUT
)
&&
if
(
flags
&
(
IDLE_PLAYLIST
|
IDLE_PLAYER
|
IDLE_MIXER
|
IDLE_OUTPUT
)
&&
state_file
!=
nullptr
)
instance
->
state_file
!=
nullptr
)
state_file
->
CheckModified
();
instance
->
state_file
->
CheckModified
();
}
}
#ifndef ANDROID
#ifndef ANDROID
...
@@ -655,9 +653,9 @@ try {
...
@@ -655,9 +653,9 @@ try {
instance
->
update
->
CancelAllAsync
();
instance
->
update
->
CancelAllAsync
();
#endif
#endif
if
(
state_file
!=
nullptr
)
{
if
(
instance
->
state_file
!=
nullptr
)
{
state_file
->
Write
();
instance
->
state_file
->
Write
();
delete
state_file
;
delete
instance
->
state_file
;
}
}
instance
->
partition
->
pc
.
Kill
();
instance
->
partition
->
pc
.
Kill
();
...
...
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