11 #include "peripherals/PeripheralTypes.h" 12 #include "peripherals/bus/PeripheralBus.h" 13 #include "threads/CriticalSection.h" 15 #include "platform/android/activity/IInputDeviceCallbacks.h" 16 #include "platform/android/activity/IInputDeviceEventHandler.h" 17 #include "platform/android/peripherals/AndroidJoystickState.h" 24 class CJNIViewInputDevice;
42 void OnInputDeviceAdded(
int deviceId)
override;
43 void OnInputDeviceChanged(
int deviceId)
override;
44 void OnInputDeviceRemoved(
int deviceId)
override;
47 bool OnInputDeviceEvent(
const AInputEvent* event)
override;
56 static std::string GetDeviceLocation(
int deviceId);
57 static bool GetDeviceId(
const std::string& deviceLocation,
int& deviceId);
59 static bool ConvertToPeripheralScanResult(
const CJNIViewInputDevice& inputDevice,
PeripheralScanResult& peripheralScanResult);
61 static void LogInputDevice(
const CJNIViewInputDevice &device);
62 static std::vector<std::pair<int, const char*>> GetInputSources();
64 mutable std::map<int, CAndroidJoystickState> m_joystickStates;
66 CCriticalSection m_critSectionStates;
67 CCriticalSection m_critSectionResults;
69 using PeripheralBusAndroidPtr = std::shared_ptr<CPeripheralBusAndroid>;
Definition: PeripheralTypes.h:348
Definition: PeripheralTypes.h:318
void Initialise(void) override
Initialise this bus and start a polling thread if this bus needs polling.
Definition: PeripheralBusAndroid.cpp:123
Definition: RetroPlayerInput.h:15
bool InitializeProperties(CPeripheral &peripheral) override
Initialize the properties of a peripheral with a known location.
Definition: PeripheralBusAndroid.cpp:63
bool PerformDeviceScan(PeripheralScanResults &results) override
Scan for devices on this bus and add them to the results list. This will have to be implemented for e...
Definition: PeripheralBusAndroid.cpp:313
Definition: PeripheralBus.h:34
void ProcessEvents() override
Poll for events.
Definition: PeripheralBusAndroid.cpp:129
Definition: PeripheralBusAndroid.h:28
Definition: Peripheral.h:62
Definition: Peripherals.h:49