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
b24a5e06
Commit
b24a5e06
authored
Mar 05, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partition: add method EmitIdle()
Prepare for moving idle events to class Partition. Right now, it's just a wrapper for idle_add().
parent
e52ac0b1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
13 deletions
+21
-13
Instance.cxx
src/Instance.cxx
+2
-3
Partition.cxx
src/Partition.cxx
+8
-1
Partition.hxx
src/Partition.hxx
+2
-0
ReplayGainConfig.cxx
src/ReplayGainConfig.cxx
+0
-3
ClientSubscribe.cxx
src/client/ClientSubscribe.cxx
+3
-2
PlayerCommands.cxx
src/command/PlayerCommands.cxx
+2
-0
StorageCommands.cxx
src/command/StorageCommands.cxx
+4
-4
No files found.
src/Instance.cxx
View file @
b24a5e06
...
...
@@ -77,7 +77,6 @@ Instance::OnDatabaseModified()
stats_invalidate
();
partition
->
DatabaseModified
(
*
database
);
idle_add
(
IDLE_DATABASE
);
}
void
...
...
@@ -102,13 +101,13 @@ Instance::OnDatabaseSongRemoved(const LightSong &song)
void
Instance
::
FoundNeighbor
(
gcc_unused
const
NeighborInfo
&
info
)
{
idle_add
(
IDLE_NEIGHBOR
);
partition
->
EmitIdle
(
IDLE_NEIGHBOR
);
}
void
Instance
::
LostNeighbor
(
gcc_unused
const
NeighborInfo
&
info
)
{
idle_add
(
IDLE_NEIGHBOR
);
partition
->
EmitIdle
(
IDLE_NEIGHBOR
);
}
#endif
src/Partition.cxx
View file @
b24a5e06
...
...
@@ -25,6 +25,12 @@
#include "Idle.hxx"
#include "GlobalEvents.hxx"
void
Partition
::
EmitIdle
(
unsigned
mask
)
{
idle_add
(
mask
);
}
#ifdef ENABLE_DATABASE
const
Database
*
...
...
@@ -37,6 +43,7 @@ void
Partition
::
DatabaseModified
(
const
Database
&
db
)
{
playlist
.
DatabaseModified
(
db
);
EmitIdle
(
IDLE_DATABASE
);
}
#endif
...
...
@@ -75,5 +82,5 @@ Partition::OnMixerVolumeChanged(gcc_unused Mixer &mixer, gcc_unused int volume)
InvalidateHardwareVolume
();
/* notify clients */
idle_add
(
IDLE_MIXER
);
EmitIdle
(
IDLE_MIXER
);
}
src/Partition.hxx
View file @
b24a5e06
...
...
@@ -53,6 +53,8 @@ struct Partition final : private PlayerListener, private MixerListener {
outputs
(
*
this
),
pc
(
*
this
,
outputs
,
buffer_chunks
,
buffered_before_play
)
{}
void
EmitIdle
(
unsigned
mask
);
void
ClearQueue
()
{
playlist
.
Clear
(
pc
);
}
...
...
src/ReplayGainConfig.cxx
View file @
b24a5e06
...
...
@@ -19,7 +19,6 @@
#include "config.h"
#include "ReplayGainConfig.hxx"
#include "Idle.hxx"
#include "config/Param.hxx"
#include "config/ConfigGlobal.hxx"
#include "system/FatalError.hxx"
...
...
@@ -74,8 +73,6 @@ replay_gain_set_mode_string(const char *p)
else
return
false
;
idle_add
(
IDLE_OPTIONS
);
return
true
;
}
...
...
src/client/ClientSubscribe.cxx
View file @
b24a5e06
...
...
@@ -19,6 +19,7 @@
#include "config.h"
#include "ClientInternal.hxx"
#include "Partition.hxx"
#include "Idle.hxx"
#include <assert.h>
...
...
@@ -40,7 +41,7 @@ Client::Subscribe(const char *channel)
++
num_subscriptions
;
idle_add
(
IDLE_SUBSCRIPTION
);
partition
.
EmitIdle
(
IDLE_SUBSCRIPTION
);
return
Client
::
SubscribeResult
::
OK
;
}
...
...
@@ -57,7 +58,7 @@ Client::Unsubscribe(const char *channel)
subscriptions
.
erase
(
i
);
--
num_subscriptions
;
idle_add
(
IDLE_SUBSCRIPTION
);
partition
.
EmitIdle
(
IDLE_SUBSCRIPTION
);
assert
((
num_subscriptions
==
0
)
==
subscriptions
.
empty
());
...
...
src/command/PlayerCommands.cxx
View file @
b24a5e06
...
...
@@ -28,6 +28,7 @@
#include "mixer/Volume.hxx"
#include "Partition.hxx"
#include "Instance.hxx"
#include "Idle.hxx"
#include "AudioFormat.hxx"
#include "ReplayGainConfig.hxx"
...
...
@@ -348,6 +349,7 @@ handle_replay_gain_mode(Client &client, Request args, Response &r)
}
client
.
partition
.
outputs
.
SetReplayGainMode
(
replay_gain_get_real_mode
(
client
.
playlist
.
queue
.
random
));
client
.
partition
.
EmitIdle
(
IDLE_OPTIONS
);
return
CommandResult
::
OK
;
}
...
...
src/command/StorageCommands.cxx
View file @
b24a5e06
...
...
@@ -230,7 +230,7 @@ handle_mount(Client &client, Request args, Response &r)
}
composite
.
Mount
(
local_uri
,
storage
);
idle_add
(
IDLE_MOUNT
);
client
.
partition
.
EmitIdle
(
IDLE_MOUNT
);
#ifdef ENABLE_DATABASE
Database
*
_db
=
client
.
partition
.
instance
.
database
;
...
...
@@ -249,7 +249,7 @@ handle_mount(Client &client, Request args, Response &r)
// TODO: call Instance::OnDatabaseModified()?
// TODO: trigger database update?
idle_add
(
IDLE_DATABASE
);
client
.
partition
.
EmitIdle
(
IDLE_DATABASE
);
}
#endif
...
...
@@ -287,7 +287,7 @@ handle_unmount(Client &client, Request args, Response &r)
if
(
db
.
Unmount
(
local_uri
))
// TODO: call Instance::OnDatabaseModified()?
idle_add
(
IDLE_DATABASE
);
client
.
partition
.
EmitIdle
(
IDLE_DATABASE
);
}
#endif
...
...
@@ -296,7 +296,7 @@ handle_unmount(Client &client, Request args, Response &r)
return
CommandResult
::
ERROR
;
}
idle_add
(
IDLE_MOUNT
);
client
.
partition
.
EmitIdle
(
IDLE_MOUNT
);
return
CommandResult
::
OK
;
}
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