Option to enable tone indications + update SDK
This commit is contained in:
parent
fdbe13928a
commit
f58a1a48e5
8 changed files with 45 additions and 16 deletions
|
|
@ -113,6 +113,7 @@ SettingsCore::SettingsCore(QObject *parent) : QObject(parent) {
|
||||||
|
|
||||||
INIT_CORE_MEMBER(ShortcutCount, settingsModel)
|
INIT_CORE_MEMBER(ShortcutCount, settingsModel)
|
||||||
INIT_CORE_MEMBER(Shortcuts, settingsModel)
|
INIT_CORE_MEMBER(Shortcuts, settingsModel)
|
||||||
|
INIT_CORE_MEMBER(CallToneIndicationsEnabled, settingsModel)
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsCore::SettingsCore(const SettingsCore &settingsCore) {
|
SettingsCore::SettingsCore(const SettingsCore &settingsCore) {
|
||||||
|
|
@ -183,6 +184,7 @@ SettingsCore::SettingsCore(const SettingsCore &settingsCore) {
|
||||||
mDownloadFolder = settingsCore.mDownloadFolder;
|
mDownloadFolder = settingsCore.mDownloadFolder;
|
||||||
mShortcutCount = settingsCore.mShortcutCount;
|
mShortcutCount = settingsCore.mShortcutCount;
|
||||||
mShortcuts = settingsCore.mShortcuts;
|
mShortcuts = settingsCore.mShortcuts;
|
||||||
|
mCallToneIndicationsEnabled = settingsCore.mCallToneIndicationsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsCore::~SettingsCore() {
|
SettingsCore::~SettingsCore() {
|
||||||
|
|
@ -386,6 +388,8 @@ void SettingsCore::setSelf(QSharedPointer<SettingsCore> me) {
|
||||||
ShortcutCount)
|
ShortcutCount)
|
||||||
DEFINE_CORE_GET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, QVariantList,
|
DEFINE_CORE_GET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, QVariantList,
|
||||||
shortcuts, Shortcuts)
|
shortcuts, Shortcuts)
|
||||||
|
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, bool,
|
||||||
|
callToneIndicationsEnabled, CallToneIndicationsEnabled)
|
||||||
|
|
||||||
auto coreModelConnection = SafeConnection<SettingsCore, CoreModel>::create(me, CoreModel::getInstance());
|
auto coreModelConnection = SafeConnection<SettingsCore, CoreModel>::create(me, CoreModel::getInstance());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,7 @@ public:
|
||||||
// Read-only
|
// Read-only
|
||||||
DECLARE_CORE_MEMBER(int, shortcutCount, ShortcutCount)
|
DECLARE_CORE_MEMBER(int, shortcutCount, ShortcutCount)
|
||||||
DECLARE_CORE_MEMBER(QVariantList, shortcuts, Shortcuts)
|
DECLARE_CORE_MEMBER(QVariantList, shortcuts, Shortcuts)
|
||||||
|
DECLARE_CORE_GETSET_MEMBER(bool, callToneIndicationsEnabled, CallToneIndicationsEnabled)
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -321,7 +321,7 @@ void CoreModel::onCallStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
}
|
}
|
||||||
if (state == linphone::Call::State::End && SettingsModel::dndEnabled(core->getConfig()) &&
|
if (state == linphone::Call::State::End && SettingsModel::dndEnabled(core->getConfig()) &&
|
||||||
core->getCallsNb() == 0) { // Disable tones in DND mode if no more calls are running.
|
core->getCallsNb() == 0) { // Disable tones in DND mode if no more calls are running.
|
||||||
SettingsModel::enableTones(core->getConfig(), false);
|
SettingsModel::getInstance()->setCallToneIndicationsEnabled(false);
|
||||||
}
|
}
|
||||||
emit callStateChanged(core, call, state, message);
|
emit callStateChanged(core, call, state, message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,8 @@ SettingsModel::SettingsModel() {
|
||||||
auto core = CoreModel::getInstance()->getCore();
|
auto core = CoreModel::getInstance()->getCore();
|
||||||
mConfig = core->getConfig();
|
mConfig = core->getConfig();
|
||||||
CoreModel::getInstance()->getLogger()->applyConfig(mConfig);
|
CoreModel::getInstance()->getLogger()->applyConfig(mConfig);
|
||||||
if (mConfig->hasEntry(UiSection, "do_not_disturb") == 1) {
|
// Only activate on enabled. If not, we should keep old configuration.
|
||||||
enableDnd(dndEnabled());
|
if (dndEnabled()) enableDnd(true);
|
||||||
}
|
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
CoreModel::getInstance().get(), &CoreModel::globalStateChanged, this,
|
CoreModel::getInstance().get(), &CoreModel::globalStateChanged, this,
|
||||||
[this](const std::shared_ptr<linphone::Core> &core, linphone::GlobalState gstate, const std::string &message) {
|
[this](const std::shared_ptr<linphone::Core> &core, linphone::GlobalState gstate, const std::string &message) {
|
||||||
|
|
@ -426,6 +425,19 @@ void SettingsModel::setAutomaticallyRecordCallsEnabled(bool enabled) {
|
||||||
emit automaticallyRecordCallsEnabledChanged(enabled);
|
emit automaticallyRecordCallsEnabledChanged(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SettingsModel::getCallToneIndicationsEnabled() const {
|
||||||
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
|
return CoreModel::getInstance()->getCore()->callToneIndicationsEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsModel::setCallToneIndicationsEnabled(bool enabled) {
|
||||||
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
|
if (enabled != getCallToneIndicationsEnabled()) {
|
||||||
|
CoreModel::getInstance()->getCore()->enableCallToneIndications(enabled);
|
||||||
|
emit callToneIndicationsEnabledChanged(enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// VFS.
|
// VFS.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
@ -539,12 +551,6 @@ bool SettingsModel::dndEnabled() const {
|
||||||
return dndEnabled(mConfig);
|
return dndEnabled(mConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsModel::enableTones(const shared_ptr<linphone::Config> &config, bool enable) {
|
|
||||||
mustBeInLinphoneThread(sLog().arg(Q_FUNC_INFO));
|
|
||||||
config->setInt("sound", "tone_indications", enable); // General tones
|
|
||||||
config->setInt("misc", "tone_indications", enable); // Call tones
|
|
||||||
}
|
|
||||||
|
|
||||||
void SettingsModel::enableRinging(bool enable) {
|
void SettingsModel::enableRinging(bool enable) {
|
||||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
mConfig->setInt("sound", "disable_ringing", !enable); // Ringing
|
mConfig->setInt("sound", "disable_ringing", !enable); // Ringing
|
||||||
|
|
@ -552,7 +558,7 @@ void SettingsModel::enableRinging(bool enable) {
|
||||||
|
|
||||||
void SettingsModel::enableDnd(bool enableDnd) {
|
void SettingsModel::enableDnd(bool enableDnd) {
|
||||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
enableTones(mConfig, !enableDnd);
|
setCallToneIndicationsEnabled(!enableDnd);
|
||||||
enableRinging(!enableDnd);
|
enableRinging(!enableDnd);
|
||||||
mConfig->setInt(UiSection, "do_not_disturb", enableDnd);
|
mConfig->setInt(UiSection, "do_not_disturb", enableDnd);
|
||||||
emit dndChanged(enableDnd);
|
emit dndChanged(enableDnd);
|
||||||
|
|
|
||||||
|
|
@ -108,9 +108,16 @@ public:
|
||||||
QString getVideoDevice() const;
|
QString getVideoDevice() const;
|
||||||
void setVideoDevice(QString device);
|
void setVideoDevice(QString device);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void startEchoCancellerCalibration();
|
void startEchoCancellerCalibration();
|
||||||
int getEchoCancellationCalibration() const;
|
int getEchoCancellationCalibration() const;
|
||||||
|
|
||||||
|
bool getCallToneIndicationsEnabled() const;
|
||||||
|
void setCallToneIndicationsEnabled(bool enabled);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
bool getLogsEnabled() const;
|
bool getLogsEnabled() const;
|
||||||
void setLogsEnabled(bool status);
|
void setLogsEnabled(bool status);
|
||||||
|
|
||||||
|
|
@ -133,7 +140,6 @@ public:
|
||||||
bool dndEnabled() const;
|
bool dndEnabled() const;
|
||||||
static bool dndEnabled(const std::shared_ptr<linphone::Config> &config);
|
static bool dndEnabled(const std::shared_ptr<linphone::Config> &config);
|
||||||
void enableDnd(bool value);
|
void enableDnd(bool value);
|
||||||
static void enableTones(const std::shared_ptr<linphone::Config> &config, bool enable);
|
|
||||||
void enableRinging(bool enable);
|
void enableRinging(bool enable);
|
||||||
|
|
||||||
QString getLogsEmail() const;
|
QString getLogsEmail() const;
|
||||||
|
|
@ -181,8 +187,6 @@ signals:
|
||||||
void videoEnabledChanged(bool enabled);
|
void videoEnabledChanged(bool enabled);
|
||||||
|
|
||||||
// Call. --------------------------------------------------------------------
|
// Call. --------------------------------------------------------------------
|
||||||
void echoCancellationEnabledChanged(bool enabled);
|
|
||||||
void automaticallyRecordCallsEnabledChanged(bool enabled);
|
|
||||||
|
|
||||||
void captureGraphRunningChanged(bool running);
|
void captureGraphRunningChanged(bool running);
|
||||||
|
|
||||||
|
|
@ -198,10 +202,18 @@ signals:
|
||||||
void playbackDeviceChanged(QVariantMap device);
|
void playbackDeviceChanged(QVariantMap device);
|
||||||
void ringerDeviceChanged(QVariantMap device);
|
void ringerDeviceChanged(QVariantMap device);
|
||||||
void videoDeviceChanged(QString device);
|
void videoDeviceChanged(QString device);
|
||||||
|
|
||||||
void conferenceLayoutChanged();
|
void conferenceLayoutChanged();
|
||||||
void mediaEncryptionChanged();
|
void mediaEncryptionChanged();
|
||||||
void mediaEncryptionMandatoryChanged();
|
void mediaEncryptionMandatoryChanged();
|
||||||
|
|
||||||
|
void echoCancellationEnabledChanged(bool enabled);
|
||||||
|
void automaticallyRecordCallsEnabledChanged(bool enabled);
|
||||||
|
|
||||||
|
void callToneIndicationsEnabledChanged(bool enabled);
|
||||||
|
|
||||||
|
void showAudioCodecsChanged(bool status);
|
||||||
|
|
||||||
void micVolumeChanged(float volume);
|
void micVolumeChanged(float volume);
|
||||||
|
|
||||||
void logsEnabledChanged(bool status);
|
void logsEnabledChanged(bool status);
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ bool ToolModel::createCall(const QString &sipAddress,
|
||||||
if (SettingsModel::dndEnabled(
|
if (SettingsModel::dndEnabled(
|
||||||
core->getConfig())) { // Force tones for outgoing calls when in DND mode (ringback, dtmf, etc ... ) disabled
|
core->getConfig())) { // Force tones for outgoing calls when in DND mode (ringback, dtmf, etc ... ) disabled
|
||||||
// again when no more calls are running.
|
// again when no more calls are running.
|
||||||
SettingsModel::enableTones(core->getConfig(), true);
|
SettingsModel::getInstance()->setCallToneIndicationsEnabled(true);
|
||||||
}
|
}
|
||||||
std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr);
|
std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr);
|
||||||
if (localVideoEnabled) CallModel::activateLocalVideo(params, localVideoEnabled);
|
if (localVideoEnabled) CallModel::activateLocalVideo(params, localVideoEnabled);
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,12 @@ AbstractSettingsLayout {
|
||||||
propertyOwner: SettingsCpp
|
propertyOwner: SettingsCpp
|
||||||
visible: !SettingsCpp.disableCallRecordings
|
visible: !SettingsCpp.disableCallRecordings
|
||||||
}
|
}
|
||||||
|
SwitchSetting {
|
||||||
|
titleText: qsTr("Tonalités")
|
||||||
|
subTitleText: qsTr("Activer les tonalités")
|
||||||
|
propertyName: "callToneIndicationsEnabled"
|
||||||
|
propertyOwner: SettingsCpp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
external/linphone-sdk
vendored
2
external/linphone-sdk
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit ba6b6ff92790491e8344b9d1b6df4e2df45e3199
|
Subproject commit 5711bcc198fdc48665e36bd78fe987b33c281c81
|
||||||
Loading…
Reference in a new issue