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
7c53df2e
Commit
7c53df2e
authored
9 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partition: eliminate GlobalEvents.hxx, add mask constants
parent
5ca60267
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
52 deletions
+10
-52
Makefile.am
Makefile.am
+0
-1
GlobalEvents.hxx
src/GlobalEvents.hxx
+0
-35
Partition.cxx
src/Partition.cxx
+4
-14
Partition.hxx
src/Partition.hxx
+6
-2
No files found.
Makefile.am
View file @
7c53df2e
...
...
@@ -132,7 +132,6 @@ libmpd_a_SOURCES = \
src/IOThread.cxx src/IOThread.hxx
\
src/Instance.cxx src/Instance.hxx
\
src/win32/Win32Main.cxx
\
src/GlobalEvents.hxx
\
src/MixRampInfo.hxx
\
src/MusicBuffer.cxx src/MusicBuffer.hxx
\
src/MusicPipe.cxx src/MusicPipe.hxx
\
...
...
This diff is collapsed.
Click to expand it.
src/GlobalEvents.hxx
deleted
100644 → 0
View file @
5ca60267
/*
* Copyright 2003-2016 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_GLOBAL_EVENTS_HXX
#define MPD_GLOBAL_EVENTS_HXX
namespace
GlobalEvents
{
enum
Event
{
/** must call playlist_sync() */
PLAYLIST
,
/** the current song's tag has changed */
TAG
,
MAX
};
}
#endif
/* MAIN_NOTIFY_H */
This diff is collapsed.
Click to expand it.
src/Partition.cxx
View file @
7c53df2e
...
...
@@ -23,7 +23,6 @@
#include "DetachedSong.hxx"
#include "mixer/Volume.hxx"
#include "Idle.hxx"
#include "GlobalEvents.hxx"
Partition
::
Partition
(
Instance
&
_instance
,
unsigned
max_length
,
...
...
@@ -38,15 +37,6 @@ Partition::Partition(Instance &_instance,
}
void
Partition
::
EmitGlobalEvent
(
GlobalEvents
::
Event
event
)
{
assert
((
unsigned
)
event
<
GlobalEvents
::
MAX
);
const
unsigned
mask
=
1u
<<
unsigned
(
event
);
global_events
.
OrMask
(
mask
);
}
void
Partition
::
EmitIdle
(
unsigned
mask
)
{
idle_add
(
mask
);
...
...
@@ -106,13 +96,13 @@ Partition::OnQueueSongStarted()
void
Partition
::
OnPlayerSync
()
{
EmitGlobalEvent
(
GlobalEvents
::
PLAYLIST
);
EmitGlobalEvent
(
SYNC_WITH_PLAYER
);
}
void
Partition
::
OnPlayerTagModified
()
{
EmitGlobalEvent
(
GlobalEvents
::
TAG
);
EmitGlobalEvent
(
TAG_MODIFIED
);
}
void
...
...
@@ -127,9 +117,9 @@ Partition::OnMixerVolumeChanged(gcc_unused Mixer &mixer, gcc_unused int volume)
void
Partition
::
OnGlobalEvent
(
unsigned
mask
)
{
if
((
mask
&
(
1u
<<
unsigned
(
GlobalEvents
::
TAG
))
)
!=
0
)
if
((
mask
&
TAG_MODIFIED
)
!=
0
)
TagModified
();
if
((
mask
&
(
1u
<<
unsigned
(
GlobalEvents
::
PLAYLIST
))
)
!=
0
)
if
((
mask
&
SYNC_WITH_PLAYER
)
!=
0
)
SyncWithPlayer
();
}
This diff is collapsed.
Click to expand it.
src/Partition.hxx
View file @
7c53df2e
...
...
@@ -21,7 +21,6 @@
#define MPD_PARTITION_HXX
#include "event/MaskMonitor.hxx"
#include "GlobalEvents.hxx"
#include "queue/Playlist.hxx"
#include "queue/Listener.hxx"
#include "output/MultipleOutputs.hxx"
...
...
@@ -40,6 +39,9 @@ class SongLoader;
* a playlist, a player, outputs etc.
*/
struct
Partition
final
:
QueueListener
,
PlayerListener
,
MixerListener
{
static
constexpr
unsigned
TAG_MODIFIED
=
0x1
;
static
constexpr
unsigned
SYNC_WITH_PLAYER
=
0x2
;
Instance
&
instance
;
CallbackMaskMonitor
<
Partition
>
global_events
;
...
...
@@ -55,7 +57,9 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
unsigned
buffer_chunks
,
unsigned
buffered_before_play
);
void
EmitGlobalEvent
(
GlobalEvents
::
Event
event
);
void
EmitGlobalEvent
(
unsigned
mask
)
{
global_events
.
OrMask
(
mask
);
}
void
EmitIdle
(
unsigned
mask
);
...
...
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