### IMMDeviceHandler

  The IMMDeviceHandler class is the base handler class for IMMDevices and provides behavior common to all devices. IMMDeviceHandler inherits from IHandler. It inherits dispatchHandlerEvent virtual function from IHandler to encapsulate the multimedia interface. This function does four things. First, it determines what message has been received and converts it into the appropriate event. Second, it determines which device the event is for. Third, it calls the virtual function for the event. Fourth, it goes through the list of added IObservers for the device and calls the IObserver::dispatchNotificationEvent with the event.

### IMMDeviceHandler - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class.

~IMMDeviceHandler

      public:
      virtual ~IMMDeviceHandler()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | No

IMMDeviceHandler

      public:
      IMMDeviceHandler()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | No

### Device Attachment

Use these members to attach and detach the handler object to and from a given device.

handleEventsFor

      public:
      virtual IMMDeviceHandler&
        handleEventsFor( IMMDevice* device )

  Attaches the handler to the specified IMMDevice object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | No

stopHandlingEventsFor

      public:
      virtual IMMDeviceHandler&
        stopHandlingEventsFor( IMMDevice* device )

  Detaches the handler from the specified IMMDevice object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | No

### Event Dispatching

Event-dispatching members evaluate an event to determine if it is appropriate for this handler object to process. If it is, these members call the virtual function used to process the event.

dispatchHandlerEvent

      protected:
      virtual bool dispatchHandlerEvent(IEvent& event)

  This function does four things. First, it determines what message has been received and converts it into the appropriate event. Second, it determines which device the event is for. Third, it calls the virtual function for the event. Fourth, it goes through the list of added IObservers for the device and calls the IObserver::dispatchNotificationEvent with the event.

  A given handler should return true if the event should not be dispatched to other handlers. In such cases, a result can be placed in the specified IEvent object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | No

### Event Processing

Derived classes must supply these members to process a device, position change, pass, or cue point event.

cuePoint

      public:
      virtual bool cuePoint(const IMMCuePointEvent& event)

  Implemented by derived classes to process cuePoint events.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | No

deviceEvent

      public:
      virtual bool deviceEvent(const IMMDeviceEvent& event)

  Implemented by derived classes to process device events.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | No

passDevice

      public:
      virtual bool passDevice(const IMMPassDeviceEvent& event)

  Implemented by derived classes to process pass device events.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | No

positionChange

      public:
      virtual bool
        positionChange( const IMMPositionChangeEvent& event )

  Implemented by derived classes to process position change events.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | No

### IMMDeviceHandler - Inherited Member Functions and Data

#### Inherited Public Functions

  IHandler

  -     virtual ~IHandler()

  -     virtual IString asDebugInfo() const

  -     virtual IString asString() const

  -     virtual IHandler& disable()

  -     virtual IHandler& enable(bool enable = true)

  -     virtual IHandler& handleEventsFor(IWindow* window)

  -     IHandler()

  -     bool isEnabled() const

  -     virtual IHandler& stopHandlingEventsFor(IWindow* window)

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IHandler

  -     virtual IEventResult defaultProcedure(IEvent& event)

  -     virtual bool dispatchHandlerEvent(IEvent& event) = 0

#### Inherited Protected Data

  - None