1 /*
2  * Strawberry Music Player
3  * Copyright 2017-2021, Jonas Kvinge <jonas@jkvinge.net>
4  *
5  * Strawberry is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * Strawberry is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with Strawberry.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19 
20 #include "config.h"
21 
22 #include <QString>
23 
24 #include "devicefinder.h"
25 
DeviceFinder(const QString & name,const QStringList & outputs)26 DeviceFinder::DeviceFinder(const QString &name, const QStringList &outputs) : name_(name), outputs_(outputs) {}
27 
GuessIconName(const QString & description)28 QString DeviceFinder::GuessIconName(const QString &description) {
29 
30   QString description_lower = description.toLower();
31 
32   if (description_lower.contains("mcintosh")) {
33     return "mcintosh";
34   }
35   if (description_lower.contains("electrocompaniet")) {
36     return "electrocompaniet";
37   }
38   if (description_lower.contains("intel")) {
39     return "intel";
40   }
41   if (description_lower.contains("realtek")) {
42     return "realtek";
43   }
44   if (description_lower.contains("nvidia")) {
45     return "nvidia";
46   }
47   if (description_lower.contains("headset")) {
48     return "headset";
49   }
50   if (description_lower.contains("pulseaudio")) {
51     return "pulseaudio";
52   }
53 
54   return "soundcard";
55 
56 }
57