diff src/track/media.cc @ 147:6fdf0632c003

track: use a bit of a more sane way to manage recognition it also works with the new animia API
author Paper <mrpapersonic@gmail.com>
date Tue, 14 Nov 2023 13:19:40 -0500
parents 478f3b366199
children e41505d24733
line wrap: on
line diff
--- a/src/track/media.cc	Mon Nov 13 13:52:58 2023 -0500
+++ b/src/track/media.cc	Tue Nov 14 13:19:40 2023 -0500
@@ -18,17 +18,10 @@
 static bool GetCurrentlyPlayingResults(std::vector<animia::Result>& results) {
 	std::vector<animia::Player> players;
 
-	{
-		QFile f(":/players.anisthesia");
-		if (!f.exists())
-			return false;
-
-		f.open(QFile::ReadOnly | QFile::Text);
-		QTextStream ts(&f);
-
-		if (!animia::ParsePlayersData(Strings::ToUtf8String(ts.readAll()), players))
-			return false;
-	}
+	players.reserve(session.config.recognition.players.size());
+	for (const auto& [enabled, player] : session.config.recognition.players)
+		if (enabled)
+			players.push_back(player);
 
 	if (!animia::GetResults(players, results))
 		return false;