Play from the last frame starts over, rather than playing one frame
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c359ac650f
commit
fcf2e20f78
1 changed files with 13 additions and 7 deletions
|
|
@ -63,11 +63,18 @@
|
|||
(get-in db [:ui :gesture :auto-key?])
|
||||
(assoc :dispatch [:arthur.events.ui/record-gesture f])))))
|
||||
|
||||
(rf/reg-event-fx
|
||||
::play
|
||||
(fn [{:keys [db]} _]
|
||||
{:db (assoc-in db [:playback :playing?] true)
|
||||
::play-from! [(fps db) (frames db) (get-in db [:playback :frame] 0)]}))
|
||||
(defn- start
|
||||
"Play from the playhead, or from the top when the playhead is on the last
|
||||
frame. Playing the last frame alone is a twenty-fourth of a second and then
|
||||
silence, so play there looked like a button that did nothing."
|
||||
[db]
|
||||
(let [n (frames db)
|
||||
f (get-in db [:playback :frame] 0)
|
||||
f (if (< f (dec n)) f 0)]
|
||||
{:db (update db :playback assoc :playing? true :frame f)
|
||||
::play-from! [(fps db) n f]}))
|
||||
|
||||
(rf/reg-event-fx ::play (fn [{:keys [db]} _] (start db)))
|
||||
|
||||
(rf/reg-event-fx
|
||||
::pause
|
||||
|
|
@ -80,8 +87,7 @@
|
|||
(fn [{:keys [db]} _]
|
||||
(if (get-in db [:playback :playing?])
|
||||
{:db (assoc-in db [:playback :playing?] false) ::pause! nil}
|
||||
{:db (assoc-in db [:playback :playing?] true)
|
||||
::play-from! [(fps db) (frames db) (get-in db [:playback :frame] 0)]})))
|
||||
(start db))))
|
||||
|
||||
(rf/reg-event-fx
|
||||
::seek
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue