|
80 | 80 | :group 'ffmpeg-player) |
81 | 81 |
|
82 | 82 | (defcustom ffmpeg-player-mode-hook nil |
83 | | - "*Hook called by `ffmpeg-player-mode'." |
| 83 | + "Hook called by `ffmpeg-player-mode'." |
84 | 84 | :type 'hook |
85 | 85 | :group 'ffmpeg-player) |
86 | 86 |
|
|
89 | 89 | :type 'boolean |
90 | 90 | :group 'ffmpeg-player) |
91 | 91 |
|
| 92 | +(defcustom ffmpeg-player-before-insert-image-hook nil |
| 93 | + "Hook called before inserting image." |
| 94 | + :type 'hook |
| 95 | + :group 'ffmpeg-player) |
| 96 | + |
| 97 | +(defcustom ffmpeg-player-after-insert-image-hook nil |
| 98 | + "Hook called after inserting image." |
| 99 | + :type 'hook |
| 100 | + :group 'ffmpeg-player) |
| 101 | + |
| 102 | +(defcustom ffmpeg-player-before-insert-string-hook nil |
| 103 | + "Hook called before inserting string." |
| 104 | + :type 'hook |
| 105 | + :group 'ffmpeg-player) |
| 106 | + |
| 107 | +(defcustom ffmpeg-player-after-insert-string-hook nil |
| 108 | + "Hook called after inserting string." |
| 109 | + :type 'hook |
| 110 | + :group 'ffmpeg-player) |
| 111 | + |
92 | 112 | (defconst ffmpeg-player--command-video-to-images |
93 | 113 | "ffmpeg -i \"%s\" %s \"%s%s%s.%s\"" |
94 | 114 | "Command that convert video to image source.") |
@@ -442,15 +462,19 @@ Information about first frame timer please see variable `ffmpeg-player--first-fr |
442 | 462 | (ffmpeg-player--clean-up) |
443 | 463 | (with-current-buffer ffmpeg-player--buffer |
444 | 464 | (erase-buffer) |
445 | | - (insert-image-file path)))) |
| 465 | + (run-hooks 'ffmpeg-player-before-insert-image-hook) |
| 466 | + (insert-image-file path) |
| 467 | + (run-hooks 'ffmpeg-player-after-insert-image-hook)))) |
446 | 468 |
|
447 | 469 | (defun ffmpeg-player--update-frame-by-string (str) |
448 | 470 | "Update the frame by STR." |
449 | 471 | (if (not (ffmpeg-player--buffer-alive-p)) |
450 | 472 | (ffmpeg-player--clean-up) |
451 | 473 | (with-current-buffer ffmpeg-player--buffer |
452 | 474 | (erase-buffer) |
453 | | - (insert str)))) |
| 475 | + (run-hooks 'ffmpeg-player-before-insert-string-hook) |
| 476 | + (insert str) |
| 477 | + (run-hooks 'ffmpeg-player-after-insert-string-hook)))) |
454 | 478 |
|
455 | 479 | (defun ffmpeg-player--update-frame-index () |
456 | 480 | "Calculate then update the frame index by time." |
|
0 commit comments