Instance: make "partition" a std::list

With this commit, multi-player support becomes possible... it's just
not wired to the frontend yet.

This is based on massive amounts of refactoring work I did over the
past 9 years.
This commit is contained in:
Max Kellermann
2017-02-17 23:21:20 +01:00
parent 9a909d9f27
commit 77178e0590
4 changed files with 42 additions and 24 deletions

View File

@@ -59,7 +59,9 @@ Instance::OnDatabaseModified()
/* propagate the change to all subsystems */
stats_invalidate();
partition->DatabaseModified(*database);
for (auto &partition : partitions)
partition.DatabaseModified(*database);
}
void
@@ -77,7 +79,8 @@ Instance::OnDatabaseSongRemoved(const char *uri)
}
#endif
partition->StaleSong(uri);
for (auto &partition : partitions)
partition.StaleSong(uri);
}
#endif
@@ -87,13 +90,15 @@ Instance::OnDatabaseSongRemoved(const char *uri)
void
Instance::FoundNeighbor(gcc_unused const NeighborInfo &info)
{
partition->EmitIdle(IDLE_NEIGHBOR);
for (auto &partition : partitions)
partition.EmitIdle(IDLE_NEIGHBOR);
}
void
Instance::LostNeighbor(gcc_unused const NeighborInfo &info)
{
partition->EmitIdle(IDLE_NEIGHBOR);
for (auto &partition : partitions)
partition.EmitIdle(IDLE_NEIGHBOR);
}
#endif