Commit graph

5087 commits

Author SHA1 Message Date
Abs62 11ca5e63d6 Add ".webm" extension to known video types 2018-04-01 16:18:11 +03:00
Abs62 03bbe01b79 Fix warnings while compile with FFMpeg 3.4.2 (issue #978) 2018-03-30 23:05:22 +03:00
Abs62 bd48045aa9
Merge pull request #987 from vedgy/qt-multimedia-audio-player
Add Qt Multimedia audio player back end (Qt5 only)
2018-03-30 19:45:29 +03:00
Igor Kushnir 9aa3c44d4e Add QMediaPlayer internal player back end (Qt5 only)
* add config and GUI support for internal player back end switching;
* make FFmpeg player disabling option consistent with other similar
  qmake options by using CONFIG;
* add a new qmake option that disables Qt Multimedia player. This is
  useful for GNU/Linux distributions where Qt WebKit and Qt Multimedia
  packages depend on different GStreamer versions and don't work
  correctly when combined in one application.

The existing FFmpeg+libao internal player back end has a relatively
low-level implementation, which is difficult to understand and improve.
There are at least 3 open internal player issues:
  1) many GNU/Linux users have to edit their libao configuration file to
     make Goldendict's internal player work (issue #412);
  2) libao's pulseaudio plugin does not support 32-bit audio, which
     means that many MediaWiki pronunciations don't work with the most
     popular GNU/Linux audio driver (issue #949);
  3) Ffmpeg::DecoderContext uses deprecated FFmpeg APIs, which causes
     compiler warnings and means that this internal player back end
     may not compile with a future FFmpeg library version (issue #978).

The Qt Multimedia back end implementation uses the highest-level
Qt audio API and is very simple.
This new back end works flawlessly on my GNU/Linux machine.
I'm not making it the default back end because I don't know how well
it will work on other platforms with different configurations.
2018-03-30 17:10:33 +03:00
Igor Kushnir d5998cabb7 Remove redundant option useExternalPlayer from Preferences
This change substantially reduces audio player configuration code
complexity. The single remaining bool option - useInternalPlayer -
is enough for the binary audio player implementation choice.

Removing the useExternalPlayer option doesn't change the application GUI
behavior except for minor differences in one or two corner cases, which
could be classified as bugs fixed by this commit. For example, before
this commit, if the configuration file contained the following lines
  <useExternalPlayer>0</useExternalPlayer>
  <useInternalPlayer>0</useInternalPlayer>
an external player would be actually used for audio playback, but
neither of the two audio radio buttons would be checked in
Preferences GUI, and audioPlaybackProgram line edit would be disabled.
Whereas, after this commit, an external player is still used for
audio playback, but useExternalPlayer radio button is checked
in Preferences GUI, and the audioPlaybackProgram line edit is enabled.
2018-03-30 17:03:45 +03:00
Abs62 6a77c23986 Implement "inactive dictionaries" feature for all groups (issue #984) 2018-03-28 17:21:32 +03:00
Abs62 d65a1f7869 Save popup window configuration without it destroying 2018-03-27 21:23:48 +03:00
Abs62 2ff7e4e6d0 Refactor quit/end-of-session handling 2018-03-27 17:46:03 +03:00
Abs62 5552c18a39 Remove mention of qt4x5 git branch from readme.md 2018-03-26 17:37:00 +03:00
Abs62 3cf4561802 Save Favorites inside commitData() 2018-03-26 17:35:49 +03:00
Abs62 c5b8102cf5
Merge pull request #983 from vedgy/overhaul-audio-player
Overhaul audio player
2018-03-26 17:33:49 +03:00
Abs62 655d2456c0
Merge pull request #981 from vedgy/fix-ub-in-gestures
Don't static_cast to a wrong type in Gestures
2018-03-26 17:33:21 +03:00
Igor Kushnir 278e05cbf3 Run a single external audio player process at a time
External and internal audio players work similarly now. Fixes #950.

* inherit a new ExternalAudioPlayer class from AudioPlayerInterface;
* use an existing ExternalViewer class to implement ExternalAudioPlayer;
* take (const char *, int) instead of std::vector<char> in
  ExternalViewer constructor to fit into AudioPlayerInterface;
* extend ExternalViewer API to let ExternalAudioPlayer stop superseded
  audio player processes;
* make AudioPlayerInterface::play() return an error message string to
  allow reporting immediate failures from derived classes;
* Document AudioPlayerInterface API;
* Document AudioPlayerFactory::player();
* use the common audio interface exclusively in ArticleView.
2018-03-24 21:34:06 +02:00
Igor Kushnir e5045860ef Make adding new audio player implementations easy
* add a new interface class AudioPlayerInterface;
* inherit a new proxy class Ffmpeg::AudioPlayer from it;
* partially switch ArlticleView to using the interface;
* expose MainWindow's AudioPlayerInterface instance to all ArticleView
  instances;
* add a new AudioPlayerFactory class responsible for creating instances
  of concrete classes derived from AudioPlayerInterface depending on
  relevant Config::Preferences values;
* increase minimum supported Qt version from 4.5 to 4.6 in README
  in order to use QScopedPointer introduced in Qt 4.6.
2018-03-24 21:31:48 +02:00
Igor Kushnir 2e25be8f71 Eliminate redundant casts to/from void* in Ffmpeg player 2018-03-24 20:16:50 +02:00
Igor Kushnir 6e9c79f67b Don't static_cast to a wrong type in Gestures
The result of a downcast to a wrong dynamic type is undefined according
to the C++ standard.

Wrong casts were detected at goldendict start by GCC's
-fsanitize=undefined option. This commit fixes #974.
2018-03-24 18:03:10 +02:00
Abs62 bd95948264 Fix potential error in dictzip.c (issue #978) 2018-03-23 20:40:54 +03:00
Abs62 dd0464b9d5 Hunspell: Strip comments while search base form of word 2018-03-23 16:08:33 +03:00
Abs62 0e22d06f97
Merge pull request #977 from kyleskimo/patch-3
Update zh_TW.ts
2018-03-23 16:02:45 +03:00
kyleskimo 22f0e6ff77
Update zh_TW.ts
Update translation.
2018-03-23 14:24:29 +08:00
Abs62 4ec525d67d Fix typos 2018-03-21 22:15:22 +03:00
Abs62 1dc4c24966 DSL: Warnings about unknown and unfinished tags 2018-03-19 17:44:12 +03:00
Abs62 ad705bd01e Fix isNameOf...() functions for case of string contains whitespaces only 2018-03-19 17:42:30 +03:00
Abs62 9468f266f5 Increase limit of node elements while build index 2018-03-13 22:25:17 +03:00
Abs62 e89df78ecb A little optimization of read data from network 2018-03-12 20:22:38 +03:00
Abs62 cbdd6bfe5a Qt5: Fix some potential issues after using QRegularExpression instead of QRegExp 2018-03-12 00:06:09 +03:00
Abs62 357638b033 Wiki: Fix handling of url's without urls scheme 2018-03-11 16:33:17 +03:00
Abs62 f2294ec3b6 Wiki: Fix parsing of "audio" tags (issue #967) 2018-03-11 16:08:37 +03:00
Abs62 5409cdf2c9 DSL: Fix expand tildes for headwords with stress tag while full-text search 2018-03-09 23:43:15 +03:00
Abs62 b2169a3183 DSL: Expand tildes while full-text search 2018-03-09 18:47:11 +03:00
Abs62 99a4e00b65 Full-text search: Fix find headwords by unsorted offsets 2018-03-09 02:16:15 +03:00
Abs62 b30dc0f1a5 Zim: Fix threads synchronization while full-text indexing 2018-03-08 16:32:05 +03:00
Abs62 d3d978e7c9 Zim: More fast interrupt of full-text search 2018-03-08 11:46:19 +03:00
Abs62 a563311b61 Unify buffer size for lzma2 decompressor 2018-03-08 11:34:07 +03:00
Abs62 1e85a18662 Full-test search: Use dictionary-specific articles sorting while search 2018-03-08 00:23:01 +03:00
Abs62 3deb5ee266 Zim: Sort articles by cluster number while full-text indexing 2018-03-07 23:32:20 +03:00
Abs62 6d03661b70 Stardict: Add class for "h3" headwords tags 2018-03-07 17:01:16 +03:00
Abs62 69650fff43 Zim: Add some caching for multi-elements clusters 2018-03-07 17:00:43 +03:00
Abs62 2def5f120d Mac-specific: Update lzma library to version 5.2.3 2018-03-06 18:31:53 +03:00
Abs62 ba145fac47 Win-specific: Update lzma library to version 5.2.3 2018-03-06 18:31:03 +03:00
Abs62 d56f3835dc Full-text search: A little code optimization 2018-03-06 18:29:49 +03:00
Abs62 76c862a773 Fix typo 2018-03-01 19:02:50 +03:00
Abs62 7b4e5a2ff7 Full-text search: A little optimization for memory allocation 2018-03-01 18:44:11 +03:00
Abs62 81e8fe7e20 Full-text search: More fast interrupt of search 2018-03-01 18:06:48 +03:00
Abs62 57508c0a5c Slob: Fix threads synchronization while full-text indexing 2018-02-28 21:15:29 +03:00
Abs62 9465fcefb5 DSL: Fix full-text indexing for case of unsorted parts in headword 2018-02-28 17:18:08 +03:00
Abs62 cfd74be181 Qt5: Fix handling of "audio" tag in GLS format 2018-02-28 17:17:10 +03:00
Abs62 cbdad22f2d Qt5: Some optimizations for QRegularExpression 2018-02-28 17:15:27 +03:00
Abs62 fe39fc8a05 Qt5: More QRegularExpression instead of QRegExp 2018-02-27 20:18:35 +03:00
Abs62 03db65a4c6 Fix comments stripping while CSS isolation 2018-02-26 17:33:55 +03:00