RhythmGame 1.4.3
Loading...
Searching...
No Matches
Classes | Public Types | Signals | Public Member Functions | Static Public Member Functions | Properties | List of all members
input::InputTranslator Class Referencefinal

#include <InputTranslator.h>

Inheritance diagram for input::InputTranslator:
Inheritance graph
[legend]
Collaboration diagram for input::InputTranslator:
Collaboration graph
[legend]

Classes

struct  Scratch
 

Public Types

enum  TickType { ButtonTick , AnalogScratchTick , ClassicScratchTick }
 

Signals

void buttonPressed (BmsKey button, int64_t time)
 
void buttonReleased (BmsKey button, int64_t time)
 
void keyConfigModified ()
 
void configuringChanged ()
 
void configuredButtonChanged ()
 
void col11Changed ()
 
void col12Changed ()
 
void col13Changed ()
 
void col14Changed ()
 
void col15Changed ()
 
void col16Changed ()
 
void col17Changed ()
 
void col1sUpChanged ()
 
void col1sDownChanged ()
 
void col21Changed ()
 
void col22Changed ()
 
void col23Changed ()
 
void col24Changed ()
 
void col25Changed ()
 
void col26Changed ()
 
void col27Changed ()
 
void col2sUpChanged ()
 
void col2sDownChanged ()
 
void start1Changed ()
 
void select1Changed ()
 
void start2Changed ()
 
void select2Changed ()
 
void analogAxisConfig1Changed ()
 
void analogAxisConfig2Changed ()
 
void debounceMsChanged ()
 
void col11Ticked (int tickNumber, TickType type)
 
void col12Ticked (int tickNumber, TickType type)
 
void col13Ticked (int tickNumber, TickType type)
 
void col14Ticked (int tickNumber, TickType type)
 
void col15Ticked (int tickNumber, TickType type)
 
void col16Ticked (int tickNumber, TickType type)
 
void col17Ticked (int tickNumber, TickType type)
 
void col1sUpTicked (int tickNumber, TickType type)
 
void col1sDownTicked (int tickNumber, TickType type)
 
void col21Ticked (int tickNumber, TickType type)
 
void col22Ticked (int tickNumber, TickType type)
 
void col23Ticked (int tickNumber, TickType type)
 
void col24Ticked (int tickNumber, TickType type)
 
void col25Ticked (int tickNumber, TickType type)
 
void col26Ticked (int tickNumber, TickType type)
 
void col27Ticked (int tickNumber, TickType type)
 
void col2sUpTicked (int tickNumber, TickType type)
 
void col2sDownTicked (int tickNumber, TickType type)
 
void start1Ticked (int tickNumber, TickType type)
 
void select1Ticked (int tickNumber, TickType type)
 
void start2Ticked (int tickNumber, TickType type)
 
void select2Ticked (int tickNumber, TickType type)
 

Public Member Functions

void handleAxis (Gamepad gamepad, Uint8 axis, double value, int64_t time)
 
void handlePress (Gamepad gamepad, Uint8 button, int64_t time)
 
void handleRelease (Gamepad gamepad, Uint8 button, int64_t time)
 
void handleMidiNote (MidiDevice device, int channel, int note, int velocity, int64_t time)
 
void handleMidiControl (MidiDevice device, int channel, int control, int value, int64_t time)
 
void handleMidiPitchBend (MidiDevice device, int channel, int value, int64_t time)
 
void handleMidiDeviceRemoved (MidiDevice device, int64_t time)
 
void handleKeyEvent (quint32 nativeScanCode, bool isPress, int64_t time)
 
void loadKeyConfig ()
 
void connectAnalogAxisConfig (const AnalogAxisConfig &config)
 
void loadAnalogAxisConfig ()
 
void loadDebounce ()
 
void saveDebounce ()
 
 InputTranslator (db::SqliteCppDb *db, QObject *parent=nullptr)
 
void setConfiguredButton (const QVariant &button)
 
auto getConfiguredButton () const -> QVariant
 
auto isConfiguring () const -> bool
 
void setKeyConfig (const QList< Mapping > &config)
 
auto getKeyConfig () -> QList< Mapping >
 
void setKeyConfig (const QHash< Key, BmsKey > &config)
 
auto getKeyConfigHash () -> QHash< Key, BmsKey >
 
Q_INVOKABLE void resetButton (BmsKey key)
 
auto col11 () const -> bool
 
auto col12 () const -> bool
 
auto col13 () const -> bool
 
auto col14 () const -> bool
 
auto col15 () const -> bool
 
auto col16 () const -> bool
 
auto col17 () const -> bool
 
