Fixes the following warning:
../mumble_plugin_utils.h:33:13: error: 'void escape(char*, size_t)' defined but not used [-Werror=unused-function]
static void escape(char *str, size_t size) {
^
It appeared after bb248cc, due to "ut99.cpp" not using escape().
This commit also:
- Changes the "size" argument so that it is passed as reference.
- Indents the function using tabs.
By default QTime uses the 24-hour time format when converting to a string.
This commit adds a setting (a checkbox) which allows users to toggle the format.
The setting only applies for new messages, the already shown ones will retain the previous time format.
Qt 4 used a different implementation because QDnsLookup was introduced in Qt 5.
Unlike the complete implementation, the Qt 4 compatible one only supported simple lookups (e.g. hostname -> IP address).
Mumble.com kindly reported that the getRegistration() Ice method fails with an "enumerator out of range" error, due to a missing value in the "UserInfo" enum.
The value was added to Murmur in 813aceb854 and then renamed and moved in 5131d9e303.
Some users were encountering issues such as the client taking ~8 seconds to start when "jackd" could not be run, due to the library attempting many times to connect to the JACK server (https://bugs.debian.org/941455).
While working on a fix I corrected the many warnings emitted by Clang-Tidy and I realized that there were many things that could be improved.
This commit almost entirely rewrites the implementation, but here are some of the changes:
- Mutexes are used everywhere, race conditions should not be possible anymore.
- The JACK client is not opened until it's required (i.e. "JackAudioInput" and/or "JackAudioOutput" start running). The initialization code has been moved to a dedicated function, the constructor doesn't execute it anymore. This is what fixes the issue mentioned above.
- The JACK client is deactivated and closed automatically when both "JackAudioInput" and "JackAudioOutput" are not running.
- Code specific to audio input or audio output has been moved from "JackAudioSystem" to the corresponding section ("JackAudioInput" or "JackAudioOutput").
- Some variables in "JackAudioSystem" have been replaced with functions which retrieve the corresponding value from the JACK server.
- Removed all instances of "delete", raw pointers have been replaced with "std::unique_ptr<>()".
- Replaced "NULL" with "nullptr".
This commit fixes a warning encountered today on FreeBSD, probably because Clang was updated and now `-Wdangling-else` is enabled by default.
Messages.cpp:1330:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
foreach(int id, pg->members()) {
^
I just had a FreeBSD build fail because AudioStats.cpp is using QPalette::Background, which apparently has been declared deprecated.
AudioStats.cpp:213:45: error: 'Background' is deprecated: Use QPalette::Window instead [-Werror,-Wdeprecated-declarations]
paint.fillRect(rect(), pal.color(QPalette::Background));
^
The Qt docs advise to use QPalette::Window instead (see https://doc.qt.io/qt-5/qpalette.html), so I went ahead and changed the code accordingly.
This commit fixes a warning encountered today on FreeBSD, probably because Clang was updated and now '-Wdangling-else' is enabled by default.
ConnectDialog.cpp:1178:3: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
foreach(ServerItem *si, qlItems)
^
The suggestion to use DirectSound was valid only for Windows versions prior to Vista, because WASAPI was introduced with it.
Fortunately DirectSound didn't appear in the UI as an option in case WASAPI was detected, hopefully we didn't mislead users into thinking that DirectSound is better than WASAPI.
Also, the description was suggesting to use DirectSound on non-Windows operating systems.
DirectSound was the first audio backend supported by Mumble, in 2005.
Windows Vista introduced a brand new audio stack called WASAPI, which entirely replaced DirectSound. Support for it was added in 9a018148bb, 6bef650e57 and 677a39951f.
This commit entirely removes our DirectSound implementation, not needed anymore because we are dropping support for Windows XP in 1.4.