mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-21 14:03:11 -07:00
Move FFMPEG Decoder to lib
This commit is contained in:
parent
aba17d48a3
commit
673a2de9c1
24 changed files with 566 additions and 350 deletions
81
gui/include/logsniffer.h
Normal file
81
gui/include/logsniffer.h
Normal file
|
@ -0,0 +1,81 @@
|
|||
// SPDX-License-Identifier: LicenseRef-GPL-3.0-or-later-OpenSSL
|
||||
|
||||
#ifndef CHIAKI_LOG_SNIFFER_H
|
||||
#define CHIAKI_LOG_SNIFFER_H
|
||||
|
||||
#include <chiaki/controller.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
|
||||
#ifdef CHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
|
||||
class Controller;
|
||||
|
||||
class ControllerManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class Controller;
|
||||
|
||||
private:
|
||||
#ifdef CHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER
|
||||
QSet<SDL_JoystickID> available_controllers;
|
||||
#endif
|
||||
QMap<int, Controller *> open_controllers;
|
||||
|
||||
void ControllerClosed(Controller *controller);
|
||||
|
||||
private slots:
|
||||
void UpdateAvailableControllers();
|
||||
void HandleEvents();
|
||||
void ControllerEvent(int device_id);
|
||||
|
||||
public:
|
||||
static ControllerManager *GetInstance();
|
||||
|
||||
ControllerManager(QObject *parent = nullptr);
|
||||
~ControllerManager();
|
||||
|
||||
QSet<int> GetAvailableControllers();
|
||||
Controller *OpenController(int device_id);
|
||||
|
||||
signals:
|
||||
void AvailableControllersUpdated();
|
||||
};
|
||||
|
||||
class Controller : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class ControllerManager;
|
||||
|
||||
private:
|
||||
Controller(int device_id, ControllerManager *manager);
|
||||
|
||||
void UpdateState();
|
||||
|
||||
ControllerManager *manager;
|
||||
int id;
|
||||
|
||||
#ifdef CHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER
|
||||
SDL_GameController *controller;
|
||||
#endif
|
||||
|
||||
public:
|
||||
~Controller();
|
||||
|
||||
bool IsConnected();
|
||||
int GetDeviceID();
|
||||
QString GetName();
|
||||
ChiakiControllerState GetState();
|
||||
|
||||
signals:
|
||||
void StateChanged();
|
||||
};
|
||||
|
||||
#endif // CHIAKI_CONTROLLERMANAGER_H
|
Loading…
Add table
Add a link
Reference in a new issue