auto col1sUp () const -> bool
 
auto col1sDown () const -> bool
 
auto col21 () const -> bool
 
auto col22 () const -> bool
 
auto col23 () const -> bool
 
auto col24 () const -> bool
 
auto col25 () const -> bool
 
auto col26 () const -> bool
 
auto col27 () const -> bool
 
auto col2sUp () const -> bool
 
auto col2sDown () const -> bool
 
auto start1 () const -> bool
 
auto select1 () const -> bool
 
auto start2 () const -> bool
 
auto select2 () const -> bool
 
auto getAnalogAxisConfig1 () -> AnalogAxisConfig *
 
auto getAnalogAxisConfig2 () -> AnalogAxisConfig *
 
void eventFilter (std::chrono::milliseconds timePoint, QEvent *event)
 
auto getDebounceMs () const -> double
 
void setDebounceMs (double value)
 
void resetDebounceMs ()
 

Static Public Member Functions

static Q_INVOKABLE QString scancodeToString (int virtualKey)
 
static auto computeAnalogScratchTicks (double oldValue, double newValue) -> int
 

Properties

bool configuring
 
QVariant configuredButton
 
QList< Mapping > keyConfig
 
bool col11
 
bool col12
 
bool col13
 
bool col14
 
bool col15
 
bool col16
 
bool col17
 
bool col1sUp
 
bool col1sDown
 
bool col21
 
bool col22
 
bool col23
 
bool col24
 
bool col25
 
bool col26
 
bool col27
 
bool col2sUp
 
bool col2sDown
 
bool start1
 
bool select1
 
bool start2
 
bool select2
 
input::AnalogAxisConfig *analogAxisConfig1 READ getAnalogAxisConfig1
 
input::AnalogAxisConfig *analogAxisConfig2 READ getAnalogAxisConfig2
 
double debounceMs = 5.0
 

Member Enumeration Documentation

◆ TickType

Enumerator
ButtonTick 
AnalogScratchTick 
ClassicScratchTick 

Constructor & Destructor Documentation

◆ InputTranslator()

input::InputTranslator::InputTranslator ( db::SqliteCppDb *  db,
QObject *  parent = nullptr 
)
explicit

Member Function Documentation

◆ analogAxisConfig1Changed

void input::InputTranslator::analogAxisConfig1Changed ( )
signal

◆ analogAxisConfig2Changed

void input::InputTranslator::analogAxisConfig2Changed ( )
signal

◆ buttonPressed

void input::InputTranslator::buttonPressed ( BmsKey  button,
int64_t  time 
)
signal

◆ buttonReleased

void input::InputTranslator::buttonReleased ( BmsKey  button,
int64_t  time 
)
signal

◆ col11()

auto input::InputTranslator::col11 ( ) const -> bool

◆ col11Changed

void input::InputTranslator::col11Changed ( )
signal

◆ col11Ticked

void input::InputTranslator::col11Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col12()

auto input::InputTranslator::col12 ( ) const -> bool

◆ col12Changed

void input::InputTranslator::col12Changed ( )
signal

◆ col12Ticked

void input::InputTranslator::col12Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col13()

auto input::InputTranslator::col13 ( ) const -> bool

◆ col13Changed

void input::InputTranslator::col13Changed ( )
signal

◆ col13Ticked

void input::InputTranslator::col13Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col14()

auto input::InputTranslator::col14 ( ) const -> bool

◆ col14Changed

void input::InputTranslator::col14Changed ( )
signal

◆ col14Ticked

void input::InputTranslator::col14Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col15()

auto input::InputTranslator::col15 ( ) const -> bool

◆ col15Changed

void input::InputTranslator::col15Changed ( )
signal

◆ col15Ticked

void input::InputTranslator::col15Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col16()

auto input::InputTranslator::col16 ( ) const -> bool

◆ col16Changed

void input::InputTranslator::col16Changed ( )
signal

◆ col16Ticked

void input::InputTranslator::col16Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col17()

auto input::InputTranslator::col17 ( ) const -> bool

◆ col17Changed

void input::InputTranslator::col17Changed ( )
signal

◆ col17Ticked

void input::InputTranslator::col17Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col1sDown()

auto input::InputTranslator::col1sDown ( ) const -> bool

◆ col1sDownChanged

void input::InputTranslator::col1sDownChanged ( )
signal

◆ col1sDownTicked

void input::InputTranslator::col1sDownTicked ( int  tickNumber,
TickType  type 
)
signal

◆ col1sUp()

auto input::InputTranslator::col1sUp ( ) const -> bool

◆ col1sUpChanged

