radiodan 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +3 -3
- data/TODO +5 -12
- data/lib/radiodan/adapter/mpd.rb +1 -1
- data/lib/radiodan/adapter/mpd/playlist_parser.rb +1 -2
- data/lib/radiodan/builder.rb +2 -1
- data/lib/radiodan/event_binding.rb +1 -1
- data/lib/radiodan/middleware/panic.rb +9 -6
- data/lib/radiodan/player.rb +3 -0
- data/lib/radiodan/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
radiodan (0.0.
|
4
|
+
radiodan (0.0.4)
|
5
5
|
active_support (~> 3.0.0)
|
6
6
|
em-http-request (~> 1.0.3)
|
7
7
|
em-simple_telnet (~> 0.0.6)
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
active_support (3.0.0)
|
16
16
|
activesupport (= 3.0.0)
|
17
17
|
activesupport (3.0.0)
|
18
|
-
addressable (2.3.
|
18
|
+
addressable (2.3.5)
|
19
19
|
coderay (1.0.9)
|
20
20
|
cookiejar (0.3.0)
|
21
21
|
diff-lcs (1.2.4)
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
http_parser.rb (>= 0.5.3)
|
28
28
|
em-simple_telnet (0.0.9)
|
29
29
|
eventmachine (>= 1.0.0)
|
30
|
-
em-socksify (0.
|
30
|
+
em-socksify (0.3.0)
|
31
31
|
eventmachine (>= 1.0.0.beta.4)
|
32
32
|
em-synchrony (1.0.3)
|
33
33
|
eventmachine (>= 1.0.0.beta.1)
|
data/TODO
CHANGED
@@ -1,17 +1,10 @@
|
|
1
1
|
* Player
|
2
|
-
-
|
3
|
-
-
|
4
|
-
|
5
|
-
|
6
|
-
+ Resume playlists from last position
|
2
|
+
- #sync determines which events to trigger under which circumstances
|
3
|
+
- Set random / repeat flags in MPD
|
4
|
+
- Resume playlists from last position / seek point
|
5
|
+
* Search for music in library, return playlist / array of tracks
|
7
6
|
* MPD Adapter
|
8
7
|
- Figure out a way of testing interface with playlist object
|
9
|
-
* PlaylistSync
|
10
|
-
- Attributes to sync:
|
11
|
-
+ Position in playlist
|
12
|
-
+ Seek position for current item in playlist
|
13
|
-
- Differentiate when a playlist
|
14
|
-
+ is new (make this match exactly)
|
15
|
-
+ is not (keep in bounds of acceptability)
|
16
8
|
* Panic Mode
|
17
9
|
- Add tests
|
10
|
+
* Remove eventmachine?
|
data/lib/radiodan/adapter/mpd.rb
CHANGED
data/lib/radiodan/builder.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'active_support/core_ext/string'
|
3
|
+
require 'pathname'
|
3
4
|
|
4
5
|
require 'logging'
|
5
6
|
require 'player'
|
@@ -45,7 +46,7 @@ class Builder
|
|
45
46
|
klass_path ||= false
|
46
47
|
raise if klass_path
|
47
48
|
|
48
|
-
# attempt to require from
|
49
|
+
# attempt to require from given path
|
49
50
|
klass_path = Pathname.new(File.join(File.dirname(__FILE__), klass_type, "#{klass.underscore}.rb"))
|
50
51
|
require klass_path if klass_path.exist?
|
51
52
|
|
@@ -27,12 +27,15 @@ class Panic
|
|
27
27
|
|
28
28
|
original_state = @player.playlist
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
EM.defer \
|
31
|
+
proc {
|
32
|
+
logger.debug "panic for #{@timeout} seconds"
|
33
|
+
@player.playlist = @playlist
|
34
|
+
sleep(@timeout)
|
35
|
+
},
|
36
|
+
proc {
|
37
|
+
return_to_state original_state
|
38
|
+
}
|
36
39
|
|
37
40
|
@panic
|
38
41
|
end
|
data/lib/radiodan/player.rb
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
+
require 'forwardable'
|
1
2
|
require 'logging'
|
2
3
|
require 'event_binding'
|
3
4
|
require 'playlist_sync'
|
4
5
|
|
5
6
|
class Radiodan
|
6
7
|
class Player
|
8
|
+
extend Forwardable
|
7
9
|
include Logging
|
8
10
|
include EventBinding
|
9
11
|
|
10
12
|
attr_reader :adapter, :playlist
|
13
|
+
def_delegators :adapter, :stop
|
11
14
|
|
12
15
|
def adapter=(adapter)
|
13
16
|
@adapter = adapter
|
data/lib/radiodan/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiodan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -228,7 +228,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
segments:
|
230
230
|
- 0
|
231
|
-
hash:
|
231
|
+
hash: -580184109337175163
|
232
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
233
233
|
none: false
|
234
234
|
requirements:
|
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
version: '0'
|
238
238
|
segments:
|
239
239
|
- 0
|
240
|
-
hash:
|
240
|
+
hash: -580184109337175163
|
241
241
|
requirements: []
|
242
242
|
rubyforge_project:
|
243
243
|
rubygems_version: 1.8.23
|