diff --git a/Linphone/core/conference/ConferenceInfoList.hpp b/Linphone/core/conference/ConferenceInfoList.hpp index 5dd10ef57..48f57d26f 100644 --- a/Linphone/core/conference/ConferenceInfoList.hpp +++ b/Linphone/core/conference/ConferenceInfoList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/conference/ConferenceInfoProxy.cpp b/Linphone/core/conference/ConferenceInfoProxy.cpp index 001bc7792..0563fc932 100644 --- a/Linphone/core/conference/ConferenceInfoProxy.cpp +++ b/Linphone/core/conference/ConferenceInfoProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/participant/ParticipantInfoList.cpp b/Linphone/core/participant/ParticipantInfoList.cpp index e836deda2..fbb4703ec 100644 --- a/Linphone/core/participant/ParticipantInfoList.cpp +++ b/Linphone/core/participant/ParticipantInfoList.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -57,8 +57,9 @@ void ParticipantInfoList::setChatCore(const QSharedPointer &chatCore) QStringList participantAddresses; QList> participantList; auto participants = mChatCore->getParticipants(); - resetData(); - for(auto p: participants) add(p); + resetData(); + for (auto p : participants) + add(p); }; connect(mChatCore.get(), &ChatCore::participantsChanged, this, buildList); buildList(); diff --git a/Linphone/core/participant/ParticipantInfoList.hpp b/Linphone/core/participant/ParticipantInfoList.hpp index b77609151..c198a57b8 100644 --- a/Linphone/core/participant/ParticipantInfoList.hpp +++ b/Linphone/core/participant/ParticipantInfoList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/participant/ParticipantInfoProxy.cpp b/Linphone/core/participant/ParticipantInfoProxy.cpp index 926ec1cdc..1428b19c9 100644 --- a/Linphone/core/participant/ParticipantInfoProxy.cpp +++ b/Linphone/core/participant/ParticipantInfoProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/participant/ParticipantList.cpp b/Linphone/core/participant/ParticipantList.cpp index 9f8c349ba..b7ba208aa 100644 --- a/Linphone/core/participant/ParticipantList.cpp +++ b/Linphone/core/participant/ParticipantList.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/participant/ParticipantList.hpp b/Linphone/core/participant/ParticipantList.hpp index b75f19996..bb469ebad 100644 --- a/Linphone/core/participant/ParticipantList.hpp +++ b/Linphone/core/participant/ParticipantList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/participant/ParticipantProxy.cpp b/Linphone/core/participant/ParticipantProxy.cpp index 1fec44141..48629a232 100644 --- a/Linphone/core/participant/ParticipantProxy.cpp +++ b/Linphone/core/participant/ParticipantProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/sound-player/SoundPlayerCore.cpp b/Linphone/core/sound-player/SoundPlayerCore.cpp index c1d0cf9be..8c5f485ce 100644 --- a/Linphone/core/sound-player/SoundPlayerCore.cpp +++ b/Linphone/core/sound-player/SoundPlayerCore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/sound-player/SoundPlayerCore.hpp b/Linphone/core/sound-player/SoundPlayerCore.hpp index 19abaed63..dbf02c1fe 100644 --- a/Linphone/core/sound-player/SoundPlayerCore.hpp +++ b/Linphone/core/sound-player/SoundPlayerCore.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/core/translator/DefaultTranslatorCore.cpp b/Linphone/core/translator/DefaultTranslatorCore.cpp index dbd695561..408fdbd62 100644 --- a/Linphone/core/translator/DefaultTranslatorCore.cpp +++ b/Linphone/core/translator/DefaultTranslatorCore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -25,46 +25,40 @@ // ============================================================================= -DefaultTranslatorCore::DefaultTranslatorCore (QObject *parent) : QTranslator(parent) { - QDirIterator it(":", QDirIterator::Subdirectories); - while (it.hasNext()) { - QFileInfo info(it.next()); +DefaultTranslatorCore::DefaultTranslatorCore(QObject *parent) : QTranslator(parent) { + QDirIterator it(":", QDirIterator::Subdirectories); + while (it.hasNext()) { + QFileInfo info(it.next()); - if (info.suffix() == QLatin1String("qml")) { - QString dir = info.absoluteDir().absolutePath(); + if (info.suffix() == QLatin1String("qml")) { + QString dir = info.absoluteDir().absolutePath(); - // Ignore extra selectors. - // TODO: Remove 5.9 support in July 2019. - for (const auto &selector : { "+linux", "+mac", "+windows", "+custom", "+5.9" }) - if (dir.contains(selector)) - goto end; + // Ignore extra selectors. + // TODO: Remove 5.9 support in July 2019. + for (const auto &selector : {"+linux", "+mac", "+windows", "+custom", "+5.9"}) + if (dir.contains(selector)) goto end; - // Ignore default imports. - if (dir.startsWith(":/QtQuick")) - continue; + // Ignore default imports. + if (dir.startsWith(":/QtQuick")) continue; - QString basename = info.baseName(); - if (!mContexts.contains(basename)) - mContexts << basename; - } - end:; - } + QString basename = info.baseName(); + if (!mContexts.contains(basename)) mContexts << basename; + } + end:; + } } -QString DefaultTranslatorCore::translate ( - const char *context, - const char *sourceText, - const char *disambiguation, - int n -) const { - if (!context) - return QString(""); +QString +DefaultTranslatorCore::translate(const char *context, const char *sourceText, const char *disambiguation, int n) const { + if (!context) return QString(""); - QString translation = QTranslator::translate(context, sourceText, disambiguation, n); + QString translation = QTranslator::translate(context, sourceText, disambiguation, n); - if (translation.length() == 0 && mContexts.contains(context)) - qDebug() << QStringLiteral("Unable to find a translation. (context=%1, label=%2, disambiguation=%3)") - .arg(context).arg(sourceText).arg(disambiguation); + if (translation.length() == 0 && mContexts.contains(context)) + qDebug() << QStringLiteral("Unable to find a translation. (context=%1, label=%2, disambiguation=%3)") + .arg(context) + .arg(sourceText) + .arg(disambiguation); - return translation; + return translation; } diff --git a/Linphone/core/translator/DefaultTranslatorCore.hpp b/Linphone/core/translator/DefaultTranslatorCore.hpp index 6718bce3c..f69b1bd73 100644 --- a/Linphone/core/translator/DefaultTranslatorCore.hpp +++ b/Linphone/core/translator/DefaultTranslatorCore.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -28,22 +28,20 @@ class DefaultTranslatorCore : public QTranslator { public: - DefaultTranslatorCore (QObject *parent = Q_NULLPTR); + DefaultTranslatorCore(QObject *parent = Q_NULLPTR); - QString translate ( - const char *context, - const char *sourceText, - const char *disambiguation = Q_NULLPTR, - int n = -1 - ) const override; + QString translate(const char *context, + const char *sourceText, + const char *disambiguation = Q_NULLPTR, + int n = -1) const override; private: - QSet mContexts; + QSet mContexts; }; // Workaround for bad Application Menu translation on Mac: // Overwrite Qt source by our translations : -//static const char *application_menu_strings[] = +// static const char *application_menu_strings[] = //{ // QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","About %1"), // QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Preferences…"), @@ -54,10 +52,11 @@ private: // QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Quit %1") //}; -//class MAC_APPLICATION_MENU : public QObject{ +// class MAC_APPLICATION_MENU : public QObject{ // QString forcedTranslation(){ -// return tr("About %1") + tr("Preferences…") + tr("Services") + tr("Hide %1") + tr("Hide Others") + tr("Show All") + tr("Quit %1"); +// return tr("About %1") + tr("Preferences…") + tr("Services") + tr("Hide %1") + tr("Hide Others") + tr("Show All") + +//tr("Quit %1"); // } -//}; +// }; #endif // DEFAULT_TRANSLATOR_CORE_H_ diff --git a/Linphone/model/setting/MediastreamerUtils.cpp b/Linphone/model/setting/MediastreamerUtils.cpp index fe6c8f721..30fd902d6 100644 --- a/Linphone/model/setting/MediastreamerUtils.cpp +++ b/Linphone/model/setting/MediastreamerUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -18,62 +18,58 @@ * along with this program. If not, see . */ +#include "MediastreamerUtils.hpp" #include -#include #include #include +#include #include -#include "MediastreamerUtils.hpp" #include using namespace MediastreamerUtils; SimpleCaptureGraph::SimpleCaptureGraph(const std::string &capture, const std::string &playback) - : captureCardId(capture), playbackCardId(playback) -{ + : captureCardId(capture), playbackCardId(playback) { LinphoneCore *ccore = CoreModel::getInstance()->getCore()->cPtr(); msFactory = linphone_core_get_ms_factory(ccore); playbackCard = ms_snd_card_manager_get_card(ms_factory_get_snd_card_manager(msFactory), playbackCardId.c_str()); - if (!playbackCard) - qWarning("Cannot get playback card from MSFactory with : %s", playbackCardId.c_str()); + if (!playbackCard) qWarning("Cannot get playback card from MSFactory with : %s", playbackCardId.c_str()); captureCard = ms_snd_card_manager_get_card(ms_factory_get_snd_card_manager(msFactory), captureCardId.c_str()); - if (!captureCard) - qWarning("Cannot get capture card from MSFactory with : %s", captureCardId.c_str()); + if (!captureCard) qWarning("Cannot get capture card from MSFactory with : %s", captureCardId.c_str()); - if(playbackCard && captureCard)// Assure to initialize when playback and capture are available + if (playbackCard && captureCard) // Assure to initialize when playback and capture are available init(); } -SimpleCaptureGraph::~SimpleCaptureGraph() -{ +SimpleCaptureGraph::~SimpleCaptureGraph() { destroy(); } static void device_notify_cb(void *user_data, MSFilter *f, unsigned int event, void *eventdata) { if (event == MS_FILTER_OUTPUT_FMT_CHANGED) { - SimpleCaptureGraph * graph = (SimpleCaptureGraph *)user_data; + SimpleCaptureGraph *graph = (SimpleCaptureGraph *)user_data; int captureRate, playbackRate, captureChannels, playbackChannels; - ms_filter_call_method(graph->audioCapture,MS_FILTER_GET_SAMPLE_RATE,&captureRate); - ms_filter_call_method(graph->audioSink,MS_FILTER_GET_SAMPLE_RATE,&playbackRate); - ms_filter_call_method(graph->audioCapture,MS_FILTER_GET_NCHANNELS,&captureChannels); - ms_filter_call_method(graph->audioSink,MS_FILTER_GET_NCHANNELS,&playbackChannels); - - ms_filter_call_method(graph->resamplerFilter,MS_FILTER_SET_SAMPLE_RATE,&captureRate); - ms_filter_call_method(graph->resamplerFilter,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&playbackRate); - ms_filter_call_method(graph->resamplerFilter,MS_FILTER_SET_NCHANNELS,&captureChannels); - ms_filter_call_method(graph->resamplerFilter,MS_FILTER_SET_OUTPUT_NCHANNELS,&playbackChannels); + ms_filter_call_method(graph->audioCapture, MS_FILTER_GET_SAMPLE_RATE, &captureRate); + ms_filter_call_method(graph->audioSink, MS_FILTER_GET_SAMPLE_RATE, &playbackRate); + ms_filter_call_method(graph->audioCapture, MS_FILTER_GET_NCHANNELS, &captureChannels); + ms_filter_call_method(graph->audioSink, MS_FILTER_GET_NCHANNELS, &playbackChannels); + + ms_filter_call_method(graph->resamplerFilter, MS_FILTER_SET_SAMPLE_RATE, &captureRate); + ms_filter_call_method(graph->resamplerFilter, MS_FILTER_SET_OUTPUT_SAMPLE_RATE, &playbackRate); + ms_filter_call_method(graph->resamplerFilter, MS_FILTER_SET_NCHANNELS, &captureChannels); + ms_filter_call_method(graph->resamplerFilter, MS_FILTER_SET_OUTPUT_NCHANNELS, &playbackChannels); } } void SimpleCaptureGraph::init() { if (!audioCapture) { audioCapture = ms_snd_card_create_reader(captureCard); - ms_filter_add_notify_callback(audioCapture, device_notify_cb,this,FALSE); + ms_filter_add_notify_callback(audioCapture, device_notify_cb, this, FALSE); } if (!audioSink) { audioSink = ms_snd_card_create_writer(playbackCard); - ms_filter_add_notify_callback(audioSink, device_notify_cb,this,FALSE); + ms_filter_add_notify_callback(audioSink, device_notify_cb, this, FALSE); } if (!captureVolumeFilter) { captureVolumeFilter = ms_factory_create_filter(msFactory, MS_VOLUME_ID); @@ -81,42 +77,39 @@ void SimpleCaptureGraph::init() { if (!playbackVolumeFilter) { playbackVolumeFilter = ms_factory_create_filter(msFactory, MS_VOLUME_ID); } - if(!resamplerFilter) - resamplerFilter = ms_factory_create_filter(msFactory, MS_RESAMPLE_ID); + if (!resamplerFilter) resamplerFilter = ms_factory_create_filter(msFactory, MS_RESAMPLE_ID); int captureRate, playbackRate, captureChannels, playbackChannels; - ms_filter_call_method(audioCapture,MS_FILTER_GET_SAMPLE_RATE,&captureRate); - ms_filter_call_method(audioSink,MS_FILTER_GET_SAMPLE_RATE,&playbackRate); - ms_filter_call_method(audioCapture,MS_FILTER_GET_NCHANNELS,&captureChannels); - ms_filter_call_method(audioSink,MS_FILTER_GET_NCHANNELS,&playbackChannels); - - ms_filter_call_method(resamplerFilter,MS_FILTER_SET_SAMPLE_RATE,&captureRate); - ms_filter_call_method(resamplerFilter,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&playbackRate); - ms_filter_call_method(resamplerFilter,MS_FILTER_SET_NCHANNELS,&captureChannels); - ms_filter_call_method(resamplerFilter,MS_FILTER_SET_OUTPUT_NCHANNELS,&playbackChannels); + ms_filter_call_method(audioCapture, MS_FILTER_GET_SAMPLE_RATE, &captureRate); + ms_filter_call_method(audioSink, MS_FILTER_GET_SAMPLE_RATE, &playbackRate); + ms_filter_call_method(audioCapture, MS_FILTER_GET_NCHANNELS, &captureChannels); + ms_filter_call_method(audioSink, MS_FILTER_GET_NCHANNELS, &playbackChannels); + + ms_filter_call_method(resamplerFilter, MS_FILTER_SET_SAMPLE_RATE, &captureRate); + ms_filter_call_method(resamplerFilter, MS_FILTER_SET_OUTPUT_SAMPLE_RATE, &playbackRate); + ms_filter_call_method(resamplerFilter, MS_FILTER_SET_NCHANNELS, &captureChannels); + ms_filter_call_method(resamplerFilter, MS_FILTER_SET_OUTPUT_NCHANNELS, &playbackChannels); ms_filter_link(audioCapture, 0, captureVolumeFilter, 0); ms_filter_link(captureVolumeFilter, 0, resamplerFilter, 0); ms_filter_link(resamplerFilter, 0, playbackVolumeFilter, 0); ms_filter_link(playbackVolumeFilter, 0, audioSink, 0); - //Mute playback + // Mute playback float muteGain = 0.0f; ms_filter_call_method(playbackVolumeFilter, static_cast(MS_VOLUME_SET_GAIN), &muteGain); ticker = ms_ticker_new(); running = false; - } void SimpleCaptureGraph::start() { if (!running && audioCapture) { running = true; ms_ticker_attach(ticker, audioCapture); - } } void SimpleCaptureGraph::stop() { - if (running && audioCapture){ + if (running && audioCapture) { ms_ticker_detach(ticker, audioCapture); running = false; } @@ -126,27 +119,18 @@ void SimpleCaptureGraph::destroy() { if (running) { stop(); } - - if (audioSink) - ms_filter_unlink(playbackVolumeFilter, 0, audioSink, 0); - if (captureVolumeFilter && resamplerFilter) - ms_filter_unlink(captureVolumeFilter, 0, resamplerFilter, 0); - if (resamplerFilter && playbackVolumeFilter) - ms_filter_unlink(resamplerFilter, 0, playbackVolumeFilter, 0); - if (audioCapture) - ms_filter_unlink(audioCapture, 0, captureVolumeFilter, 0); - if (playbackVolumeFilter) - ms_filter_destroy(playbackVolumeFilter); - if (captureVolumeFilter) - ms_filter_destroy(captureVolumeFilter); - if (resamplerFilter) - ms_filter_destroy(resamplerFilter); - if (audioSink) - ms_filter_destroy(audioSink); - if (audioCapture) - ms_filter_destroy(audioCapture); + + if (audioSink) ms_filter_unlink(playbackVolumeFilter, 0, audioSink, 0); + if (captureVolumeFilter && resamplerFilter) ms_filter_unlink(captureVolumeFilter, 0, resamplerFilter, 0); + if (resamplerFilter && playbackVolumeFilter) ms_filter_unlink(resamplerFilter, 0, playbackVolumeFilter, 0); + if (audioCapture) ms_filter_unlink(audioCapture, 0, captureVolumeFilter, 0); + if (playbackVolumeFilter) ms_filter_destroy(playbackVolumeFilter); + if (captureVolumeFilter) ms_filter_destroy(captureVolumeFilter); + if (resamplerFilter) ms_filter_destroy(resamplerFilter); + if (audioSink) ms_filter_destroy(audioSink); + if (audioCapture) ms_filter_destroy(audioCapture); if (ticker) { - ms_ticker_destroy(ticker);// Destroy ticker at the end to avoid conflicts between attached filters + ms_ticker_destroy(ticker); // Destroy ticker at the end to avoid conflicts between attached filters } ticker = nullptr; playbackVolumeFilter = nullptr; diff --git a/Linphone/model/setting/MediastreamerUtils.hpp b/Linphone/model/setting/MediastreamerUtils.hpp index 80d87347c..d4e9c93a6 100644 --- a/Linphone/model/setting/MediastreamerUtils.hpp +++ b/Linphone/model/setting/MediastreamerUtils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -36,64 +36,62 @@ struct _MSFactory; namespace MediastreamerUtils { - inline float computeVu (float volume) { - constexpr float VuMin = -20.f; - constexpr float VuMax = 4.f; +inline float computeVu(float volume) { + constexpr float VuMin = -20.f; + constexpr float VuMax = 4.f; - if (volume < VuMin) - return 0.f; - if (volume > VuMax) - return 1.f; - - return (volume - VuMin) / (VuMax - VuMin); - } - - inline float dbToLinear(float volume) { - return static_cast(pow(10.0, volume / 10.0)); - } - - float linearToDb(float volume); - - //Simple mediastreamer audio capture graph - //Used to get current microphone volume in audio settings - class SimpleCaptureGraph { - public: - SimpleCaptureGraph(const std::string &captureCardId, const std::string &playbackCardId); - ~SimpleCaptureGraph(); - - void start(); - void stop(); - - float getCaptureVolume(); - - float getCaptureGain(); - float getPlaybackGain(); - void setCaptureGain(float volume); - void setPlaybackGain(float volume); - - bool isRunning() const { - return running; - } - - void init(); - void destroy(); - - bool running = false; - - std::string captureCardId; - std::string playbackCardId; - - _MSFilter *audioSink = nullptr; - _MSFilter *audioCapture = nullptr; - _MSFilter *captureVolumeFilter = nullptr; - _MSFilter *playbackVolumeFilter = nullptr; - _MSFilter *resamplerFilter = nullptr; - _MSTicker *ticker = nullptr; - _MSSndCard *playbackCard = nullptr; - _MSSndCard *captureCard = nullptr; - _MSFactory *msFactory = nullptr; - }; + if (volume < VuMin) return 0.f; + if (volume > VuMax) return 1.f; + return (volume - VuMin) / (VuMax - VuMin); } +inline float dbToLinear(float volume) { + return static_cast(pow(10.0, volume / 10.0)); +} + +float linearToDb(float volume); + +// Simple mediastreamer audio capture graph +// Used to get current microphone volume in audio settings +class SimpleCaptureGraph { +public: + SimpleCaptureGraph(const std::string &captureCardId, const std::string &playbackCardId); + ~SimpleCaptureGraph(); + + void start(); + void stop(); + + float getCaptureVolume(); + + float getCaptureGain(); + float getPlaybackGain(); + void setCaptureGain(float volume); + void setPlaybackGain(float volume); + + bool isRunning() const { + return running; + } + + void init(); + void destroy(); + + bool running = false; + + std::string captureCardId; + std::string playbackCardId; + + _MSFilter *audioSink = nullptr; + _MSFilter *audioCapture = nullptr; + _MSFilter *captureVolumeFilter = nullptr; + _MSFilter *playbackVolumeFilter = nullptr; + _MSFilter *resamplerFilter = nullptr; + _MSTicker *ticker = nullptr; + _MSSndCard *playbackCard = nullptr; + _MSSndCard *captureCard = nullptr; + _MSFactory *msFactory = nullptr; +}; + +} // namespace MediastreamerUtils + #endif // ifndef MEDIASTREAMER_UTILS_H_ diff --git a/Linphone/model/sound-player/SoundPlayerModel.cpp b/Linphone/model/sound-player/SoundPlayerModel.cpp index 0e5780521..28bfba8fe 100644 --- a/Linphone/model/sound-player/SoundPlayerModel.cpp +++ b/Linphone/model/sound-player/SoundPlayerModel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/model/sound-player/SoundPlayerModel.hpp b/Linphone/model/sound-player/SoundPlayerModel.hpp index 421bbfeec..8b2667885 100644 --- a/Linphone/model/sound-player/SoundPlayerModel.hpp +++ b/Linphone/model/sound-player/SoundPlayerModel.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/file/FileDownloader.cpp b/Linphone/tool/file/FileDownloader.cpp index e48348f6b..b6ced2a30 100644 --- a/Linphone/tool/file/FileDownloader.cpp +++ b/Linphone/tool/file/FileDownloader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/file/FileDownloader.hpp b/Linphone/tool/file/FileDownloader.hpp index a4ccaa58a..35f1cce43 100644 --- a/Linphone/tool/file/FileDownloader.hpp +++ b/Linphone/tool/file/FileDownloader.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/file/FileExtractor.cpp b/Linphone/tool/file/FileExtractor.cpp index 3a022af83..714817832 100644 --- a/Linphone/tool/file/FileExtractor.cpp +++ b/Linphone/tool/file/FileExtractor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/file/FileExtractor.hpp b/Linphone/tool/file/FileExtractor.hpp index 0087d94bb..7c28ddcdf 100644 --- a/Linphone/tool/file/FileExtractor.hpp +++ b/Linphone/tool/file/FileExtractor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/file/TemporaryFile.cpp b/Linphone/tool/file/TemporaryFile.cpp index cb68353db..caf24c051 100644 --- a/Linphone/tool/file/TemporaryFile.cpp +++ b/Linphone/tool/file/TemporaryFile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/file/TemporaryFile.hpp b/Linphone/tool/file/TemporaryFile.hpp index c590a38c6..cf718c189 100644 --- a/Linphone/tool/file/TemporaryFile.hpp +++ b/Linphone/tool/file/TemporaryFile.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/native/DesktopTools.hpp b/Linphone/tool/native/DesktopTools.hpp index a370a2fd3..28d89842a 100644 --- a/Linphone/tool/native/DesktopTools.hpp +++ b/Linphone/tool/native/DesktopTools.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -24,11 +24,11 @@ #include #ifdef Q_OS_LINUX - #include "DesktopToolsLinux.hpp" +#include "DesktopToolsLinux.hpp" #elif defined(Q_OS_WIN) - #include "DesktopToolsWindows.hpp" +#include "DesktopToolsWindows.hpp" #else - #include "DesktopToolsMacOs.hpp" +#include "DesktopToolsMacOs.hpp" #endif // ifdef Q_OS_LINUX // ============================================================================= diff --git a/Linphone/tool/native/DesktopToolsLinux.cpp b/Linphone/tool/native/DesktopToolsLinux.cpp index 28b296900..f1b15d86b 100644 --- a/Linphone/tool/native/DesktopToolsLinux.cpp +++ b/Linphone/tool/native/DesktopToolsLinux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/native/DesktopToolsLinux.hpp b/Linphone/tool/native/DesktopToolsLinux.hpp index 69cf89661..6eea6975c 100644 --- a/Linphone/tool/native/DesktopToolsLinux.hpp +++ b/Linphone/tool/native/DesktopToolsLinux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/native/DesktopToolsMacOs.cpp b/Linphone/tool/native/DesktopToolsMacOs.cpp index 25365e8fd..4775b0b7b 100644 --- a/Linphone/tool/native/DesktopToolsMacOs.cpp +++ b/Linphone/tool/native/DesktopToolsMacOs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -22,22 +22,23 @@ // ============================================================================= -extern "C" bool enableScreenSaverMacOs (); -extern "C" bool disableScreenSaverMacOs (); +extern "C" bool enableScreenSaverMacOs(); +extern "C" bool disableScreenSaverMacOs(); -DesktopTools::DesktopTools (QObject *parent) : QObject(parent) {} - -DesktopTools::~DesktopTools () { - setScreenSaverStatus(true); +DesktopTools::DesktopTools(QObject *parent) : QObject(parent) { } -bool DesktopTools::getScreenSaverStatus () const { - return mScreenSaverStatus; +DesktopTools::~DesktopTools() { + setScreenSaverStatus(true); } -void DesktopTools::setScreenSaverStatus (bool status) { - if (status != mScreenSaverStatus && (status ? enableScreenSaverMacOs() : disableScreenSaverMacOs())) { - mScreenSaverStatus = status; - emit screenSaverStatusChanged(mScreenSaverStatus); - } +bool DesktopTools::getScreenSaverStatus() const { + return mScreenSaverStatus; +} + +void DesktopTools::setScreenSaverStatus(bool status) { + if (status != mScreenSaverStatus && (status ? enableScreenSaverMacOs() : disableScreenSaverMacOs())) { + mScreenSaverStatus = status; + emit screenSaverStatusChanged(mScreenSaverStatus); + } } diff --git a/Linphone/tool/native/DesktopToolsMacOs.hpp b/Linphone/tool/native/DesktopToolsMacOs.hpp index 64fb2e066..a99660330 100644 --- a/Linphone/tool/native/DesktopToolsMacOs.hpp +++ b/Linphone/tool/native/DesktopToolsMacOs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/native/DesktopToolsWindows.cpp b/Linphone/tool/native/DesktopToolsWindows.cpp index 112b838da..ebdd41364 100644 --- a/Linphone/tool/native/DesktopToolsWindows.cpp +++ b/Linphone/tool/native/DesktopToolsWindows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/native/DesktopToolsWindows.hpp b/Linphone/tool/native/DesktopToolsWindows.hpp index bae9909f8..5ac424747 100644 --- a/Linphone/tool/native/DesktopToolsWindows.hpp +++ b/Linphone/tool/native/DesktopToolsWindows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/native/screen-saver/ScreenSaverDBus.cpp b/Linphone/tool/native/screen-saver/ScreenSaverDBus.cpp index 2029f3201..81c485cf9 100644 --- a/Linphone/tool/native/screen-saver/ScreenSaverDBus.cpp +++ b/Linphone/tool/native/screen-saver/ScreenSaverDBus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/native/screen-saver/ScreenSaverDBus.hpp b/Linphone/tool/native/screen-saver/ScreenSaverDBus.hpp index b2615205f..952b6ce09 100644 --- a/Linphone/tool/native/screen-saver/ScreenSaverDBus.hpp +++ b/Linphone/tool/native/screen-saver/ScreenSaverDBus.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -28,23 +28,23 @@ class QDBusPendingCallWatcher; class ScreenSaverDBus : public QObject { - Q_OBJECT; + Q_OBJECT; public: - ScreenSaverDBus (QObject *parent = Q_NULLPTR); - ~ScreenSaverDBus (); + ScreenSaverDBus(QObject *parent = Q_NULLPTR); + ~ScreenSaverDBus(); - bool getScreenSaverStatus () const; - void setScreenSaverStatus (bool status); + bool getScreenSaverStatus() const; + void setScreenSaverStatus(bool status); signals: - void screenSaverStatusChanged (bool status); + void screenSaverStatusChanged(bool status); private: - bool mScreenSaverStatus = true; + bool mScreenSaverStatus = true; - QDBusInterface mBus; - uint32_t mToken; + QDBusInterface mBus; + uint32_t mToken; }; #endif // SCREEN_SAVER_DBUS_H_ diff --git a/Linphone/tool/native/screen-saver/ScreenSaverXdg.cpp b/Linphone/tool/native/screen-saver/ScreenSaverXdg.cpp index 81a2af5b0..68ebb0225 100644 --- a/Linphone/tool/native/screen-saver/ScreenSaverXdg.cpp +++ b/Linphone/tool/native/screen-saver/ScreenSaverXdg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -25,32 +25,29 @@ // ============================================================================= namespace { - constexpr char Program[] = "xdg-screensaver"; - const QStringList Arguments{"reset"}; +constexpr char Program[] = "xdg-screensaver"; +const QStringList Arguments{"reset"}; - constexpr int Interval = 30000; +constexpr int Interval = 30000; +} // namespace + +ScreenSaverXdg::ScreenSaverXdg(QObject *parent) : QObject(parent) { + mTimer.setInterval(Interval); + QObject::connect(&mTimer, &QTimer::timeout, []() { + // Legacy for systems without DBus screensaver. + QProcess::startDetached(Program, Arguments); + }); } -ScreenSaverXdg::ScreenSaverXdg (QObject *parent) : QObject(parent) { - mTimer.setInterval(Interval); - QObject::connect(&mTimer, &QTimer::timeout, []() { - // Legacy for systems without DBus screensaver. - QProcess::startDetached(Program, Arguments); - }); +bool ScreenSaverXdg::getScreenSaverStatus() const { + return !mTimer.isActive(); } -bool ScreenSaverXdg::getScreenSaverStatus () const { - return !mTimer.isActive(); -} - -void ScreenSaverXdg::setScreenSaverStatus (bool status) { - if (status == !mTimer.isActive()) - return; - - if (status) - mTimer.stop(); - else - mTimer.start(); - - emit screenSaverStatusChanged(status); +void ScreenSaverXdg::setScreenSaverStatus(bool status) { + if (status == !mTimer.isActive()) return; + + if (status) mTimer.stop(); + else mTimer.start(); + + emit screenSaverStatusChanged(status); } diff --git a/Linphone/tool/native/screen-saver/ScreenSaverXdg.hpp b/Linphone/tool/native/screen-saver/ScreenSaverXdg.hpp index b84dfcadf..ba24795b4 100644 --- a/Linphone/tool/native/screen-saver/ScreenSaverXdg.hpp +++ b/Linphone/tool/native/screen-saver/ScreenSaverXdg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -26,19 +26,19 @@ // ============================================================================= class ScreenSaverXdg : public QObject { - Q_OBJECT; + Q_OBJECT; public: - ScreenSaverXdg (QObject *parent = Q_NULLPTR); + ScreenSaverXdg(QObject *parent = Q_NULLPTR); - bool getScreenSaverStatus () const; - void setScreenSaverStatus (bool status); + bool getScreenSaverStatus() const; + void setScreenSaverStatus(bool status); signals: - void screenSaverStatusChanged (bool status); + void screenSaverStatusChanged(bool status); private: - QTimer mTimer; + QTimer mTimer; }; #endif // SCREEN_SAVER_XDG_H_ diff --git a/Linphone/tool/providers/ExternalImageProvider.cpp b/Linphone/tool/providers/ExternalImageProvider.cpp index 635ece438..413afb42c 100644 --- a/Linphone/tool/providers/ExternalImageProvider.cpp +++ b/Linphone/tool/providers/ExternalImageProvider.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/providers/ExternalImageProvider.hpp b/Linphone/tool/providers/ExternalImageProvider.hpp index 8266175bb..77d42445c 100644 --- a/Linphone/tool/providers/ExternalImageProvider.hpp +++ b/Linphone/tool/providers/ExternalImageProvider.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/providers/ThumbnailProvider.cpp b/Linphone/tool/providers/ThumbnailProvider.cpp index 7a7419436..def19a9bd 100644 --- a/Linphone/tool/providers/ThumbnailProvider.cpp +++ b/Linphone/tool/providers/ThumbnailProvider.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). diff --git a/Linphone/tool/providers/ThumbnailProvider.hpp b/Linphone/tool/providers/ThumbnailProvider.hpp index fbf97afb0..9314030b8 100644 --- a/Linphone/tool/providers/ThumbnailProvider.hpp +++ b/Linphone/tool/providers/ThumbnailProvider.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org).