diff options
Diffstat (limited to 'utils/rbutilqt/base/autodetection.h')
-rw-r--r-- | utils/rbutilqt/base/autodetection.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/utils/rbutilqt/base/autodetection.h b/utils/rbutilqt/base/autodetection.h new file mode 100644 index 0000000000..cdbb94d303 --- /dev/null +++ b/utils/rbutilqt/base/autodetection.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 by Dominik Wenger | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version 2 | ||
14 | * of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | |||
22 | #ifndef AUTODETECTION_H_ | ||
23 | #define AUTODETECTION_H_ | ||
24 | |||
25 | #include <QObject> | ||
26 | #include <QString> | ||
27 | #include <QList> | ||
28 | #include <QStringList> | ||
29 | |||
30 | class Autodetection :public QObject | ||
31 | { | ||
32 | Q_OBJECT | ||
33 | |||
34 | public: | ||
35 | Autodetection(QObject* parent=nullptr); | ||
36 | |||
37 | enum PlayerStatus { | ||
38 | PlayerOk, | ||
39 | PlayerIncompatible, | ||
40 | PlayerMtpMode, | ||
41 | PlayerWrongFilesystem, | ||
42 | PlayerError, | ||
43 | PlayerAmbiguous, | ||
44 | }; | ||
45 | |||
46 | struct Detected { | ||
47 | QString device; | ||
48 | QStringList usbdevices; | ||
49 | QString mountpoint; | ||
50 | enum PlayerStatus status; | ||
51 | }; | ||
52 | |||
53 | bool detect(); | ||
54 | |||
55 | QList<struct Detected> detected(void) { return m_detected; } | ||
56 | |||
57 | private: | ||
58 | QString resolveMountPoint(QString); | ||
59 | void detectUsb(void); | ||
60 | void mergeMounted(void); | ||
61 | void mergePatcher(void); | ||
62 | QString detectAjbrec(QString); | ||
63 | int findDetectedDevice(QString device); | ||
64 | void updateDetectedDevice(struct Detected& entry); | ||
65 | |||
66 | QList<struct Detected> m_detected; | ||
67 | QList<int> m_usbconid; | ||
68 | }; | ||
69 | |||
70 | |||
71 | #endif /*AUTODETECTION_H_*/ | ||
72 | |||