void input::InputTranslator::col1sUpChanged ( )
signal

◆ col1sUpTicked

void input::InputTranslator::col1sUpTicked ( int  tickNumber,
TickType  type 
)
signal

◆ col21()

auto input::InputTranslator::col21 ( ) const -> bool

◆ col21Changed

void input::InputTranslator::col21Changed ( )
signal

◆ col21Ticked

void input::InputTranslator::col21Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col22()

auto input::InputTranslator::col22 ( ) const -> bool

◆ col22Changed

void input::InputTranslator::col22Changed ( )
signal

◆ col22Ticked

void input::InputTranslator::col22Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col23()

auto input::InputTranslator::col23 ( ) const -> bool

◆ col23Changed

void input::InputTranslator::col23Changed ( )
signal

◆ col23Ticked

void input::InputTranslator::col23Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col24()

auto input::InputTranslator::col24 ( ) const -> bool

◆ col24Changed

void input::InputTranslator::col24Changed ( )
signal

◆ col24Ticked

void input::InputTranslator::col24Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col25()

auto input::InputTranslator::col25 ( ) const -> bool

◆ col25Changed

void input::InputTranslator::col25Changed ( )
signal

◆ col25Ticked

void input::InputTranslator::col25Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col26()

auto input::InputTranslator::col26 ( ) const -> bool

◆ col26Changed

void input::InputTranslator::col26Changed ( )
signal

◆ col26Ticked

void input::InputTranslator::col26Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col27()

auto input::InputTranslator::col27 ( ) const -> bool

◆ col27Changed

void input::InputTranslator::col27Changed ( )
signal

◆ col27Ticked

void input::InputTranslator::col27Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ col2sDown()

auto input::InputTranslator::col2sDown ( ) const -> bool

◆ col2sDownChanged

void input::InputTranslator::col2sDownChanged ( )
signal

◆ col2sDownTicked

void input::InputTranslator::col2sDownTicked ( int  tickNumber,
TickType  type 
)
signal

◆ col2sUp()

auto input::InputTranslator::col2sUp ( ) const -> bool

◆ col2sUpChanged

void input::InputTranslator::col2sUpChanged ( )
signal

◆ col2sUpTicked

void input::InputTranslator::col2sUpTicked ( int  tickNumber,
TickType  type 
)
signal

◆ computeAnalogScratchTicks()

auto input::InputTranslator::computeAnalogScratchTicks ( double  oldValue,
double  newValue 
) -> int
static

◆ configuredButtonChanged

void input::InputTranslator::configuredButtonChanged ( )
signal

◆ configuringChanged

void input::InputTranslator::configuringChanged ( )
signal

◆ connectAnalogAxisConfig()

void input::InputTranslator::connectAnalogAxisConfig ( const AnalogAxisConfig &  config)

◆ debounceMsChanged

void input::InputTranslator::debounceMsChanged ( )
signal

◆ eventFilter()

void input::InputTranslator::eventFilter ( std::chrono::milliseconds  timePoint,
QEvent *  event 
)

◆ getAnalogAxisConfig1()

auto input::InputTranslator::getAnalogAxisConfig1 ( ) -> AnalogAxisConfig *

◆ getAnalogAxisConfig2()

auto input::InputTranslator::getAnalogAxisConfig2 ( ) -> AnalogAxisConfig *

◆ getConfiguredButton()

auto input::InputTranslator::getConfiguredButton ( ) const -> QVariant

◆ getDebounceMs()

auto input::InputTranslator::getDebounceMs ( ) const -> double

◆ getKeyConfig()

auto input::InputTranslator::getKeyConfig ( ) -> QList<Mapping>

◆ getKeyConfigHash()

auto input::InputTranslator::getKeyConfigHash ( ) -> QHash<Key, BmsKey>

◆ handleAxis()

void input::InputTranslator::handleAxis ( Gamepad  gamepad,
Uint8  axis,
double  value,
int64_t  time 
)

◆ handleKeyEvent()

void input::InputTranslator::handleKeyEvent ( quint32  nativeScanCode,
bool  isPress,
int64_t  time 
)

◆ handleMidiControl()

void input::InputTranslator::handleMidiControl ( MidiDevice  device,
int  channel,
int  control,
int  value,
int64_t  time 
)

◆ handleMidiDeviceRemoved()

void input::InputTranslator::handleMidiDeviceRemoved ( MidiDevice  device,
int64_t  time 
)

◆ handleMidiNote()

void input::InputTranslator::handleMidiNote ( MidiDevice  device,
int  channel,
int  note,
int  velocity,
int64_t  time 
)

◆ handleMidiPitchBend()

