gtk2mp3 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,5 +51,6 @@ module Configuration
51
51
  C_LOAD = 'L'
52
52
  C_QUIT = 'Q'
53
53
 
54
+ SLEEP = 0.5
54
55
  end
55
56
  end
data/lib/gtk2mp3.rb CHANGED
@@ -35,6 +35,7 @@ module Gtk2MP3 # Gtk2MP3 defined
35
35
  @pipe = IO.popen(Configuration::PLAYER,'w+') # IO defined
36
36
  self.puts Configuration::C_SILENCE
37
37
  @thread = Thread.new { self.read }
38
+ sleep(Configuration::SLEEP)
38
39
  end
39
40
  end
40
41
  def puts(string)
@@ -85,7 +86,8 @@ module Gtk2MP3 # Gtk2MP3 defined
85
86
  if Configuration::EDIT then
86
87
  Gtk2AppLib::Widgets::Label.new(*spacer) # Spacer
87
88
  Gtk2AppLib::Widgets::Button.new(*Configuration::EDIT+[hbox]) do
88
- self.stop_song
89
+ self.stop_song!
90
+ sleep(Configuration::SLEEP)
89
91
  filename = self.current
90
92
  copy = File.join( Gtk2AppLib::USERDIR, File.basename(filename) )
91
93
  if system( "xterm -e cutmp3 -i #{filename} -O #{copy}" )
@@ -93,7 +95,7 @@ module Gtk2MP3 # Gtk2MP3 defined
93
95
  File.rename( copy, filename ) # replace with edited file
94
96
  end
95
97
  end
96
- @continue = true
98
+ sleep(Configuration::SLEEP)
97
99
  self.play_current
98
100
  end
99
101
  end
@@ -157,16 +159,16 @@ module Gtk2MP3 # Gtk2MP3 defined
157
159
  self.load_song
158
160
  end
159
161
 
160
- def _stop_song
162
+ def stop_song!
161
163
  @pipe.puts Configuration::C_STOP
162
- @previous = ''
163
- @continue = false
164
164
  @pipe.close
165
165
  end
166
166
 
167
167
  def stop_song
168
168
  if @continue then
169
- _stop_song
169
+ @previous = ''
170
+ @continue = false
171
+ stop_song!
170
172
  else
171
173
  @continue = true
172
174
  self.load_song
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gtk2mp3
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.0
5
+ version: 0.7.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - carlosjhr64@gmail.com
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-23 00:00:00 Z
13
+ date: 2012-01-24 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: gtk2applib