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
483daa58
Commit
483daa58
authored
9 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instance: move GlobalEvents::Monitor to Partition
All remaining events are specific to the Partition.
parent
e2bc92d1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
Instance.hxx
src/Instance.hxx
+1
-5
Partition.cxx
src/Partition.cxx
+5
-3
Partition.hxx
src/Partition.hxx
+3
-0
PlaylistGlobal.cxx
src/PlaylistGlobal.cxx
+3
-2
No files found.
src/Instance.hxx
View file @
483daa58
...
...
@@ -23,7 +23,6 @@
#include "check.h"
#include "event/Loop.hxx"
#include "event/MaskMonitor.hxx"
#include "GlobalEvents.hxx"
#include "Compiler.h"
#ifdef ENABLE_NEIGHBOR_PLUGINS
...
...
@@ -66,8 +65,6 @@ struct Instance final
public
NeighborListener
#endif
{
GlobalEvents
::
Monitor
global_events
;
CallbackMaskMonitor
<
Instance
>
idle_monitor
;
#ifdef ENABLE_NEIGHBOR_PLUGINS
...
...
@@ -93,8 +90,7 @@ struct Instance final
StateFile
*
state_file
;
Instance
()
:
global_events
(
event_loop
),
idle_monitor
(
event_loop
,
*
this
,
&
Instance
::
OnIdle
)
{}
:
idle_monitor
(
event_loop
,
*
this
,
&
Instance
::
OnIdle
)
{}
/**
* Initiate shutdown. Wrapper for EventLoop::Break().
...
...
This diff is collapsed.
Click to expand it.
src/Partition.cxx
View file @
483daa58
...
...
@@ -29,7 +29,9 @@ Partition::Partition(Instance &_instance,
unsigned
max_length
,
unsigned
buffer_chunks
,
unsigned
buffered_before_play
)
:
instance
(
_instance
),
playlist
(
max_length
,
*
this
),
:
instance
(
_instance
),
global_events
(
instance
.
event_loop
),
playlist
(
max_length
,
*
this
),
outputs
(
*
this
),
pc
(
*
this
,
outputs
,
buffer_chunks
,
buffered_before_play
)
{
...
...
@@ -95,13 +97,13 @@ Partition::OnQueueSongStarted()
void
Partition
::
OnPlayerSync
()
{
instance
.
global_events
.
Emit
(
GlobalEvents
::
PLAYLIST
);
global_events
.
Emit
(
GlobalEvents
::
PLAYLIST
);
}
void
Partition
::
OnPlayerTagModified
()
{
instance
.
global_events
.
Emit
(
GlobalEvents
::
TAG
);
global_events
.
Emit
(
GlobalEvents
::
TAG
);
}
void
...
...
This diff is collapsed.
Click to expand it.
src/Partition.hxx
View file @
483daa58
...
...
@@ -20,6 +20,7 @@
#ifndef MPD_PARTITION_HXX
#define MPD_PARTITION_HXX
#include "GlobalEvents.hxx"
#include "queue/Playlist.hxx"
#include "queue/Listener.hxx"
#include "output/MultipleOutputs.hxx"
...
...
@@ -40,6 +41,8 @@ class SongLoader;
struct
Partition
final
:
QueueListener
,
PlayerListener
,
MixerListener
{
Instance
&
instance
;
GlobalEvents
::
Monitor
global_events
;
struct
playlist
playlist
;
MultipleOutputs
outputs
;
...
...
This diff is collapsed.
Click to expand it.
src/PlaylistGlobal.cxx
View file @
483daa58
...
...
@@ -26,6 +26,7 @@
#include "PlaylistGlobal.hxx"
#include "Main.hxx"
#include "Instance.hxx"
#include "Partition.hxx"
static
void
playlist_tag_event
(
void
)
...
...
@@ -42,6 +43,6 @@ playlist_event(void)
void
playlist_global_init
()
{
instance
->
global_events
.
Register
(
GlobalEvents
::
TAG
,
playlist_tag_event
);
instance
->
global_events
.
Register
(
GlobalEvents
::
PLAYLIST
,
playlist_event
);
instance
->
partition
->
global_events
.
Register
(
GlobalEvents
::
TAG
,
playlist_tag_event
);
instance
->
partition
->
global_events
.
Register
(
GlobalEvents
::
PLAYLIST
,
playlist_event
);
}
This diff is collapsed.
Click to expand it.
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