muzak 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/muzak.rb +1 -1
- data/lib/muzak/player/mpd.rb +6 -2
- data/lib/muzak/player/vlc.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc187bfa8da7fb7a6622bf25b063aed6ab25062b
|
4
|
+
data.tar.gz: 85fea7679610e4f949be1b87ca8f141ba1c17d90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b74e7a470a49f5fa099d89ae843b1d3eb0b3384136da673a0eecefa0c2b007a914a87bf6c0878e31c02943397ee3b475fbbdbce26b195c2e5581129927c41c2
|
7
|
+
data.tar.gz: 62e8301ff354acc40ffd9d0ea858d899c9addc5fe776103e85681de2654fb1ecb57c6fe29006343a34807cb0061008a0540887e31a0d9b659350544861a3c3e5
|
data/lib/muzak.rb
CHANGED
data/lib/muzak/player/mpd.rb
CHANGED
@@ -41,6 +41,8 @@ module Muzak
|
|
41
41
|
# @return [void]
|
42
42
|
# @note Does nothing is playback is already in progress.
|
43
43
|
def play
|
44
|
+
return unless running?
|
45
|
+
|
44
46
|
@mpd.play
|
45
47
|
end
|
46
48
|
|
@@ -48,7 +50,9 @@ module Muzak
|
|
48
50
|
# @return [void]
|
49
51
|
# @note Does nothing is playback is already paused.
|
50
52
|
def pause
|
51
|
-
|
53
|
+
return unless running?
|
54
|
+
|
55
|
+
@mpd.pause = 1
|
52
56
|
end
|
53
57
|
|
54
58
|
# @return [Boolean] whether or not MPD is currently playing.
|
@@ -146,7 +150,7 @@ module Muzak
|
|
146
150
|
def load_song(song)
|
147
151
|
path = song.path.sub("#{Config.music}/", "")
|
148
152
|
@mpd.add(path)
|
149
|
-
@mpd.play if Config.autoplay
|
153
|
+
@mpd.play if Config.autoplay && !playing?
|
150
154
|
end
|
151
155
|
end
|
152
156
|
end
|
data/lib/muzak/player/vlc.rb
CHANGED
@@ -43,6 +43,8 @@ module Muzak
|
|
43
43
|
# @return [void]
|
44
44
|
# @note Does nothing is playback is already in progress.
|
45
45
|
def play
|
46
|
+
return unless running?
|
47
|
+
|
46
48
|
@vlc.play
|
47
49
|
end
|
48
50
|
|
@@ -50,6 +52,8 @@ module Muzak
|
|
50
52
|
# @return [void]
|
51
53
|
# @note Does nothing is playback is already paused.
|
52
54
|
def pause
|
55
|
+
return unless running?
|
56
|
+
|
53
57
|
@vlc.pause
|
54
58
|
end
|
55
59
|
|