Commit Graph

134 Commits

Author SHA1 Message Date
Damien Elmes
be3393fcb4 simplify taskman, and add .run_on_main() 2020-01-22 14:09:51 +10:00
Damien Elmes
8236f800ae add pause and seek forward/back shortcuts to review screen 2020-01-22 12:50:33 +10:00
Damien Elmes
d54f719558 add a webview_did_receive_js_message hook 2020-01-22 11:06:12 +10:00
Damien Elmes
a5db36e208 add optional result_callback arg to pycmd() definition 2020-01-22 10:28:45 +10:00
Damien Elmes
b870abd2d4 include card ordinal in clayout 2020-01-22 10:28:10 +10:00
Damien Elmes
f92bb55c25 add option in prefs to hide replay audio buttons 2020-01-21 21:00:17 +10:00
Damien Elmes
fd95336933 mypy fixes 2020-01-21 20:42:06 +10:00
Damien Elmes
19b3a15146 formatting fixes 2020-01-21 20:39:25 +10:00
Damien Elmes
37d2a4d43c add a helper for caching generated files 2020-01-21 20:35:23 +10:00
Damien Elmes
b00a9010be when matching voices, need to check language matches too 2020-01-21 20:35:00 +10:00
Damien Elmes
ccd7150136 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
5351a5f396 compare only on rank, as voices may be subclassed 2020-01-21 18:33:14 +10:00
Damien Elmes
84711f8fe2 add Windows TTS support 2020-01-21 17:34:47 +10:00
Damien Elmes
7b3d701ad5 add replay buttons to reviewing screen 2020-01-21 14:47:03 +10:00
Damien Elmes
7504ef6857 make sure we don't mutate list passed to play_from_tags() 2020-01-21 14:43:33 +10:00
Damien Elmes
98802c9c9a deal with spaces in macOS voices like "Bad News" 2020-01-21 13:38:37 +10:00
Damien Elmes
2ac86ac400 add file-based TTS say implementation as well 2020-01-21 13:21:43 +10:00
Damien Elmes
c713683f63 add rank handling to TTS; parse TTS args in get_av_tags() 2020-01-21 12:41:37 +10:00
Damien Elmes
66e277e44b 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
d4d16d35a8 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
01f3fd06d6 support interrupting say; fix race in simple player 2020-01-21 07:28:19 +10:00
Damien Elmes
1beae4f858 pass task manager in instead of creating a new one 2020-01-21 06:49:09 +10:00
Damien Elmes
0b5e22253b add .stop() to mpv 2020-01-21 06:45:32 +10:00
Damien Elmes
a6e6ffae06 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
d9c240afa2 minor tidyup to sound.py 2020-01-20 21:03:22 +10:00
Damien Elmes
7900f68051 don't need allSounds/stripSounds in qt's sound.py 2020-01-20 20:13:01 +10:00
Damien Elmes
02ec3f149c update qt/ to use the new API 2020-01-20 20:10:38 +10:00
Damien Elmes
caac4527e9 add a proof of concept TTS implementation on Mac 2020-01-20 20:08:19 +10:00
Damien Elmes
707ac587ec 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
5084438a0b we can depend on pyaudio being available now that the code is in qt/ 2020-01-20 19:21:24 +10:00
Damien Elmes
c9a4626807 update translations 2020-01-19 16:58:34 +10:00
Damien Elmes
b6ed84998d fix download log newlines 2020-01-19 16:46:24 +10:00
Damien Elmes
02145c7078 fix <br> remaining when image attached to empty field 2020-01-19 16:41:39 +10:00
Damien Elmes
5260e10f8f 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
Damien Elmes
766321d746 avoid setting provided_name if not in the json 2020-01-19 14:10:48 +10:00
Damien Elmes
5d9661cee5 update add-ons even if they're disabled
If a user enables an old add-on and restarts immediately, it won't have
had a chance to update, and may raise errors that could have been
prevented if the user was running the latest version.
2020-01-19 14:04:57 +10:00
Damien Elmes
6fe6a9e597 send point version when downloading
AnkiWeb will return a 404 if add-on does not support that version
2020-01-19 13:43:16 +10:00
Damien Elmes
66714260a3 automatically disable add-ons that have been marked as incompatible 2020-01-19 13:37:55 +10:00
Damien Elmes
a619130e5e add write_addon_meta(); use methods for derived values 2020-01-19 13:06:53 +10:00
Damien Elmes
54ca4efb8e use an object for add-on metadata instead of reading the dict directly
also, sort disabled add-ons to the end
2020-01-19 12:44:53 +10:00
Damien Elmes
ef8bb61fc3 AnkiRequestsClient -> HttpClient 2020-01-19 11:33:27 +10:00
Damien Elmes
09e47fbc36 check for add-on updates once a day 2020-01-19 11:31:09 +10:00
Damien Elmes
6134ae9ec6 refactor add-on downloading/installing/updating
- web requests done on a background thread
- easier to use outside of the addon dialog
- gets max point version info from AnkiWeb, which we can use in
the future
2020-01-19 10:37:15 +10:00
Damien Elmes
49bba16f24 fix display errors on macOS after updating add-ons 2020-01-19 10:33:51 +10:00
Damien Elmes
a47db0d609 add helper for background execution 2020-01-19 10:06:01 +10:00
Damien Elmes
3287e8c057 pass in a progress callback instead of http_data_did_[send|receive]
If a request is happening on a background thread, the GUI code
receiving requests on that thread can lead to a crash

Add-on downloading still to do.
2020-01-18 17:49:59 +10:00
Damien Elmes
0d1a25eb5b move AnkiRequestsClient into its own file
It should still be accessible via anki.sync as well.
2020-01-18 15:45:14 +10:00
Damien Elmes
fa56477205 remove template/ from i18n 2020-01-17 11:14:54 +10:00
Damien Elmes
7c1dc475b5 update translations 2020-01-17 11:09:24 +10:00
Damien Elmes
d3cc63efb0 move types.py into the files responsible for each type 2020-01-17 10:17:33 +10:00