Class: Primadoro::Views::Sound

Inherits:
Base
  • Object
show all
Defined in:
lib/primadoro.rb

Instance Method Summary collapse

Methods inherited from Base

#display!, #display?

Instance Method Details

#break_timeObject



80
81
82
# File 'lib/primadoro.rb', line 80

def break_time
  play(File.join(File.dirname(__FILE__), "..", "resources", "bell.mp3"))        
end

#play(file) ⇒ Object



66
67
68
69
70
71
72
73
74
# File 'lib/primadoro.rb', line 66

def play(file)
  if RUBY_PLATFORM =~ /darwin/
    `afplay #{file}`
  elsif RUBY_PLATFORM =~ /mswin32/
    `sndrec32 /play /close "#{file}"`
  else
    `play #{file}`
  end
end

#pomodoroObject



76
77
78
# File 'lib/primadoro.rb', line 76

def pomodoro
  play(File.join(File.dirname(__FILE__), "..", "resources", "windup.wav"))
end