omegalib  13.1
wiimote Class Reference

#include <Wiimote.h>

Public Types

enum  input_report {
  IN_BUTTONS = 0x30, IN_BUTTONS_ACCEL = 0x31, IN_BUTTONS_ACCEL_IR = 0x33, IN_BUTTONS_ACCEL_EXT = 0x35,
  IN_BUTTONS_ACCEL_IR_EXT = 0x37, IN_BUTTONS_BALANCE_BOARD = 0x32
}
 
typedef wiimote_state_event state_event
 
typedef std::list< state_eventstate_history
 
- Public Types inherited from wiimote_state
enum  extension_type {
  NONE = 0, NUNCHUK, CLASSIC, GH3_GHWT_GUITAR,
  GHWT_DRUMS, BALANCE_BOARD, MOTION_PLUS, PARTIALLY_INSERTED
}
 

Public Member Functions

 wiimote ()
 
virtual ~wiimote ()
 
bool operator== (const wiimote &remote)
 
bool operator!= (const wiimote &remote)
 
bool IsConnected () const
 
bool ConnectionLost () const
 
bool IsBalanceBoard () const
 
bool NunchukConnected () const
 
bool ClassicConnected () const
 
bool MotionPlusConnected () const
 
bool MotionPlusEnabled () const
 
bool MotionPlusHasExtension () const
 
bool IsPlayingAudio () const
 
bool IsPlayingSample () const
 
bool IsUsingHIDwrites () const
 
bool IsRecordingState () const
 
virtual void ChangedNotifier (state_change_flags changed, const wiimote_state &new_state)
 
bool Connect (unsigned wiimote_index=FIRST_AVAILABLE, bool force_hidwrites=false)
 
void Disconnect ()
 
void SetReportType (input_report type, bool continuous=false)
 
bool EnableMotionPlus ()
 
bool DisableMotionPlus ()
 
void CalibrateAtRest ()
 
state_change_flags RefreshState ()
 
void Reset ()
 
void SetLEDs (BYTE led_bits)
 
void SetRumble (bool on)
 
void RumbleForAsync (unsigned milliseconds)
 
bool MuteSpeaker (bool on)
 
bool EnableSpeaker (bool on)
 
bool PlaySquareWave (speaker_freq freq, BYTE volume=0x40)
 
bool PlaySample (const wiimote_sample &sample, BYTE volume=0x40, speaker_freq freq_override=FREQ_NONE)
 
void RecordState (state_history &events_out, unsigned max_time_ms=UNTIL_STOP, state_change_flags change_trigger=CHANGED_ALL)
 
void StopRecording ()
 

Static Public Member Functions

static unsigned TotalConnected ()
 
static const TCHAR * GetButtonNameFromBit (unsigned index)
 
static const TCHAR * GetClassicButtonNameFromBit (unsigned index)
 
static const unsigned GetFreqLookup (unsigned index)
 
static bool Load16bitMonoSampleWAV (const TCHAR *filepath, wiimote_sample &out)
 
static bool Load16BitMonoSampleRAW (const TCHAR *filepath, bool _signed, speaker_freq freq, wiimote_sample &out)
 
static bool Convert16bitMonoSamples (const short *samples, bool _signed, DWORD length, speaker_freq freq, wiimote_sample &out)
 

Public Attributes

QWORD UniqueID
 
state_changed_callback ChangedCallback
 
state_change_flags CallbackTriggerFlags
 
- Public Attributes inherited from wiimote_state
struct wiimote_state::calibration_info CalibrationInfo
 
struct wiimote_state::buttons Button
 
struct wiimote_state::acceleration Acceleration
 
struct wiimote_state::ir IR
 
struct wiimote_state::leds LED
 
BYTE BatteryRaw
 
BYTE BatteryPercent
 
bool bBatteryDrained
 
bool bRumble
 
bool bExtension
 
struct wiimote_state::speaker Speaker
 
extension_type ExtensionType
 
struct wiimote_state::nunchuk Nunchuk
 
struct wiimote_state::classic_controller ClassicController
 
struct wiimote_state::balance_board BalanceBoard
 
struct wiimote_state::motion_plus MotionPlus
 

Static Public Attributes

static const TCHAR * ReportTypeName []
 
static const TCHAR * ButtonNameFromBit [TOTAL_BUTTON_BITS]
 
static const TCHAR * ClassicButtonNameFromBit [TOTAL_BUTTON_BITS]
 
static const unsigned FreqLookup [TOTAL_FREQUENCIES]
 
static const unsigned FIRST_AVAILABLE = 0xffffffff
 
static const unsigned UNTIL_STOP = 0xffffffff
 

Additional Inherited Members

