2010-08-25 15:02:53 +02:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
|
|
|
|
Clementine 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 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-08-25 15:51:30 +02:00
|
|
|
#ifndef WIIMOTEDEV_SHORTCUTS_H
|
|
|
|
#define WIIMOTEDEV_SHORTCUTS_H
|
2010-08-25 15:02:53 +02:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QMap>
|
|
|
|
#include "core/player.h"
|
|
|
|
|
|
|
|
class DBusDeviceEventsInterface;
|
|
|
|
class QSettings;
|
|
|
|
|
|
|
|
class WiimotedevShortcuts :public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2010-08-25 16:58:22 +02:00
|
|
|
static const char* kActionsGroup;
|
2010-08-25 15:02:53 +02:00
|
|
|
static const char* kSettingsGroup;
|
|
|
|
|
2010-08-25 15:51:30 +02:00
|
|
|
WiimotedevShortcuts(Player* player = 0, QObject* parent = 0);
|
2010-08-25 15:02:53 +02:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void ReloadSettings();
|
2010-08-25 16:58:22 +02:00
|
|
|
void SetDefaultSettings();
|
2010-08-25 15:02:53 +02:00
|
|
|
void SetEnabled(bool enabled);
|
|
|
|
|
2010-08-25 15:51:30 +02:00
|
|
|
private slots:
|
2010-08-25 15:02:53 +02:00
|
|
|
void DbusWiimoteGeneralButtons(quint32 id, quint64 value);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void EmitRequest(quint32 action);
|
|
|
|
|
|
|
|
DBusDeviceEventsInterface* wiimotedev_iface_;
|
|
|
|
Player* player_;
|
|
|
|
quint64 wiimotedev_buttons_;
|
|
|
|
QSettings settings_;
|
|
|
|
|
2010-08-25 16:58:22 +02:00
|
|
|
quint32 wiimotedev_device_;
|
|
|
|
bool wiimotedev_active_;
|
|
|
|
|
2010-08-25 15:02:53 +02:00
|
|
|
private:
|
2010-08-25 15:51:30 +02:00
|
|
|
enum Action {
|
2010-08-25 16:58:22 +02:00
|
|
|
WiimotedevActive,
|
|
|
|
WiimotedevDeactive,
|
2010-08-25 15:02:53 +02:00
|
|
|
PlayerNextTrack,
|
|
|
|
PlayerPreviousTrack,
|
|
|
|
PlayerPlay,
|
|
|
|
PlayerStop,
|
|
|
|
PlayerIncVolume,
|
|
|
|
PlayerDecVolume,
|
|
|
|
PlayerMute,
|
|
|
|
PlayerPause,
|
|
|
|
PlayerTogglePause,
|
|
|
|
PlayerSeekBackward,
|
|
|
|
PlayerSeekForward,
|
|
|
|
PlayerStopAfter,
|
|
|
|
PlayerShowOSD
|
|
|
|
};
|
|
|
|
|
2010-08-25 15:51:30 +02:00
|
|
|
QMap <quint64, quint32> actions_;
|
2010-08-25 15:02:53 +02:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void Next();
|
|
|
|
void Previous();
|
|
|
|
void Play();
|
|
|
|
void Stop();
|
|
|
|
void IncVolume();
|
|
|
|
void DecVolume();
|
|
|
|
void Mute();
|
|
|
|
void Pause();
|
|
|
|
void TogglePause();
|
|
|
|
void SeekBackward();
|
|
|
|
void SeekForward();
|
|
|
|
void StopAfter();
|
|
|
|
void ShowOSD();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2010-08-25 15:51:30 +02:00
|
|
|
#endif // WIIMOTEDEV_SHORTCUTS_H
|