aboutsummaryrefslogtreecommitdiffstats
path: root/src/Partition.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Partition.cxx41
1 files changed, 35 insertions, 6 deletions
diff --git a/src/Partition.cxx b/src/Partition.cxx
index 55750cfad..de1170557 100644
--- a/src/Partition.cxx
+++ b/src/Partition.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2013 The Music Player Daemon Project
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -19,21 +19,29 @@
#include "config.h"
#include "Partition.hxx"
-#include "Song.hxx"
+#include "DetachedSong.hxx"
+#include "output/MultipleOutputs.hxx"
+#include "mixer/Volume.hxx"
+#include "Idle.hxx"
+#include "GlobalEvents.hxx"
+
+#ifdef ENABLE_DATABASE
void
-Partition::DatabaseModified()
+Partition::DatabaseModified(const Database &db)
{
- playlist.DatabaseModified();
+ playlist.DatabaseModified(db);
}
+#endif
+
void
Partition::TagModified()
{
- Song *song = pc.LockReadTaggedSong();
+ DetachedSong *song = pc.LockReadTaggedSong();
if (song != nullptr) {
playlist.TagModified(std::move(*song));
- song->Free();
+ delete song;
}
}
@@ -42,3 +50,24 @@ Partition::SyncWithPlayer()
{
playlist.SyncWithPlayer(pc);
}
+
+void
+Partition::OnPlayerSync()
+{
+ GlobalEvents::Emit(GlobalEvents::PLAYLIST);
+}
+
+void
+Partition::OnPlayerTagModified()
+{
+ GlobalEvents::Emit(GlobalEvents::TAG);
+}
+
+void
+Partition::OnMixerVolumeChanged(gcc_unused Mixer &mixer, gcc_unused int volume)
+{
+ InvalidateHardwareVolume();
+
+ /* notify clients */
+ idle_add(IDLE_MIXER);
+}