mikeplayer 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mikeplayer/playlist.rb +4 -2
- data/lib/mikeplayer/version.rb +1 -1
- data/lib/mikeplayer.rb +12 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 129df9ce63171d9efbe8bd1e581fdbfdf33fdadf127936089db72149ebd76a54
|
4
|
+
data.tar.gz: 25f8be729ae785873137a34e291c63983fcb9a5ff71ccb035e6160bbb3448007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1ec4ae4f8a765ffeed9fb96d7097f97392a27db66211a4bfc4bb14f7a1636b876ec40ecd84458a8ce8a53050cc160d36769a18088fa99533ce927e8ac5185c8
|
7
|
+
data.tar.gz: eebd1b3afce640dd29ba8e639122f56b64c7b7e0878a1b50e0f7e72cc78a4b258708e50ef8cde1e5fc1f43916b39b42444339b339ad488cdada53a387692ac6e
|
data/lib/mikeplayer/playlist.rb
CHANGED
@@ -55,7 +55,9 @@ module MikePlayer
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def previous
|
58
|
-
@song_i -= 1
|
58
|
+
@song_i -= 1
|
59
|
+
|
60
|
+
@song_i = 0 if @song_i < 0
|
59
61
|
|
60
62
|
return self.current
|
61
63
|
end
|
@@ -87,7 +89,7 @@ module MikePlayer
|
|
87
89
|
end
|
88
90
|
|
89
91
|
def finished?
|
90
|
-
return @song_i
|
92
|
+
return @song_i >= @songs.size
|
91
93
|
end
|
92
94
|
|
93
95
|
private
|
data/lib/mikeplayer/version.rb
CHANGED
data/lib/mikeplayer.rb
CHANGED
@@ -75,7 +75,7 @@ module MikePlayer
|
|
75
75
|
pause_if_over_time_limit
|
76
76
|
|
77
77
|
if (true == playing?)
|
78
|
-
indicator = "#{'>' * (playing_time % 4)}"
|
78
|
+
indicator = "#{'>' * (playing_time % 4)}".ljust(4)
|
79
79
|
info_changed = true
|
80
80
|
elsif (true == paused?) && (PAUSE_INDICATOR != indicator)
|
81
81
|
indicator = PAUSE_INDICATOR
|
@@ -89,12 +89,14 @@ module MikePlayer
|
|
89
89
|
mindicator = "(#{minutes_remaining}↓) "
|
90
90
|
end
|
91
91
|
|
92
|
-
|
92
|
+
print("\r" << ' '.ljust(display_width))
|
93
93
|
|
94
|
-
|
94
|
+
info = "#{info_prefix} #{song.length_str(playing_time)} #{mindicator}#{indicator}"
|
95
95
|
|
96
96
|
print(info)
|
97
97
|
|
98
|
+
display_width = info.size
|
99
|
+
|
98
100
|
info_changed = false
|
99
101
|
$stdout.flush
|
100
102
|
end
|
@@ -108,17 +110,18 @@ module MikePlayer
|
|
108
110
|
@pid = nil
|
109
111
|
|
110
112
|
if (true == playing?)
|
111
|
-
next_song
|
113
|
+
next_song unless @pid.nil?
|
112
114
|
end
|
113
115
|
end
|
114
116
|
|
115
117
|
@pid = nil
|
118
|
+
print("\r\n")
|
116
119
|
exit
|
117
120
|
end
|
118
121
|
|
119
122
|
wait_on_user
|
120
123
|
|
121
|
-
|
124
|
+
print("\r\n")
|
122
125
|
end
|
123
126
|
|
124
127
|
def cmd_exist?(cmd)
|
@@ -208,6 +211,7 @@ module MikePlayer
|
|
208
211
|
end
|
209
212
|
|
210
213
|
@state = STOPPED
|
214
|
+
@pid = nil
|
211
215
|
end
|
212
216
|
|
213
217
|
def pid_alive?(pid = @pid)
|
@@ -227,7 +231,9 @@ module MikePlayer
|
|
227
231
|
def previous_song
|
228
232
|
stop_song
|
229
233
|
|
230
|
-
|
234
|
+
if (playing_time < 10)
|
235
|
+
@playlist.previous
|
236
|
+
end
|
231
237
|
end
|
232
238
|
|
233
239
|
def kill(signal)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mikeplayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Crockett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|