void input::InputTranslator::handleMidiPitchBend ( MidiDevice  device,
int  channel,
int  value,
int64_t  time 
)

◆ handlePress()

void input::InputTranslator::handlePress ( Gamepad  gamepad,
Uint8  button,
int64_t  time 
)

◆ handleRelease()

void input::InputTranslator::handleRelease ( Gamepad  gamepad,
Uint8  button,
int64_t  time 
)

◆ isConfiguring()

auto input::InputTranslator::isConfiguring ( ) const -> bool

◆ keyConfigModified

void input::InputTranslator::keyConfigModified ( )
signal

◆ loadAnalogAxisConfig()

void input::InputTranslator::loadAnalogAxisConfig ( )

◆ loadDebounce()

void input::InputTranslator::loadDebounce ( )

◆ loadKeyConfig()

void input::InputTranslator::loadKeyConfig ( )

◆ resetButton()

void input::InputTranslator::resetButton ( BmsKey  key)

◆ resetDebounceMs()

void input::InputTranslator::resetDebounceMs ( )

◆ saveDebounce()

void input::InputTranslator::saveDebounce ( )

◆ scancodeToString()

QString input::InputTranslator::scancodeToString ( int  virtualKey)
static

◆ select1()

auto input::InputTranslator::select1 ( ) const -> bool

◆ select1Changed

void input::InputTranslator::select1Changed ( )
signal

◆ select1Ticked

void input::InputTranslator::select1Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ select2()

auto input::InputTranslator::select2 ( ) const -> bool

◆ select2Changed

void input::InputTranslator::select2Changed ( )
signal

◆ select2Ticked

void input::InputTranslator::select2Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ setConfiguredButton()

void input::InputTranslator::setConfiguredButton ( const QVariant &  button)

◆ setDebounceMs()

void input::InputTranslator::setDebounceMs ( double  value)

◆ setKeyConfig() [1/2]

void input::InputTranslator::setKeyConfig ( const QHash< Key, BmsKey > &  config)

◆ setKeyConfig() [2/2]

void input::InputTranslator::setKeyConfig ( const QList< Mapping > &  config)

◆ start1()

auto input::InputTranslator::start1 ( ) const -> bool

◆ start1Changed

void input::InputTranslator::start1Changed ( )
signal

◆ start1Ticked

void input::InputTranslator::start1Ticked ( int  tickNumber,
TickType  type 
)
signal

◆ start2()

auto input::InputTranslator::start2 ( ) const -> bool

◆ start2Changed

void input::InputTranslator::start2Changed ( )
signal

◆ start2Ticked

void input::InputTranslator::start2Ticked ( int  tickNumber,
TickType  type 
)
signal

Property Documentation

◆ col11

bool input::InputTranslator::col11
read

◆ col12

bool input::InputTranslator::col12
read

◆ col13

bool input::InputTranslator::col13
read

◆ col14

bool input::InputTranslator::col14
read

◆ col15

bool input::InputTranslator::col15
read

◆ col16

bool input::InputTranslator::col16
read

◆ col17

bool input::InputTranslator::col17
read

◆ col1sDown

bool input::InputTranslator::col1sDown
read

◆ col1sUp

bool input::InputTranslator::col1sUp
read

◆ col21

bool input::InputTranslator::col21
read

◆ col22

bool input::InputTranslator::col22
read

◆ col23

bool input::InputTranslator::col23
read

◆ col24

bool input::InputTranslator::col24
read

◆ col25

bool input::InputTranslator::col25
read

◆ col26

bool input::InputTranslator::col26
read

◆ col27

bool input::InputTranslator::col27
read

◆ col2sDown

bool input::InputTranslator::col2sDown
read

◆ col2sUp

bool input::InputTranslator::col2sUp
read

◆ configuredButton

QVariant input::InputTranslator::configuredButton
read

The next input will be bound to this button.

◆ configuring

bool input::InputTranslator::configuring
read

True if the next input will be bound to a button.

◆ debounceMs

double input::InputTranslator::debounceMs = 5.0
readwrite

◆ getAnalogAxisConfig1

auto input::InputTranslator::getAnalogAxisConfig1

◆ getAnalogAxisConfig2

auto input::InputTranslator::getAnalogAxisConfig2

◆ keyConfig

QList<Mapping> input::InputTranslator::keyConfig
readwrite

◆ select1

bool input::InputTranslator::select1
read

◆ select2

bool input::InputTranslator::select2
read

◆ start1

bool input::InputTranslator::start1
read

◆ start2

bool input::InputTranslator::start2
read

The documentation for this class was generated from the following files: