Commit graph

2899 commits

Author SHA1 Message Date
Damien Elmes
1fa162c6b5 move css files to scss 2020-01-23 17:27:07 +10:00
Damien Elmes
bc3d8bb7ec Merge pull request #425 from yhoiseth/msgfmt-command-not-found
Prevent "msgfmt: command not found" error
2020-01-23 17:23:21 +10:00
Damien Elmes
bafebe9d70 Merge pull request #426 from yhoiseth/remote-server-run-types
RemoteServer._run type hints
2020-01-23 17:22:58 +10:00
Yngve Høiseth
288f5e718c Add missing contributor 2020-01-22 23:34:14 +01:00
Yngve Høiseth
4f5537f358 Type hint RemoteServer._run 2020-01-22 23:33:37 +01:00
Yngve Høiseth
20aa8bb991 Add missing contributor 2020-01-22 23:10:27 +01:00
Yngve Høiseth
8966c17e76 Prevent "msgfmt: command not found" error 2020-01-22 22:53:06 +01:00
Damien Elmes
e3940b4e4f handle spaces in voices, add platform prefix 2020-01-22 17:50:08 +10:00
Damien Elmes
f987310a50 move ignore statements for python 3.7
sigh :-(

https://github.com/python/mypy/issues/3251#issuecomment-490298556
2020-01-22 16:54:18 +10:00
Damien Elmes
7fefe7ec43 fix pylib checks failing when aqt unavailable 2020-01-22 16:11:40 +10:00
Damien Elmes
214871c7a4 make pylint happy 2020-01-22 15:37:58 +10:00
Damien Elmes
712779886a add a hook for when playback begins 2020-01-22 14:41:32 +10:00
Damien Elmes
42c04817c7 make .command() behave the same way for mplayer and mpv 2020-01-22 14:11:25 +10:00
Damien Elmes
bfc0ac1c0f simplify taskman, and add .run_on_main() 2020-01-22 14:09:51 +10:00
Damien Elmes
cd4d4b8adb add pause and seek forward/back shortcuts to review screen 2020-01-22 12:50:33 +10:00
Damien Elmes
4f9c9e1770 add a webview_did_receive_js_message hook 2020-01-22 11:06:12 +10:00
Damien Elmes
5aae3e2e39 add optional result_callback arg to pycmd() definition 2020-01-22 10:28:45 +10:00
Damien Elmes
c1021bc046 include card ordinal in clayout 2020-01-22 10:28:10 +10:00
Damien Elmes
837ac57ab2 add option in prefs to hide replay audio buttons 2020-01-21 21:00:17 +10:00
Damien Elmes
2b9a74fe5c mypy fixes 2020-01-21 20:42:06 +10:00
Damien Elmes
52a41d9a8e formatting fixes 2020-01-21 20:39:25 +10:00
Damien Elmes
27b14aea3e add a helper for caching generated files 2020-01-21 20:35:23 +10:00
Damien Elmes
5b7699563f when matching voices, need to check language matches too 2020-01-21 20:35:00 +10:00
Damien Elmes
0df9837a66 fix mpv args
https://anki.tenderapp.com/discussions/ankidesktop/38186-mpvprocesserror-unable-to-start-process
2020-01-21 19:29:50 +10:00
Damien Elmes
e326236f7c compare only on rank, as voices may be subclassed 2020-01-21 18:33:14 +10:00
Damien Elmes
8ddb49eb76 add Windows TTS support 2020-01-21 17:34:47 +10:00
Damien Elmes
171764e3e0 add replay buttons to reviewing screen 2020-01-21 14:47:03 +10:00
Damien Elmes
2ee8902bd9 added flag_av_tags() for replay button support 2020-01-21 14:44:27 +10:00
Damien Elmes
6d1d806b3a make sure we don't mutate list passed to play_from_tags() 2020-01-21 14:43:33 +10:00
Damien Elmes
202dc608a3 deal with spaces in macOS voices like "Bad News" 2020-01-21 13:38:37 +10:00
Damien Elmes
9dc9151963 add file-based TTS say implementation as well 2020-01-21 13:21:43 +10:00
Damien Elmes
b0d2958721 add rank handling to TTS; parse TTS args in get_av_tags() 2020-01-21 12:41:37 +10:00
Damien Elmes
a85ad8b257 more TTS and sound work
- use provided language and voices when playing on Mac
- fix hang in waiting for termination
- allow players to return a rank for a given tag,
which will allow for the best matching player to be chosen
depending on the context (eg, prioritize one player for videos,
one tts player for certain voices, etc)
2020-01-21 11:34:25 +10:00
Damien Elmes
222ecc35ce spawn a new slave mode mplayer for each file
This solves a few problems:

- We no longer need to write temporary files to disk, as files
passed on the command line with non-Latin text can be read by mplayer.
- We no longer need to deal with mplayer processes left around in
the background that have failed to terminate.
- We don't need to deal with the added complexity that comes with
polling mplayer's status output to determine when the file has finished
playing.

Also add seek_relative(), toggle_pause() and shutdown() as optional
methods on AVPlayer.
2020-01-21 08:55:15 +10:00
Damien Elmes
8b1d029eb9 support interrupting say; fix race in simple player 2020-01-21 07:28:19 +10:00
Damien Elmes
f9ca9501ac pass task manager in instead of creating a new one 2020-01-21 06:49:09 +10:00
Damien Elmes
41272674d8 add .stop() to mpv 2020-01-21 06:45:32 +10:00
Damien Elmes
7bf4c9f08f get mpv slave mode working with new API
Also move the mpv-specific hooks into AVPlayer
2020-01-20 22:01:38 +10:00
Damien Elmes
8a09d1365e minor tidyup to sound.py 2020-01-20 21:03:22 +10:00
Damien Elmes
3a427ba5b1 don't need allSounds/stripSounds in qt's sound.py 2020-01-20 20:13:01 +10:00
Damien Elmes
263a04c887 update qt/ to use the new API 2020-01-20 20:10:38 +10:00
Damien Elmes
4d3858023b add a proof of concept TTS implementation on Mac 2020-01-20 20:08:19 +10:00
Damien Elmes
b5758c2cff rework the audio player API and add a simpler player implementation
- the new API operates on AVTags so it can support TTS as well as
audio files
- added a simple "run for each file" implementation for mpv and mplayer.
- will need to test handling of unicode filenames on Windows
- the old mpv and mplayer code is currently not active
2020-01-20 20:07:11 +10:00
Damien Elmes
71fe9a015a we can depend on pyaudio being available now that the code is in qt/ 2020-01-20 19:21:24 +10:00
Damien Elmes
548ed31ef7 add a simple TTS field filter
This simply wraps the field in extra text that the frontend will
deal with. Also added some helpers for extracting and stripping
audio and TTS tags from the rendered text.
2020-01-20 19:16:24 +10:00
Damien Elmes
4a19600465 hasSound not used by anki code or add-ons 2020-01-20 09:31:28 +10:00
Damien Elmes
ca46e01ffc update translations 2020-01-19 16:58:34 +10:00
Damien Elmes
81684ecf52 fix download log newlines 2020-01-19 16:46:24 +10:00
Damien Elmes
8dfd3e93f8 fix <br> remaining when image attached to empty field 2020-01-19 16:41:39 +10:00
Damien Elmes
168cd54827 leave percent-escaped text from the editor alone
Originally added in d7339d9a27b8abd65fbcf85f809fb0089046986f;
unfortunately the change message does not describe why. Images
are handled separately, so it should theoretically not be required,
and keeping it in leads to garbled text when people include %
on their cards.

Latest report at https://anki.tenderapp.com/discussions/ankidesktop/38138-errors-in-conversion-of-latex-and-ea
2020-01-19 16:29:46 +10:00