Sha256: 8be4b418f6dc94f9dc52a1e312b5713c57b864fd9c840a095d0b344cbffe6d18

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

module Launchpad

  # Generic launchpad error.
  class LaunchpadError < StandardError; end

  # Error raised when the MIDI device specified doesn't exist.
  class NoSuchDeviceError < LaunchpadError; end

  # Error raised when the MIDI device specified is busy.
  class DeviceBusyError < LaunchpadError; end

  # Error raised when an input has been requested, although
  # launchpad has been initialized without input.
  class NoInputAllowedError < LaunchpadError; end

  # Error raised when an output has been requested, although
  # launchpad has been initialized without output.
  class NoOutputAllowedError < LaunchpadError; end

  # Error raised when <tt>x/y</tt> coordinates outside of the grid
  # or none were specified.
  class NoValidGridCoordinatesError < LaunchpadError; end

  # Error raised when wrong brightness was specified.
  class NoValidBrightnessError < LaunchpadError; end

  # Error raised when anything fails while communicating
  # with the launchpad.
  class CommunicationError < LaunchpadError
    attr_accessor :source
    def initialize(e)
      super(e.portmidi_error)
      self.source = e
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mrjoy-launchpad-0.4.0 lib/launchpad/errors.rb