wait_up 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Changelog.md +10 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/bin/wait_up +3 -1
- data/bin/wait_up-cli +5 -3
- data/lib/wait_up/application.rb +31 -17
- data/lib/wait_up/pipeline.rb +38 -22
- data/lib/wait_up/version.rb +5 -0
- data/lib/wait_up.rb +4 -1
- metadata +91 -38
- data/Gemfile +0 -3
- data/Rakefile +0 -23
- data/test/end_to_end/basic_run_test.rb +0 -27
- data/test/test_helper.rb +0 -1
- data/test/unit/pipeline_test.rb +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 90a5da22c269e5072c01541fd0cf8408e96fc8bf568c7076d4b0fd5084d82f86
|
4
|
+
data.tar.gz: f25747bf90037f097813b06bf43051ac6724a69490353bc911ded33157468bc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2152a5a517a6b2a7c07836a9581e7b0276881143cf93c2dc8c3032a61f7139387a056e48394e0491bf102e68138a3866f8c3a9b4f9c93c48d7b5cebec7caef1d
|
7
|
+
data.tar.gz: 3e9a8b63a7c6f12ce9ce346d0e5a6b8c583bed903b46e170880e3ab19e8ed333e51ba17bb2fbb327b80b68ac823af15236401f5f81ebeecc5811fd900eb25684
|
data/Changelog.md
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -48,5 +48,5 @@ If you want to run the tests, you may need to install additional packages:
|
|
48
48
|
|
49
49
|
## License
|
50
50
|
|
51
|
-
Copyright © 2015–
|
51
|
+
Copyright © 2015–2024 [Matijs van Zuijlen](http://www.matijs.net).
|
52
52
|
See LICENSE for details.
|
data/bin/wait_up
CHANGED
data/bin/wait_up-cli
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "wait_up/pipeline"
|
3
5
|
|
4
6
|
unless ARGV.length == 2
|
5
|
-
warn
|
7
|
+
warn "Usage: wait_up-cli [file] [tempo]"
|
6
8
|
exit 1
|
7
9
|
end
|
8
10
|
filename = ARGV[0]
|
@@ -16,7 +18,7 @@ mainloop = GLib::MainLoop.new(GLib::MainContext.default, true)
|
|
16
18
|
bus = pipeline.play_bin.bus
|
17
19
|
bus.add_signal_watch
|
18
20
|
|
19
|
-
bus.signal_connect
|
21
|
+
bus.signal_connect "message" do |_bus, message, _ud|
|
20
22
|
case message.type
|
21
23
|
when Gst::MessageType::ERROR, Gst::MessageType::EOS
|
22
24
|
mainloop.quit
|
data/lib/wait_up/application.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "gtk3"
|
2
4
|
|
3
5
|
module WaitUp
|
4
6
|
# Main Wait Up application class
|
@@ -19,11 +21,11 @@ module WaitUp
|
|
19
21
|
end
|
20
22
|
|
21
23
|
def connect_destroy_signal
|
22
|
-
@win.signal_connect(
|
24
|
+
@win.signal_connect("destroy") { Gtk.main_quit }
|
23
25
|
end
|
24
26
|
|
25
27
|
def connect_key_press_event_signal
|
26
|
-
@win.signal_connect
|
28
|
+
@win.signal_connect "key-press-event" do |_wdg, evt, _ud|
|
27
29
|
handle_key(evt) if evt.state.control_mask?
|
28
30
|
false
|
29
31
|
end
|
@@ -31,35 +33,47 @@ module WaitUp
|
|
31
33
|
|
32
34
|
def handle_key(evt)
|
33
35
|
case evt.keyval
|
34
|
-
when
|
36
|
+
when "q".ord
|
35
37
|
@win.destroy
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
39
41
|
def connect_slide_signal
|
40
|
-
|
42
|
+
timeline.signal_connect "format-value" do |_scale, value, _user_data|
|
41
43
|
">#{value}<"
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
45
47
|
def connect_file_chooser_signal
|
46
|
-
|
47
|
-
puts
|
48
|
+
chooser.signal_connect "file-set" do |_widget, _user_data|
|
49
|
+
puts chooser.filename
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
51
53
|
def setup_gui
|
52
54
|
@win = Gtk::Window.new :toplevel
|
53
|
-
@grid
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
@grid
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
@win.add grid
|
56
|
+
end
|
57
|
+
|
58
|
+
def grid
|
59
|
+
@grid ||=
|
60
|
+
Gtk::Grid.new.tap do |grid|
|
61
|
+
grid.orientation = :vertical
|
62
|
+
grid.add chooser
|
63
|
+
grid.add timeline
|
64
|
+
grid.add Gtk::VolumeButton.new
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def timeline
|
69
|
+
@timeline ||=
|
70
|
+
Gtk::Scale.new(:horizontal, 0.0, 10.0, 0.1).tap do |it|
|
71
|
+
it.hexpand = true
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def chooser
|
76
|
+
@chooser ||= Gtk::FileChooserButton.new("Hello!", :open)
|
63
77
|
end
|
64
78
|
end
|
65
79
|
end
|
data/lib/wait_up/pipeline.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "gstreamer"
|
2
4
|
|
3
5
|
module WaitUp
|
4
6
|
# Wait Up pipeline class
|
@@ -9,21 +11,10 @@ module WaitUp
|
|
9
11
|
@filename = filename
|
10
12
|
@tempo = tempo
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
sink_bin.add audiosink
|
15
|
-
sink_bin.add postconverter
|
16
|
-
sink_bin.add speed_changer
|
17
|
-
|
18
|
-
speed_changer.link postconverter
|
19
|
-
postconverter.link audiosink
|
14
|
+
fill_sink_bin
|
15
|
+
link_elements
|
20
16
|
|
21
|
-
|
22
|
-
sink_bin.add_pad sink_pad
|
23
|
-
|
24
|
-
play_bin.audio_sink = sink_bin
|
25
|
-
play_bin.state = :paused
|
26
|
-
play_bin.get_state(-1)
|
17
|
+
set_up_play_bin
|
27
18
|
end
|
28
19
|
|
29
20
|
def play
|
@@ -31,29 +22,54 @@ module WaitUp
|
|
31
22
|
end
|
32
23
|
|
33
24
|
def play_bin
|
34
|
-
@play_bin ||= Gst::ElementFactory.make
|
25
|
+
@play_bin ||= Gst::ElementFactory.make "playbin", nil
|
35
26
|
end
|
36
27
|
|
37
28
|
def sink_bin
|
38
|
-
@sink_bin ||= Gst::Bin.new(
|
29
|
+
@sink_bin ||= Gst::Bin.new("sinkbin")
|
39
30
|
end
|
40
31
|
|
41
32
|
def speed_changer
|
42
|
-
@speed_changer ||= Gst::ElementFactory.make(
|
43
|
-
element.set_property
|
33
|
+
@speed_changer ||= Gst::ElementFactory.make("pitch", "speed changer").tap do |element|
|
34
|
+
element.set_property "tempo", tempo
|
44
35
|
end
|
45
36
|
end
|
46
37
|
|
47
38
|
def audiosink
|
48
|
-
@audiosink ||= Gst::ElementFactory.make(
|
39
|
+
@audiosink ||= Gst::ElementFactory.make("autoaudiosink", "audiosink")
|
49
40
|
end
|
50
41
|
|
51
42
|
def postconverter
|
52
|
-
@postconverter ||= Gst::ElementFactory.make(
|
43
|
+
@postconverter ||= Gst::ElementFactory.make("audioconvert", "postconverter")
|
53
44
|
end
|
54
45
|
|
55
46
|
def preconverter
|
56
|
-
@preconverter ||= Gst::ElementFactory.make(
|
47
|
+
@preconverter ||= Gst::ElementFactory.make("audioconvert", "preconverter")
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def fill_sink_bin
|
53
|
+
sink_bin.add audiosink
|
54
|
+
sink_bin.add postconverter
|
55
|
+
sink_bin.add speed_changer
|
56
|
+
sink_bin.add_pad speed_changer_ghost_pad
|
57
|
+
end
|
58
|
+
|
59
|
+
def speed_changer_ghost_pad
|
60
|
+
@speed_changer_ghost_pad ||= Gst::GhostPad.new "sink", speed_changer.sinkpads.first
|
61
|
+
end
|
62
|
+
|
63
|
+
def link_elements
|
64
|
+
speed_changer.link postconverter
|
65
|
+
postconverter.link audiosink
|
66
|
+
end
|
67
|
+
|
68
|
+
def set_up_play_bin
|
69
|
+
play_bin.set_property "uri", "file://#{File.absolute_path(filename)}"
|
70
|
+
play_bin.audio_sink = sink_bin
|
71
|
+
play_bin.state = :paused
|
72
|
+
play_bin.get_state(-1)
|
57
73
|
end
|
58
74
|
end
|
59
75
|
end
|
data/lib/wait_up.rb
CHANGED
metadata
CHANGED
@@ -1,146 +1,199 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wait_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matijs van Zuijlen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: gstreamer
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: gtk3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 4.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: gnome_app_driver
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.3.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.3.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '5.
|
61
|
+
version: '5.12'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.12'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '13.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '13.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake-manifest
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.2.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.2.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.51'
|
62
104
|
type: :development
|
63
105
|
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
108
|
- - "~>"
|
67
109
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
110
|
+
version: '1.51'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
112
|
+
name: rubocop-minitest
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
115
|
- - "~>"
|
74
116
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
117
|
+
version: 0.36.0
|
76
118
|
type: :development
|
77
119
|
prerelease: false
|
78
120
|
version_requirements: !ruby/object:Gem::Requirement
|
79
121
|
requirements:
|
80
122
|
- - "~>"
|
81
123
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
124
|
+
version: 0.36.0
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
126
|
+
name: rubocop-packaging
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
86
128
|
requirements:
|
87
129
|
- - "~>"
|
88
130
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
131
|
+
version: 0.5.1
|
90
132
|
type: :development
|
91
133
|
prerelease: false
|
92
134
|
version_requirements: !ruby/object:Gem::Requirement
|
93
135
|
requirements:
|
94
136
|
- - "~>"
|
95
137
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
97
|
-
|
138
|
+
version: 0.5.1
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-performance
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1.18'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1.18'
|
153
|
+
description:
|
98
154
|
email:
|
99
155
|
- matijs@matijs.net
|
100
156
|
executables:
|
101
157
|
- wait_up
|
102
158
|
- wait_up-cli
|
103
159
|
extensions: []
|
104
|
-
extra_rdoc_files:
|
160
|
+
extra_rdoc_files:
|
161
|
+
- README.md
|
162
|
+
- Changelog.md
|
105
163
|
files:
|
106
164
|
- Changelog.md
|
107
|
-
- Gemfile
|
108
165
|
- LICENSE
|
109
166
|
- README.md
|
110
|
-
- Rakefile
|
111
167
|
- bin/wait_up
|
112
168
|
- bin/wait_up-cli
|
113
169
|
- lib/wait_up.rb
|
114
170
|
- lib/wait_up/application.rb
|
115
171
|
- lib/wait_up/pipeline.rb
|
116
|
-
-
|
117
|
-
- test/test_helper.rb
|
118
|
-
- test/unit/pipeline_test.rb
|
172
|
+
- lib/wait_up/version.rb
|
119
173
|
homepage: http://www.github.com/mvz/wait_up
|
120
174
|
licenses:
|
121
175
|
- MIT
|
122
|
-
metadata:
|
123
|
-
|
124
|
-
|
176
|
+
metadata:
|
177
|
+
rubygems_mfa_required: 'true'
|
178
|
+
post_install_message:
|
179
|
+
rdoc_options:
|
180
|
+
- "--main"
|
181
|
+
- README.md
|
125
182
|
require_paths:
|
126
183
|
- lib
|
127
184
|
required_ruby_version: !ruby/object:Gem::Requirement
|
128
185
|
requirements:
|
129
186
|
- - ">="
|
130
187
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
188
|
+
version: 3.0.0
|
132
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
190
|
requirements:
|
134
191
|
- - ">="
|
135
192
|
- !ruby/object:Gem::Version
|
136
193
|
version: '0'
|
137
194
|
requirements: []
|
138
|
-
|
139
|
-
|
140
|
-
signing_key:
|
195
|
+
rubygems_version: 3.5.23
|
196
|
+
signing_key:
|
141
197
|
specification_version: 4
|
142
198
|
summary: Play sound files slowly so you can follow along
|
143
|
-
test_files:
|
144
|
-
- test/unit/pipeline_test.rb
|
145
|
-
- test/test_helper.rb
|
146
|
-
- test/end_to_end/basic_run_test.rb
|
199
|
+
test_files: []
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'rake/clean'
|
2
|
-
require 'bundler/gem_tasks'
|
3
|
-
require 'rake/testtask'
|
4
|
-
|
5
|
-
namespace :test do
|
6
|
-
Rake::TestTask.new(:unit) do |t|
|
7
|
-
t.libs = ['lib']
|
8
|
-
t.test_files = FileList['test/unit/*_test.rb']
|
9
|
-
t.warning = true
|
10
|
-
end
|
11
|
-
|
12
|
-
Rake::TestTask.new(:end_to_end) do |t|
|
13
|
-
t.libs = ['lib']
|
14
|
-
t.test_files = FileList['test/end_to_end/*_test.rb']
|
15
|
-
t.warning = true
|
16
|
-
end
|
17
|
-
|
18
|
-
task all: [:unit, :end_to_end]
|
19
|
-
end
|
20
|
-
|
21
|
-
task test: 'test:all'
|
22
|
-
|
23
|
-
task default: 'test'
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require_relative '../test_helper'
|
2
|
-
require 'atspi_app_driver'
|
3
|
-
|
4
|
-
# Test driver for the Wait Up application.
|
5
|
-
class WaitUpDriver < AtspiAppDriver
|
6
|
-
def initialize
|
7
|
-
super 'wait_up'
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
describe 'The Wait Up application' do
|
12
|
-
before do
|
13
|
-
@driver = WaitUpDriver.new
|
14
|
-
@driver.boot
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'starts and can be quit with Ctrl-q' do
|
18
|
-
@driver.press_ctrl_q
|
19
|
-
|
20
|
-
status = @driver.cleanup
|
21
|
-
status.exitstatus.must_equal 0
|
22
|
-
end
|
23
|
-
|
24
|
-
after do
|
25
|
-
@driver.cleanup
|
26
|
-
end
|
27
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'minitest/autorun'
|
data/test/unit/pipeline_test.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
require_relative '../test_helper'
|
2
|
-
require_relative '../../lib/wait_up/pipeline'
|
3
|
-
|
4
|
-
Gst.init
|
5
|
-
|
6
|
-
def next_element(element)
|
7
|
-
# FIXME: Reduce the number of necessary chained calls here.
|
8
|
-
pad = element.srcpads.first
|
9
|
-
peer = pad.peer if pad
|
10
|
-
peer.parent if peer
|
11
|
-
end
|
12
|
-
|
13
|
-
describe WaitUp::Pipeline do
|
14
|
-
# Empty mp3 file from http://www.xamuel.com/blank-mp3s/
|
15
|
-
let(:filename) { File.join(File.dirname(__FILE__), '..', 'fixtures', 'point1sec.mp3') }
|
16
|
-
let(:instance) { WaitUp::Pipeline.new filename, 0.9 }
|
17
|
-
|
18
|
-
describe '#sink_bin' do
|
19
|
-
let(:sink_bin) { instance.sink_bin }
|
20
|
-
|
21
|
-
it 'returns a Gst::Bin' do
|
22
|
-
sink_bin.must_be_instance_of Gst::Bin
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'has the correct build-up' do
|
26
|
-
sink_bin.map(&:name).must_equal ['speed changer', 'postconverter', 'audiosink']
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'has the elements all linked up' do
|
30
|
-
sink_bin.each_cons(2) do |src, dst|
|
31
|
-
next_element(src).
|
32
|
-
must_equal dst, "Expected #{src.name} to link up to #{dst.name}"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'must have the state :paused' do
|
37
|
-
sink_bin.get_state(0)[1].must_equal Gst::State::PAUSED
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'must be linked up to a source' do
|
41
|
-
sink_bin.sinkpads.first.peer.wont_be_nil
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe '#play_bin' do
|
46
|
-
let(:play_bin) { instance.play_bin }
|
47
|
-
|
48
|
-
it 'must have the state :paused' do
|
49
|
-
play_bin.get_state(0)[1].must_equal Gst::State::PAUSED
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'has the correct source set up' do
|
53
|
-
source = play_bin.source
|
54
|
-
source.uri.must_equal "file://#{File.absolute_path filename}"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe '#speed_changer' do
|
59
|
-
let(:speed_changer) { instance.speed_changer }
|
60
|
-
it 'returns a Gst::Element' do
|
61
|
-
speed_changer.must_be_kind_of Gst::Element
|
62
|
-
end
|
63
|
-
|
64
|
-
it 'has the correct tempo' do
|
65
|
-
speed_changer.get_property('tempo').must_be_close_to 0.9
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
describe '#play' do
|
70
|
-
it "sets the play bin's state to :playing" do
|
71
|
-
instance.play
|
72
|
-
instance.play_bin.get_state(0)[1].must_equal Gst::State::PLAYING
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|