Changeset 38 in flair-src for trunk/lib/FlairMeta/src/MetaDualShock3.cpp


Ignore:
Timestamp:
Jun 23, 2016, 10:15:30 AM (8 years ago)
Author:
Bayard Gildas
Message:

Modif. pour ajour manette émulée (EmulatedController)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairMeta/src/MetaDualShock3.cpp

    r15 r38  
    1818#include "MetaDualShock3.h"
    1919#include "MetaDualShock3_impl.h"
     20#include "TargetController.h"
    2021#include "JoyReference.h"
    2122#include <Tab.h>
     
    3031using namespace flair::filter;
    3132using namespace flair::gui;
     33using namespace flair::sensor;
    3234
    3335namespace flair {
     
    3537
    3638MetaDualShock3::MetaDualShock3(FrameworkManager *parent, string name,
    37                                uint16_t port, uint8_t priority)
    38     : TargetEthController(parent, name, port, priority) {
     39                               TargetController *controller)
     40    : controller(controller),IODevice((IODevice*)controller, name) {
    3941  pimpl_ = new MetaDualShock3_impl(this, name);
    4042  parent->AddDeviceToLog(pimpl_->joy_ref);
    41   Start();
     43  controller->Start();
    4244}
    4345
     
    4951
    5052void MetaDualShock3::ErrorNotify(void) {
    51   TargetEthController::FlashLed(4, 10, 0);
    52   TargetEthController::Rumble(0xff, 20, 0, 0);
     53    controller->FlashLed(4,10,0);
     54    controller->Rumble(0xff,20,0,0);
    5355}
    5456
    55 void MetaDualShock3::Rumble(uint8_t left_force, uint8_t left_timeout,
    56                             uint8_t right_force, uint8_t right_timeout) {
    57   TargetEthController::Rumble(left_force, left_timeout, right_force,
    58                               right_timeout);
     57void MetaDualShock3::Rumble(uint8_t left_force,uint8_t left_timeout,uint8_t right_force,uint8_t right_timeout) {
     58    controller->Rumble(left_force,left_timeout,right_force,right_timeout);
    5959}
    6060
    6161void MetaDualShock3::SetLedON(unsigned int ledId) {
    62   TargetEthController::SetLedOn(ledId);
     62    controller->SetLedOn(ledId);
    6363}
    6464
    6565void MetaDualShock3::SetLedOFF(unsigned int ledId) {
    66   TargetEthController::SetLedOff(ledId);
     66    controller->SetLedOff(ledId);
    6767}
    6868
    69 void MetaDualShock3::FlashLed(unsigned int ledId, uint8_t on_timeout,
    70                               uint8_t off_timeout) {
    71   TargetEthController::FlashLed(ledId, on_timeout, off_timeout);
     69void MetaDualShock3::FlashLed(unsigned int ledId,uint8_t on_timeout,uint8_t off_timeout) {
     70    controller->FlashLed(ledId,on_timeout,off_timeout);
    7271}
    7372
     
    9190
    9291float MetaDualShock3::PitchTrim(void) const {
    93   return pimpl_->joy_ref->PitchTrim();
     92    return pimpl_->joy_ref->PitchTrim();
     93}
     94
     95void MetaDualShock3::UpdateFrom(const flair::core::io_data *data) {
     96    pimpl_->UpdateFrom(data);
    9497}
    9598
Note: See TracChangeset for help on using the changeset viewer.