Class: Browser::Audio::Node::Oscillator
- Defined in:
- opal/browser/audio/node.rb
Constant Summary collapse
- TYPES =
%i(sine square sawtooth triangle custom)
Instance Method Summary collapse
-
#initialize(audio_context) ⇒ Oscillator
constructor
A new instance of Oscillator.
-
#type ⇒ Object
-
#type=(type) ⇒ Object
Methods inherited from Base
#connect, #disconnect, #method_missing, #respond_to_missing?
Constructor Details
permalink #initialize(audio_context) ⇒ Oscillator
Returns a new instance of Oscillator.
60 61 62 |
# File 'opal/browser/audio/node.rb', line 60 def initialize(audio_context) super `#{audio_context.to_n}.createOscillator()` end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Browser::Audio::Node::Base
Instance Method Details
permalink #type ⇒ Object
[View source]
72 73 74 |
# File 'opal/browser/audio/node.rb', line 72 def type `#@native.type` end |
permalink #type=(type) ⇒ Object
[View source]
64 65 66 67 68 69 70 |
# File 'opal/browser/audio/node.rb', line 64 def type=(type) unless TYPES.include?(type) raise ArgumentError, "type #{type} doesn't exists" end `#@native.type = type` end |