Class: WaitUp::Pipeline
- Inherits:
-
Object
- Object
- WaitUp::Pipeline
- Defined in:
- lib/wait_up/pipeline.rb
Overview
Wait Up pipeline class
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#tempo ⇒ Object
readonly
Returns the value of attribute tempo.
Instance Method Summary collapse
- #audiosink ⇒ Object
-
#initialize(filename, tempo) ⇒ Pipeline
constructor
A new instance of Pipeline.
- #play ⇒ Object
- #play_bin ⇒ Object
- #postconverter ⇒ Object
- #preconverter ⇒ Object
- #sink_bin ⇒ Object
- #speed_changer ⇒ Object
Constructor Details
#initialize(filename, tempo) ⇒ Pipeline
Returns a new instance of Pipeline.
10 11 12 13 14 15 16 17 18 |
# File 'lib/wait_up/pipeline.rb', line 10 def initialize(filename, tempo) @filename = filename @tempo = tempo fill_sink_bin link_elements set_up_play_bin end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
8 9 10 |
# File 'lib/wait_up/pipeline.rb', line 8 def filename @filename end |
#tempo ⇒ Object (readonly)
Returns the value of attribute tempo.
8 9 10 |
# File 'lib/wait_up/pipeline.rb', line 8 def tempo @tempo end |
Instance Method Details
#audiosink ⇒ Object
38 39 40 |
# File 'lib/wait_up/pipeline.rb', line 38 def audiosink @audiosink ||= Gst::ElementFactory.make("autoaudiosink", "audiosink") end |
#play ⇒ Object
20 21 22 |
# File 'lib/wait_up/pipeline.rb', line 20 def play play_bin.set_state :playing end |
#play_bin ⇒ Object
24 25 26 |
# File 'lib/wait_up/pipeline.rb', line 24 def play_bin @play_bin ||= Gst::ElementFactory.make "playbin", nil end |
#postconverter ⇒ Object
42 43 44 |
# File 'lib/wait_up/pipeline.rb', line 42 def postconverter @postconverter ||= Gst::ElementFactory.make("audioconvert", "postconverter") end |
#preconverter ⇒ Object
46 47 48 |
# File 'lib/wait_up/pipeline.rb', line 46 def preconverter @preconverter ||= Gst::ElementFactory.make("audioconvert", "preconverter") end |
#sink_bin ⇒ Object
28 29 30 |
# File 'lib/wait_up/pipeline.rb', line 28 def sink_bin @sink_bin ||= Gst::Bin.new("sinkbin") end |
#speed_changer ⇒ Object
32 33 34 35 36 |
# File 'lib/wait_up/pipeline.rb', line 32 def speed_changer @speed_changer ||= Gst::ElementFactory.make("pitch", "speed changer").tap do |element| element.set_property "tempo", tempo end end |