TatriX / pomidor

Pomidor is a simple and cool pomodoro technique timer.
239 stars 17 forks source link

Overwork sound playing every interval update #10

Closed vfinotti closed 6 years ago

vfinotti commented 6 years ago

I have notice that the overwork sound plays every interval update, even when it is not in the "overwork state". That is actually a surprise, because the code seems only to run the play command when pomidor-overwork-p is true:

(defun pomidor--update ()
  "Update pomidor state."
  (let* ((state (pomidor--current-state))
         (total (pomidor--total-duration state))
         (ellapsed (round (time-to-seconds total))))
    (pomidor--tick-tack ellapsed)
    (when (zerop (mod ellapsed pomidor-update-interval))
      (when (functionp pomidor-alert)
        (funcall pomidor-alert))
      (run-hooks 'pomidor-update-hook)
      (when (pomidor-overwork-p)
        (pomidor-play-sound-file-async pomidor-sound-overwork))))
(pomidor--render))

Am I getting the code right? Is this the expected behaviour?

TatriX commented 6 years ago

If I understand you correctly, then yes, this is expected. I want overwork sound to play every minute to annoy me and force me to make a pause.

vfinotti commented 6 years ago

Actually, what was happening in my case is that the overwork sound was playing all the time. After a closer look, I realise this is related to the function that notifies when the break is over, and this has already been mentioned on a previous issue. I will post my comments there, sorry for the inconvenience.

TatriX commented 6 years ago

Closed in https://github.com/TatriX/pomidor/commit/5780ce2aaa98882a79e92f5eefaaf10fd8dbee3a