- Protected Member Functions inherited from wiimote_state
void Clear (bool including_deadzones)
 
- Protected Attributes inherited from wiimote_state
unsigned WiimoteNearGUpdates
 
unsigned NunchukNearGUpdates
 
+ Inheritance diagram for wiimote:

Member Typedef Documentation

typedef std::list<state_event> wiimote::state_history

Member Enumeration Documentation

Enumerator
IN_BUTTONS 
IN_BUTTONS_ACCEL 
IN_BUTTONS_ACCEL_IR 
IN_BUTTONS_ACCEL_EXT 
IN_BUTTONS_ACCEL_IR_EXT 
IN_BUTTONS_BALANCE_BOARD 

Constructor & Destructor Documentation

wiimote::wiimote ( )
virtual wiimote::~wiimote ( )
virtual

Member Function Documentation

void wiimote::CalibrateAtRest ( )
virtual void wiimote::ChangedNotifier ( state_change_flags  changed,
const wiimote_state new_state 
)
inlinevirtual
bool wiimote::ClassicConnected ( ) const
inline
bool wiimote::Connect ( unsigned  wiimote_index = FIRST_AVAILABLE,
bool  force_hidwrites = false 
)
bool wiimote::ConnectionLost ( ) const
inline
static bool wiimote::Convert16bitMonoSamples ( const short *  samples,
bool  _signed,
DWORD  length,
speaker_freq  freq,
wiimote_sample out 
)
static
bool wiimote::DisableMotionPlus ( )
void wiimote::Disconnect ( )
bool wiimote::EnableMotionPlus ( )
bool wiimote::EnableSpeaker ( bool  on)
static const TCHAR* wiimote::GetButtonNameFromBit ( unsigned  index)
inlinestatic
static const TCHAR* wiimote::GetClassicButtonNameFromBit ( unsigned  index)
inlinestatic
static const unsigned wiimote::GetFreqLookup ( unsigned  index)
inlinestatic
bool wiimote::IsBalanceBoard ( ) const
inline
bool wiimote::IsConnected ( ) const
inline
bool wiimote::IsPlayingAudio ( ) const
inline
bool wiimote::IsPlayingSample ( ) const
inline
bool wiimote::IsRecordingState ( ) const
inline
bool wiimote::IsUsingHIDwrites ( ) const
inline
static bool wiimote::Load16BitMonoSampleRAW ( const TCHAR *  filepath,
bool  _signed,
speaker_freq  freq,
wiimote_sample out 
)
static
static bool wiimote::Load16bitMonoSampleWAV ( const TCHAR *  filepath,
wiimote_sample out 
)
static
bool wiimote::MotionPlusConnected ( ) const
inline
bool wiimote::MotionPlusEnabled ( ) const
inline
bool wiimote::MotionPlusHasExtension ( ) const
inline
bool wiimote::MuteSpeaker ( bool  on)
bool wiimote::NunchukConnected ( ) const
inline
bool wiimote::operator!= ( const wiimote remote)
inline
bool wiimote::operator== ( const wiimote remote)
inline
bool wiimote::PlaySample ( const wiimote_sample sample,
BYTE  volume = 0x40,
speaker_freq  freq_override = FREQ_NONE 
)
bool wiimote::PlaySquareWave ( speaker_freq  freq,
BYTE  volume = 0x40 
)
void wiimote::RecordState ( state_history events_out,
unsigned  max_time_ms = UNTIL_STOP,
state_change_flags  change_trigger = CHANGED_ALL 
)
state_change_flags wiimote::RefreshState ( )
void wiimote::Reset ( )
void wiimote::RumbleForAsync ( unsigned  milliseconds)
void wiimote::SetLEDs ( BYTE  led_bits)
void wiimote::SetReportType ( input_report  type,
bool  continuous = false 
)
void wiimote::SetRumble ( bool  on)
void wiimote::StopRecording ( )
static unsigned wiimote::TotalConnected ( )
inlinestatic

Member Data Documentation

const TCHAR* wiimote::ButtonNameFromBit[TOTAL_BUTTON_BITS]
static
state_change_flags wiimote::CallbackTriggerFlags
state_changed_callback wiimote::ChangedCallback
const TCHAR* wiimote::ClassicButtonNameFromBit[TOTAL_BUTTON_BITS]
static
const unsigned wiimote::FIRST_AVAILABLE = 0xffffffff
static
const unsigned wiimote::FreqLookup[TOTAL_FREQUENCIES]
static
const TCHAR* wiimote::ReportTypeName[]
static
QWORD wiimote::UniqueID
const unsigned wiimote::UNTIL_STOP = 0xffffffff
static

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