2007-08-05 19:48:04 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 by Dominik Wenger
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-08-05 19:48:04 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef AUTODETECTION_H_
|
|
|
|
#define AUTODETECTION_H_
|
|
|
|
|
2013-04-03 21:43:27 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <QList>
|
2013-09-18 20:06:41 +00:00
|
|
|
#include <QStringList>
|
2007-08-05 19:48:04 +00:00
|
|
|
|
|
|
|
class Autodetection :public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-11-19 19:36:57 +00:00
|
|
|
Autodetection(QObject* parent=nullptr);
|
2008-05-22 17:51:35 +00:00
|
|
|
|
2013-04-06 19:15:05 +00:00
|
|
|
enum PlayerStatus {
|
|
|
|
PlayerOk,
|
|
|
|
PlayerIncompatible,
|
|
|
|
PlayerMtpMode,
|
|
|
|
PlayerWrongFilesystem,
|
|
|
|
PlayerError,
|
2013-09-18 20:06:41 +00:00
|
|
|
PlayerAmbiguous,
|
2013-04-06 19:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Detected {
|
|
|
|
QString device;
|
2013-09-18 20:06:41 +00:00
|
|
|
QStringList usbdevices;
|
2013-04-06 19:15:05 +00:00
|
|
|
QString mountpoint;
|
|
|
|
enum PlayerStatus status;
|
|
|
|
};
|
|
|
|
|
2007-08-05 19:48:04 +00:00
|
|
|
bool detect();
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2013-09-18 20:06:41 +00:00
|
|
|
QList<struct Detected> detected(void) { return m_detected; }
|
2007-08-05 19:48:04 +00:00
|
|
|
|
|
|
|
private:
|
2013-09-18 20:06:41 +00:00
|
|
|
void detectUsb(void);
|
|
|
|
void mergeMounted(void);
|
|
|
|
void mergePatcher(void);
|
2022-03-20 19:14:21 +00:00
|
|
|
QString detectAjbrec(const QString&);
|
|
|
|
int findDetectedDevice(const QString& device);
|
2013-09-20 19:03:51 +00:00
|
|
|
void updateDetectedDevice(struct Detected& entry);
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2013-04-06 19:15:05 +00:00
|
|
|
QList<struct Detected> m_detected;
|
2007-09-27 08:50:47 +00:00
|
|
|
QList<int> m_usbconid;
|
2007-08-05 19:48:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /*AUTODETECTION_H_*/
|
2008-10-15 18:37:26 +00:00
|
|
|
|