Module: AlsaRawMIDI::Device

Extended by:
ClassMethods
Included in:
Input, Output
Defined in:
lib/alsa-rawmidi/device.rb

Overview

Functionality common to both inputs and outputs

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

all, all_by_type, first, last

Instance Attribute Details

#enabledObject (readonly) Also known as: enabled?

has the device been initialized?



62
63
64
# File 'lib/alsa-rawmidi/device.rb', line 62

def enabled
  @enabled
end

#idObject

has the device been initialized?



62
63
64
# File 'lib/alsa-rawmidi/device.rb', line 62

def id
  @id
end

#nameObject (readonly)

has the device been initialized?



62
63
64
# File 'lib/alsa-rawmidi/device.rb', line 62

def name
  @name
end

#subnameObject (readonly)

has the device been initialized?



62
63
64
# File 'lib/alsa-rawmidi/device.rb', line 62

def subname
  @subname
end

#system_idObject (readonly)

has the device been initialized?



62
63
64
# File 'lib/alsa-rawmidi/device.rb', line 62

def system_id
  @system_id
end

#typeObject (readonly)

has the device been initialized?



62
63
64
# File 'lib/alsa-rawmidi/device.rb', line 62

def type
  @type
end

Class Method Details

.included(base) ⇒ Object



71
72
73
# File 'lib/alsa-rawmidi/device.rb', line 71

def self.included(base)
  base.send(:extend, ClassMethods)
end

Instance Method Details

#initialize(options = {}) ⇒ Object

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :id (Integer)
  • :name (String)
  • :subname (String)
  • :system_id (String)


80
81
82
83
84
85
86
87
# File 'lib/alsa-rawmidi/device.rb', line 80

def initialize(options = {})
  @id = options[:id]
  @name = options[:name]
  @subname = options[:subname]
  @system_id = options[:system_id]
  @type = get_type
  @enabled = false
end