Class: FMOD::Core::Driver
- Inherits:
-
Object
- Object
- FMOD::Core::Driver
- Defined in:
- lib/fmod/core/driver.rb
Overview
Identification information about a sound device.
Instance Attribute Summary collapse
-
#channels ⇒ Integer
readonly
The number of channels in the current speaker setup.
-
#guid ⇒ Guid
readonly
The GUID that uniquely identifies the device.
-
#id ⇒ Integer
readonly
The enumerated driver ID.
-
#name ⇒ String
readonly
The name of the device encoded in a UTF-8 string.
-
#rate ⇒ Integer
readonly
The sample rate this device operates at.
-
#speaker_mode ⇒ Integer
readonly
The speaker setup this device is currently using.
-
#state ⇒ Integer
readonly
Flags that provide additional information about the driver.
Instance Method Summary collapse
-
#initialize(args) ⇒ Driver
constructor
private
A new instance of Driver.
-
#record_driver? ⇒ Boolean
true
if this a record driver, otherwisefalse
.
Constructor Details
#initialize(args) ⇒ Driver
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Driver.
43 44 45 46 47 48 49 50 |
# File 'lib/fmod/core/driver.rb', line 43 def initialize(args) @id = args.shift # noinspection RubyResolve @name = args.shift.delete("\0").force_encoding(Encoding::UTF_8) args.shift @guid = args.shift @rate, @speaker_mode, @channels, @state = args.join.unpack('l*') end |
Instance Attribute Details
#channels ⇒ Integer (readonly)
Returns the number of channels in the current speaker setup.
33 34 35 |
# File 'lib/fmod/core/driver.rb', line 33 def channels @channels end |
#guid ⇒ Guid (readonly)
Returns the GUID that uniquely identifies the device.
20 21 22 |
# File 'lib/fmod/core/driver.rb', line 20 def guid @guid end |
#id ⇒ Integer (readonly)
Returns the enumerated driver ID.
12 13 14 |
# File 'lib/fmod/core/driver.rb', line 12 def id @id end |
#name ⇒ String (readonly)
Returns the name of the device encoded in a UTF-8 string.
16 17 18 |
# File 'lib/fmod/core/driver.rb', line 16 def name @name end |
#rate ⇒ Integer (readonly)
Returns the sample rate this device operates at.
24 25 26 |
# File 'lib/fmod/core/driver.rb', line 24 def rate @rate end |
#speaker_mode ⇒ Integer (readonly)
Returns the speaker setup this device is currently using.
29 30 31 |
# File 'lib/fmod/core/driver.rb', line 29 def speaker_mode @speaker_mode end |
#state ⇒ Integer (readonly)
Returns flags that provide additional information about the driver.
38 39 40 |
# File 'lib/fmod/core/driver.rb', line 38 def state @state end |
Instance Method Details
#record_driver? ⇒ Boolean
Returns true
if this a record driver, otherwise false
.
54 55 56 |
# File 'lib/fmod/core/driver.rb', line 54 def record_driver? !@state.nil? end |