summaryrefslogtreecommitdiffstats
path: root/xbmc/filesystem/MusicDatabaseDirectory/QueryParams.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/filesystem/MusicDatabaseDirectory/QueryParams.cpp')
-rw-r--r--xbmc/filesystem/MusicDatabaseDirectory/QueryParams.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/xbmc/filesystem/MusicDatabaseDirectory/QueryParams.cpp b/xbmc/filesystem/MusicDatabaseDirectory/QueryParams.cpp
new file mode 100644
index 0000000..3353631
--- /dev/null
+++ b/xbmc/filesystem/MusicDatabaseDirectory/QueryParams.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2005-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "QueryParams.h"
+
+#include <stdlib.h>
+
+using namespace XFILE::MUSICDATABASEDIRECTORY;
+
+CQueryParams::CQueryParams()
+{
+ m_idArtist=-1;
+ m_idAlbum=-1;
+ m_idGenre=-1;
+ m_idSong=-1;
+ m_year=-1;
+ m_disc = -1;
+}
+
+void CQueryParams::SetQueryParam(NODE_TYPE NodeType, const std::string& strNodeName)
+{
+ int idDb = atoi(strNodeName.c_str());
+
+ switch (NodeType)
+ {
+ case NODE_TYPE_GENRE:
+ m_idGenre=idDb;
+ break;
+ case NODE_TYPE_YEAR:
+ m_year=idDb;
+ break;
+ case NODE_TYPE_ARTIST:
+ m_idArtist=idDb;
+ break;
+ case NODE_TYPE_DISC:
+ m_disc = idDb;
+ break;
+ case NODE_TYPE_ALBUM_RECENTLY_PLAYED:
+ case NODE_TYPE_ALBUM_RECENTLY_ADDED:
+ case NODE_TYPE_ALBUM_TOP100:
+ case NODE_TYPE_ALBUM:
+ m_idAlbum=idDb;
+ break;
+ case NODE_TYPE_ALBUM_RECENTLY_ADDED_SONGS:
+ case NODE_TYPE_ALBUM_RECENTLY_PLAYED_SONGS:
+ case NODE_TYPE_ALBUM_TOP100_SONGS:
+ case NODE_TYPE_SONG:
+ case NODE_TYPE_SONG_TOP100:
+ m_idSong=idDb;
+ default:
+ break;
+ }
+}