Re: Vibration: throwing and pause

Hi Anne, Justin,

Thanks for your review and feedback! Here's a summary of your
proposed changes:

* in step 4 add "and is not zero"

* in step 7 s/abort the algorithm at this point/terminate these
  steps/

* in step 9 s/return false/return true/

* s/abort/terminate/g

* in [NEW] step s/Run the remainder of these steps 
  asynchronously, and return true from the method./Return true,
  and then continue running these steps asynchronously./

* in step 10.2 s/spin/wait/

And here's the new version of the algorithm with the above
changes baked in:

[[

1. Let pattern be the value of the first argument.

2. If pattern is a list, proceed to the next step. Otherwise run
  the following substeps:
  1. Let list be an initially empty list, and add pattern to
     list.
  2. Let pattern be list.

3. If any entry of pattern exceeds an implementation-dependent
  limit, then return false and terminate these steps.

4. If the length of pattern is even and is not zero, then remove
   the last entry in pattern.

5. If the length of pattern exceeds an implementation dependent
  limit, then return false and terminate these steps.

6. If the hidden attribute [PAGE-VISIBILITY] is set to true,
   then return false and terminate these steps.

[ Note 1 ]

7. An implementation may return false and terminate these steps.

[ Note 2 ]

8. Cancel the pre-existing instance of the processing vibration
  patterns algorithm, if any.

9. If pattern is 0, an empty list, or if the device does not
   provide a vibration mechanism (or it is disabled), then return
   true and terminate these steps.

[NEW] Return true, and then continue running these steps
      asynchronously.

10. For each time in pattern, run the following substeps:
  1. If the index of time is even (the first entry has index 0),
     vibrate the device for time milliseconds.
  2. Otherwise wait for time milliseconds.

]]

Please take a look at this version and let me know if I missed
any of your feedback, or if there are any further bugs or issues.

Thanks,

-Anssi

Received on Thursday, 18 April 2013 08:00:43 UTC