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



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

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

#play(file) ⇒ Object



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

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

#pomodoroObject



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

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