maj copyright

This commit is contained in:
Gaelle Braud 2025-08-20 10:21:43 +02:00 committed by gaelle
parent d42af52ba1
commit 8566f830d1
37 changed files with 226 additions and 252 deletions

View file

@ -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).

View file

@ -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).

View file

@ -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).
@ -58,7 +58,8 @@ void ParticipantInfoList::setChatCore(const QSharedPointer<ChatCore> &chatCore)
QList<QSharedPointer<ParticipantGui>> participantList;
auto participants = mChatCore->getParticipants();
resetData();
for(auto p: participants) add(p);
for (auto p : participants)
add(p);
};
connect(mChatCore.get(), &ChatCore::participantsChanged, this, buildList);
buildList();

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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,35 +36,29 @@ DefaultTranslatorCore::DefaultTranslatorCore (QObject *parent) : QTranslator(par
// 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;
if (dir.contains(selector)) goto end;
// Ignore default imports.
if (dir.startsWith(":/QtQuick"))
continue;
if (dir.startsWith(":/QtQuick")) continue;
QString basename = info.baseName();
if (!mContexts.contains(basename))
mContexts << 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);
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);
.arg(context)
.arg(sourceText)
.arg(disambiguation);
return translation;
}

View file

@ -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).
@ -30,12 +30,10 @@ class DefaultTranslatorCore : public QTranslator {
public:
DefaultTranslatorCore(QObject *parent = Q_NULLPTR);
QString translate (
const char *context,
QString translate(const char *context,
const char *sourceText,
const char *disambiguation = Q_NULLPTR,
int n = -1
) const override;
int n = -1) const override;
private:
QSet<QString> mContexts;
@ -56,7 +54,8 @@ private:
// 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");
// }
// };

View file

@ -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,36 +18,32 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MediastreamerUtils.hpp"
#include <linphone/linphonecore.h>
#include <mediastreamer2/msvolume.h>
#include <mediastreamer2/mssndcard.h>
#include <mediastreamer2/msticker.h>
#include <mediastreamer2/msvolume.h>
#include <model/core/CoreModel.hpp>
#include "MediastreamerUtils.hpp"
#include <qlogging.h>
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
init();
}
SimpleCaptureGraph::~SimpleCaptureGraph()
{
SimpleCaptureGraph::~SimpleCaptureGraph() {
destroy();
}
static void device_notify_cb(void *user_data, MSFilter *f, unsigned int event, void *eventdata) {
@ -81,8 +77,7 @@ 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);
@ -104,14 +99,12 @@ void SimpleCaptureGraph::init() {
ms_filter_call_method(playbackVolumeFilter, static_cast<unsigned int>(MS_VOLUME_SET_GAIN), &muteGain);
ticker = ms_ticker_new();
running = false;
}
void SimpleCaptureGraph::start() {
if (!running && audioCapture) {
running = true;
ms_ticker_attach(ticker, audioCapture);
}
}
@ -127,24 +120,15 @@ void SimpleCaptureGraph::destroy() {
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
}

View file

@ -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).
@ -40,10 +40,8 @@ namespace MediastreamerUtils {
constexpr float VuMin = -20.f;
constexpr float VuMax = 4.f;
if (volume < VuMin)
return 0.f;
if (volume > VuMax)
return 1.f;
if (volume < VuMin) return 0.f;
if (volume > VuMax) return 1.f;
return (volume - VuMin) / (VuMax - VuMin);
}
@ -94,6 +92,6 @@ namespace MediastreamerUtils {
_MSFactory *msFactory = nullptr;
};
}
} // namespace MediastreamerUtils
#endif // ifndef MEDIASTREAMER_UTILS_H_

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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,7 +25,8 @@
extern "C" bool enableScreenSaverMacOs();
extern "C" bool disableScreenSaverMacOs();
DesktopTools::DesktopTools (QObject *parent) : QObject(parent) {}
DesktopTools::DesktopTools(QObject *parent) : QObject(parent) {
}
DesktopTools::~DesktopTools() {
setScreenSaverStatus(true);

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).
@ -29,7 +29,7 @@ namespace {
const QStringList Arguments{"reset"};
constexpr int Interval = 30000;
}
} // namespace
ScreenSaverXdg::ScreenSaverXdg(QObject *parent) : QObject(parent) {
mTimer.setInterval(Interval);
@ -44,13 +44,10 @@ bool ScreenSaverXdg::getScreenSaverStatus () const {
}
void ScreenSaverXdg::setScreenSaverStatus(bool status) {
if (status == !mTimer.isActive())
return;
if (status == !mTimer.isActive()) return;
if (status)
mTimer.stop();
else
mTimer.start();
if (status) mTimer.stop();
else mTimer.start();
emit screenSaverStatusChanged(status);
}

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).

View file

@ -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).