Ring Daemon
Loading...
Searching...
No Matches
preferences.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2026 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifdef HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include "preferences.h"
23#include "logger.h"
24#include "audio/audiolayer.h"
25
26#if HAVE_AAUDIO
28#else
29#if HAVE_ALSA
31#endif
32#if HAVE_JACK
34#endif
35#if HAVE_PULSE
37#endif
38#if HAVE_COREAUDIO
39#ifdef __APPLE__
40#include <TargetConditionals.h>
41#endif
42#if TARGET_OS_IOS
44#else
46#endif /* TARGET_OS_IOS */
47#endif /* HAVE_COREAUDIO */
48#if HAVE_PORTAUDIO
50#endif
51#endif /* HAVE_AAUDIO */
52
53#ifdef ENABLE_VIDEO
54#include "client/videomanager.h"
55#endif
56
57#pragma GCC diagnostic push
58#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
59#include <yaml-cpp/yaml.h>
60#pragma GCC diagnostic pop
61
62#include "config/yamlparser.h"
64#include <algorithm>
65#include <stdexcept>
66#include "fileutils.h"
67
68namespace jami {
69
71
72constexpr const char* const Preferences::CONFIG_LABEL;
73const char* const Preferences::DFT_ZONE = "North America";
74const char* const Preferences::REGISTRATION_EXPIRE_KEY = "registrationexpire";
75constexpr std::string_view DEFAULT_CONFERENCE_RESOLUTION {"1280x720"};
76
77// general preferences
78static constexpr const char* ORDER_KEY {"order"};
79static constexpr const char* PENDING_ACCOUNTS_KEY {"pendingAccounts"};
80static constexpr const char* AUDIO_API_KEY {"audioApi"};
81static constexpr const char* HISTORY_LIMIT_KEY {"historyLimit"};
82static constexpr const char* RINGING_TIMEOUT {"ringingTimeout"};
83static constexpr const char* HISTORY_MAX_CALLS_KEY {"historyMaxCalls"};
84static constexpr const char* ZONE_TONE_CHOICE_KEY {"zoneToneChoice"};
85static constexpr const char* PORT_NUM_KEY {"portNum"};
86static constexpr const char* SEARCH_BAR_DISPLAY_KEY {"searchBarDisplay"};
87static constexpr const char* MD5_HASH_KEY {"md5Hash"};
88
89// voip preferences
90constexpr const char* const VoipPreference::CONFIG_LABEL;
91static constexpr const char* PLAY_DTMF_KEY {"playDtmf"};
92static constexpr const char* PLAY_TONES_KEY {"playTones"};
93static constexpr const char* PULSE_LENGTH_KEY {"pulseLength"};
94
95// audio preferences
96constexpr const char* const AudioPreference::CONFIG_LABEL;
97static constexpr const char* ALSAMAP_KEY {"alsa"};
98static constexpr const char* PULSEMAP_KEY {"pulse"};
99static constexpr const char* PORTAUDIO_KEY {"portaudio"};
100static constexpr const char* CARDIN_KEY {"cardIn"};
101static constexpr const char* CARDOUT_KEY {"cardOut"};
102static constexpr const char* CARLIBJAMI_KEY {"cardRing"};
103static constexpr const char* PLUGIN_KEY {"plugin"};
104static constexpr const char* SMPLRATE_KEY {"smplRate"};
105static constexpr const char* DEVICE_PLAYBACK_KEY {"devicePlayback"};
106static constexpr const char* DEVICE_RECORD_KEY {"deviceRecord"};
107static constexpr const char* DEVICE_RINGTONE_KEY {"deviceRingtone"};
108static constexpr const char* RECORDPATH_KEY {"recordPath"};
109static constexpr const char* ALWAYS_RECORDING_KEY {"alwaysRecording"};
110static constexpr const char* VOLUMEMIC_KEY {"volumeMic"};
111static constexpr const char* VOLUMESPKR_KEY {"volumeSpkr"};
112static constexpr const char* AUDIO_PROCESSOR_KEY {"audioProcessor"};
113static constexpr const char* NOISE_REDUCE_KEY {"noiseReduce"};
114static constexpr const char* AGC_KEY {"automaticGainControl"};
115static constexpr const char* CAPTURE_MUTED_KEY {"captureMuted"};
116static constexpr const char* PLAYBACK_MUTED_KEY {"playbackMuted"};
117static constexpr const char* VAD_KEY {"voiceActivityDetection"};
118static constexpr const char* ECHO_CANCEL_KEY {"echoCancel"};
119
120#ifdef ENABLE_VIDEO
121// video preferences
122constexpr const char* const VideoPreferences::CONFIG_LABEL;
123static constexpr const char* DECODING_ACCELERATED_KEY {"decodingAccelerated"};
124static constexpr const char* ENCODING_ACCELERATED_KEY {"encodingAccelerated"};
125static constexpr const char* RECORD_PREVIEW_KEY {"recordPreview"};
126static constexpr const char* RECORD_QUALITY_KEY {"recordQuality"};
127static constexpr const char* CONFERENCE_RESOLUTION_KEY {"conferenceResolution"};
128#endif
129
130#ifdef ENABLE_PLUGIN
131// plugin preferences
132constexpr const char* const PluginPreferences::CONFIG_LABEL;
133static constexpr const char* JAMI_PLUGIN_KEY {"pluginsEnabled"};
134static constexpr const char* JAMI_PLUGINS_INSTALLED_KEY {"installedPlugins"};
135static constexpr const char* JAMI_PLUGINS_LOADED_KEY {"loadedPlugins"};
136#endif
137
138static constexpr int PULSE_LENGTH_DEFAULT {250};
139#ifndef _MSC_VER
140static constexpr const char* ALSA_DFT_CARD {"0"};
141#else
142static constexpr const char* ALSA_DFT_CARD {"-1"};
143#endif // _MSC_VER
144
146 : accountOrder_("")
147 , historyLimit_(0)
148 , historyMaxCalls_(20)
149 , ringingTimeout_(30)
150 , zoneToneChoice_(DFT_ZONE) // DFT_ZONE
151 , portNum_(sip_utils::DEFAULT_SIP_PORT)
152 , searchBarDisplay_(true)
153 , md5Hash_(false)
154{}
155
156void
157Preferences::verifyAccountOrder(const std::vector<std::string>& accountIDs)
158{
159 std::vector<std::string> tokens;
160 std::string token;
161 bool drop = false;
162
163 for (const auto c : accountOrder_) {
164 if (c != '/') {
165 token += c;
166 } else {
167 if (find(accountIDs.begin(), accountIDs.end(), token) != accountIDs.end())
168 tokens.push_back(token);
169 else {
170 JAMI_DBG("Dropping nonexistent account %s", token.c_str());
171 drop = true;
172 }
173 token.clear();
174 }
175 }
176
177 if (drop) {
178 accountOrder_.clear();
179 for (const auto& t : tokens)
180 accountOrder_ += t + '/';
181 }
182}
183
184void
186{
187 // Add the newly created account in the account order list
188 if (not accountOrder_.empty())
189 accountOrder_.insert(0, newAccountID + "/");
190 else
191 accountOrder_ = newAccountID + "/";
192}
193
194void
196{
197 // include the slash since we don't want to remove a partial match
198 const size_t start = accountOrder_.find(oldAccountID + "/");
199 if (start != std::string::npos)
200 accountOrder_.erase(start, oldAccountID.length() + 1);
201}
202
203bool
204Preferences::isAccountPending(const std::string& accountId) const
205{
206 return pendingAccountIds_.count(accountId) > 0;
207}
208
209bool
210Preferences::addPendingAccountId(const std::string& accountId)
211{
212 if (accountId.empty())
213 return false;
214 return pendingAccountIds_.insert(accountId).second;
215}
216
217bool
218Preferences::removePendingAccountId(const std::string& accountId)
219{
220 if (accountId.empty())
221 return false;
222 return pendingAccountIds_.erase(accountId) > 0;
223}
224
225void
226Preferences::serialize(YAML::Emitter& out) const
227{
228 out << YAML::Key << CONFIG_LABEL << YAML::Value << YAML::BeginMap;
229
230 out << YAML::Key << HISTORY_LIMIT_KEY << YAML::Value << historyLimit_;
231 out << YAML::Key << RINGING_TIMEOUT << YAML::Value << ringingTimeout_;
232 out << YAML::Key << HISTORY_MAX_CALLS_KEY << YAML::Value << historyMaxCalls_;
233 out << YAML::Key << MD5_HASH_KEY << YAML::Value << md5Hash_;
234 out << YAML::Key << ORDER_KEY << YAML::Value << accountOrder_;
235 out << YAML::Key << PORT_NUM_KEY << YAML::Value << portNum_;
236 out << YAML::Key << SEARCH_BAR_DISPLAY_KEY << YAML::Value << searchBarDisplay_;
237 out << YAML::Key << ZONE_TONE_CHOICE_KEY << YAML::Value << zoneToneChoice_;
238 out << YAML::Key << PENDING_ACCOUNTS_KEY << YAML::Value << YAML::BeginSeq;
239 for (const auto& accountId : pendingAccountIds_)
240 out << accountId;
241 out << YAML::EndSeq;
242 out << YAML::EndMap;
243}
244
245void
246Preferences::unserialize(const YAML::Node& in)
247{
248 const auto& node = in[CONFIG_LABEL];
249
250 parseValue(node, ORDER_KEY, accountOrder_);
251 parseValue(node, HISTORY_LIMIT_KEY, historyLimit_);
252 parseValue(node, RINGING_TIMEOUT, ringingTimeout_);
253 parseValue(node, HISTORY_MAX_CALLS_KEY, historyMaxCalls_);
254 parseValue(node, ZONE_TONE_CHOICE_KEY, zoneToneChoice_);
255 parseValue(node, PORT_NUM_KEY, portNum_);
256 parseValue(node, SEARCH_BAR_DISPLAY_KEY, searchBarDisplay_);
257 parseValue(node, MD5_HASH_KEY, md5Hash_);
258
259 pendingAccountIds_.clear();
260 if (const auto& pending = node[PENDING_ACCOUNTS_KEY]; pending && pending.IsSequence()) {
261 for (const auto& entry : pending) {
262 try {
263 pendingAccountIds_.insert(entry.as<std::string>());
264 } catch (const YAML::Exception& e) {
265 JAMI_WARN("[config] Unable to read pending account id: %s", e.what());
266 }
267 }
268 }
269}
270
272 : playDtmf_(true)
273 , playTones_(true)
274 , pulseLength_(PULSE_LENGTH_DEFAULT)
275{}
276
277void
278VoipPreference::serialize(YAML::Emitter& out) const
279{
280 out << YAML::Key << CONFIG_LABEL << YAML::Value << YAML::BeginMap;
281 out << YAML::Key << PLAY_DTMF_KEY << YAML::Value << playDtmf_;
282 out << YAML::Key << PLAY_TONES_KEY << YAML::Value << playTones_;
283 out << YAML::Key << PULSE_LENGTH_KEY << YAML::Value << pulseLength_;
284 out << YAML::EndMap;
285}
286
287void
289{
290 const auto& node = in[CONFIG_LABEL];
291 parseValue(node, PLAY_DTMF_KEY, playDtmf_);
292 parseValue(node, PLAY_TONES_KEY, playTones_);
293 parseValue(node, PULSE_LENGTH_KEY, pulseLength_);
294}
295
297 : audioApi_(PULSEAUDIO_API_STR)
298 , alsaCardin_(atoi(ALSA_DFT_CARD))
299 , alsaCardout_(atoi(ALSA_DFT_CARD))
300 , alsaCardRingtone_(atoi(ALSA_DFT_CARD))
301 , alsaPlugin_("default")
302 , alsaSmplrate_(44100)
303 , pulseDevicePlayback_("")
304 , pulseDeviceRecord_("")
305 , pulseDeviceRingtone_("")
306 , recordpath_("")
307 , alwaysRecording_(false)
308 , volumemic_(1.0)
309 , volumespkr_(1.0)
310 , audioProcessor_("webrtc")
311 , denoise_("auto")
312 , agcEnabled_(true)
313 , vadEnabled_(true)
314 , echoCanceller_("auto")
315 , captureMuted_(false)
316 , playbackMuted_(false)
317{}
318
319#if HAVE_ALSA
320
321static const int ALSA_DFT_CARD_ID = 0; // Index of the default soundcard
322
323static void
325{
327 JAMI_WARN(" Card with index %d doesn't exist or is unusable.", card);
329 }
330}
331#endif
332
333AudioLayer*
335{
336#if HAVE_AAUDIO
337 return new AAudioLayer(*this);
338#else
339
340#if HAVE_JACK
341 if (audioApi_ == JACK_API_STR) {
342 try {
343 if (auto ret = system("jack_lsp > /dev/null"))
344 throw std::runtime_error("Error running jack_lsp: " + std::to_string(ret));
345 return new JackLayer(*this);
346 } catch (const std::runtime_error& e) {
347 JAMI_ERR("%s", e.what());
348#if HAVE_PULSE
349 audioApi_ = PULSEAUDIO_API_STR;
350#elif HAVE_ALSA
351 audioApi_ = ALSA_API_STR;
352#elif HAVE_COREAUDIO
353 audioApi_ = COREAUDIO_API_STR;
354#elif HAVE_PORTAUDIO
355 audioApi_ = PORTAUDIO_API_STR;
356#else
357 throw;
358#endif // HAVE_PULSE
359 }
360 }
361#endif // HAVE_JACK
362
363#if HAVE_PULSE
364
365 if (audioApi_ == PULSEAUDIO_API_STR) {
366 try {
367 return new PulseLayer(*this);
368 } catch (const std::runtime_error& e) {
369 JAMI_WARN("Unable to create pulseaudio layer, falling back to ALSA");
370 }
371 }
372
373#endif
374
375#if HAVE_ALSA
376
377 audioApi_ = ALSA_API_STR;
380 checkSoundCard(alsaCardRingtone_, AudioDeviceType::RINGTONE);
381
382 return new AlsaLayer(*this);
383#endif
384
385#if HAVE_COREAUDIO
386 audioApi_ = COREAUDIO_API_STR;
387 try {
388 return new CoreLayer(*this);
389 } catch (const std::runtime_error& e) {
390 JAMI_WARN("Unable to create coreaudio layer. There will be no sound.");
391 }
392 return NULL;
393#endif
394
395#if HAVE_PORTAUDIO
396 audioApi_ = PORTAUDIO_API_STR;
397 try {
398 return new PortAudioLayer(*this);
399 } catch (const std::runtime_error& e) {
400 JAMI_WARN("Unable to create PortAudio layer. There will be no sound.");
401 }
402 return nullptr;
403#endif
404#endif // HAVE_AAUDIO
405
406 JAMI_WARN("No audio layer provided");
407 return nullptr;
408}
409
410std::vector<std::string>
412{
413 return {
414#if HAVE_AAUDIO
416#endif
417#if HAVE_ALSA
419#endif
420#if HAVE_PULSE
422#endif
423#if HAVE_JACK
425#endif
426#if HAVE_COREAUDIO
428#endif
429#if HAVE_PORTAUDIO
431#endif
432 };
433}
434
435void
436AudioPreference::serialize(YAML::Emitter& out) const
437{
438 out << YAML::Key << CONFIG_LABEL << YAML::Value << YAML::BeginMap;
439 // alsa submap
440 out << YAML::Key << ALSAMAP_KEY << YAML::Value << YAML::BeginMap;
441 out << YAML::Key << CARDIN_KEY << YAML::Value << alsaCardin_;
442 out << YAML::Key << CARDOUT_KEY << YAML::Value << alsaCardout_;
443 out << YAML::Key << CARLIBJAMI_KEY << YAML::Value << alsaCardRingtone_;
444 out << YAML::Key << PLUGIN_KEY << YAML::Value << alsaPlugin_;
445 out << YAML::Key << SMPLRATE_KEY << YAML::Value << alsaSmplrate_;
446 out << YAML::EndMap;
447
448 // common options
449 out << YAML::Key << ALWAYS_RECORDING_KEY << YAML::Value << alwaysRecording_;
450 out << YAML::Key << AUDIO_API_KEY << YAML::Value << audioApi_;
451 out << YAML::Key << CAPTURE_MUTED_KEY << YAML::Value << captureMuted_;
452 out << YAML::Key << PLAYBACK_MUTED_KEY << YAML::Value << playbackMuted_;
453
454 // pulse submap
455 out << YAML::Key << PULSEMAP_KEY << YAML::Value << YAML::BeginMap;
456 out << YAML::Key << DEVICE_PLAYBACK_KEY << YAML::Value << pulseDevicePlayback_;
457 out << YAML::Key << DEVICE_RECORD_KEY << YAML::Value << pulseDeviceRecord_;
458 out << YAML::Key << DEVICE_RINGTONE_KEY << YAML::Value << pulseDeviceRingtone_;
459 out << YAML::EndMap;
460
461 // portaudio submap
462 out << YAML::Key << PORTAUDIO_KEY << YAML::Value << YAML::BeginMap;
463 out << YAML::Key << DEVICE_PLAYBACK_KEY << YAML::Value << portaudioDevicePlayback_;
464 out << YAML::Key << DEVICE_RECORD_KEY << YAML::Value << portaudioDeviceRecord_;
465 out << YAML::Key << DEVICE_RINGTONE_KEY << YAML::Value << portaudioDeviceRingtone_;
466 out << YAML::EndMap;
467
468 // more common options!
469 out << YAML::Key << RECORDPATH_KEY << YAML::Value << recordpath_;
470 out << YAML::Key << VOLUMEMIC_KEY << YAML::Value << volumemic_;
471 out << YAML::Key << VOLUMESPKR_KEY << YAML::Value << volumespkr_;
472
473 // audio processor options, not in a submap
474 out << YAML::Key << AUDIO_PROCESSOR_KEY << YAML::Value << audioProcessor_;
475 out << YAML::Key << AGC_KEY << YAML::Value << agcEnabled_;
476 out << YAML::Key << VAD_KEY << YAML::Value << vadEnabled_;
477 out << YAML::Key << NOISE_REDUCE_KEY << YAML::Value << denoise_;
478 out << YAML::Key << ECHO_CANCEL_KEY << YAML::Value << echoCanceller_;
479 out << YAML::EndMap;
480}
481
482bool
484{
485 std::string path = fileutils::expand_path(r);
487 recordpath_ = path;
488 return true;
489 } else {
490 JAMI_ERR("%s is not writable, unable to be the recording path", path.c_str());
491 return false;
492 }
493}
494
495void
497{
498 const auto& node = in[CONFIG_LABEL];
499
500 // alsa submap
501 const auto& alsa = node[ALSAMAP_KEY];
502
503 parseValue(alsa, CARDIN_KEY, alsaCardin_);
504 parseValue(alsa, CARDOUT_KEY, alsaCardout_);
505 parseValue(alsa, CARLIBJAMI_KEY, alsaCardRingtone_);
506 parseValue(alsa, PLUGIN_KEY, alsaPlugin_);
507 parseValue(alsa, SMPLRATE_KEY, alsaSmplrate_);
508
509 // common options
510 parseValue(node, ALWAYS_RECORDING_KEY, alwaysRecording_);
511 parseValue(node, AUDIO_API_KEY, audioApi_);
512 parseValue(node, AGC_KEY, agcEnabled_);
513 parseValue(node, CAPTURE_MUTED_KEY, captureMuted_);
514 parseValue(node, NOISE_REDUCE_KEY, denoise_);
515 parseValue(node, PLAYBACK_MUTED_KEY, playbackMuted_);
516
517 // pulse submap
518 const auto& pulse = node[PULSEMAP_KEY];
519 parseValue(pulse, DEVICE_PLAYBACK_KEY, pulseDevicePlayback_);
520 parseValue(pulse, DEVICE_RECORD_KEY, pulseDeviceRecord_);
521 parseValue(pulse, DEVICE_RINGTONE_KEY, pulseDeviceRingtone_);
522
523 // portaudio submap
524 const auto& portaudio = node[PORTAUDIO_KEY];
525 parseValue(portaudio, DEVICE_PLAYBACK_KEY, portaudioDevicePlayback_);
526 parseValue(portaudio, DEVICE_RECORD_KEY, portaudioDeviceRecord_);
527 parseValue(portaudio, DEVICE_RINGTONE_KEY, portaudioDeviceRingtone_);
528
529 // more common options!
530 parseValue(node, RECORDPATH_KEY, recordpath_);
531 parseValue(node, VOLUMEMIC_KEY, volumemic_);
532 parseValue(node, VOLUMESPKR_KEY, volumespkr_);
533 parseValue(node, AUDIO_PROCESSOR_KEY, audioProcessor_);
534 parseValue(node, VAD_KEY, vadEnabled_);
535 parseValue(node, ECHO_CANCEL_KEY, echoCanceller_);
536}
537
538#ifdef ENABLE_VIDEO
539VideoPreferences::VideoPreferences()
543 , recordQuality_(0)
545{}
546
547void
548VideoPreferences::serialize(YAML::Emitter& out) const
549{
550 out << YAML::Key << CONFIG_LABEL << YAML::Value << YAML::BeginMap;
551 out << YAML::Key << RECORD_PREVIEW_KEY << YAML::Value << recordPreview_;
552 out << YAML::Key << RECORD_QUALITY_KEY << YAML::Value << recordQuality_;
553#ifdef ENABLE_HWACCEL
554 out << YAML::Key << DECODING_ACCELERATED_KEY << YAML::Value << decodingAccelerated_;
555 out << YAML::Key << ENCODING_ACCELERATED_KEY << YAML::Value << encodingAccelerated_;
556#endif
557 out << YAML::Key << CONFERENCE_RESOLUTION_KEY << YAML::Value << conferenceResolution_;
558 if (auto* dm = getVideoDeviceMonitor())
559 dm->serialize(out);
560 out << YAML::EndMap;
561}
562
563void
564VideoPreferences::unserialize(const YAML::Node& in)
565{
566 // values may or may not be present
567 const auto& node = in[CONFIG_LABEL];
568 try {
571 } catch (...) {
572 recordPreview_ = true;
573 recordQuality_ = 0;
574 }
575#ifdef ENABLE_HWACCEL
576 try {
579 } catch (...) {
581 encodingAccelerated_ = false;
582 }
583#endif
584 try {
586 } catch (...) {
588 }
589 if (auto* dm = getVideoDeviceMonitor())
590 dm->unserialize(in);
591}
592#endif // ENABLE_VIDEO
593
594#ifdef ENABLE_PLUGIN
595PluginPreferences::PluginPreferences()
597{}
598
599void
600PluginPreferences::serialize(YAML::Emitter& out) const
601{
602 out << YAML::Key << CONFIG_LABEL << YAML::Value << YAML::BeginMap;
603 out << YAML::Key << JAMI_PLUGIN_KEY << YAML::Value << pluginsEnabled_;
604 out << YAML::Key << JAMI_PLUGINS_INSTALLED_KEY << YAML::Value << installedPlugins_;
605 out << YAML::Key << JAMI_PLUGINS_LOADED_KEY << YAML::Value << loadedPlugins_;
606 out << YAML::EndMap;
607}
608
609void
610PluginPreferences::unserialize(const YAML::Node& in)
611{
612 // values may or may not be present
613 const auto& node = in[CONFIG_LABEL];
614 try {
616 } catch (...) {
617 pluginsEnabled_ = false;
618 }
619
621 try {
623 } catch (const std::exception& e) {
624 JAMI_WARNING("Couldn't parse vector of installed plugins: {}", e.what());
625 }
626
627 const auto& loadedPluginsNode = node[JAMI_PLUGINS_LOADED_KEY];
628 try {
630 } catch (const std::exception& e) {
631 JAMI_WARNING("Couldn't parse vector of loaded plugins: {}", e.what());
632 }
633}
634#endif // ENABLE_PLUGIN
635
636} // namespace jami
Main sound class.
#define ALSA_API_STR
Definition audiolayer.h:43
#define AAUDIO_API_STR
Definition audiolayer.h:41
#define PULSEAUDIO_API_STR
Definition audiolayer.h:42
#define JACK_API_STR
Definition audiolayer.h:44
#define PORTAUDIO_API_STR
Definition audiolayer.h:46
#define COREAUDIO_API_STR
Definition audiolayer.h:45
static bool soundCardIndexExists(int card, AudioDeviceType stream)
Check if the given index corresponds to an existing sound card and supports the specified streaming m...
AudioLayer * createAudioLayer()
bool setRecordPath(const std::string &r)
void unserialize(const YAML::Node &in) override
static std::vector< std::string > getSupportedAudioManagers()
void serialize(YAML::Emitter &out) const override
void verifyAccountOrder(const std::vector< std::string > &accounts)
bool removePendingAccountId(const std::string &accountId)
static const char *const DFT_ZONE
Definition preferences.h:44
void removeAccount(const std::string &acc)
void unserialize(const YAML::Node &in) override
bool addPendingAccountId(const std::string &accountId)
void serialize(YAML::Emitter &out) const override
Preferences()
Default sound card index.
static const char *const REGISTRATION_EXPIRE_KEY
Definition preferences.h:45
void addAccount(const std::string &acc)
bool isAccountPending(const std::string &accountId) const
void serialize(YAML::Emitter &out) const override
void unserialize(const YAML::Node &in) override
#define JAMI_ERR(...)
Definition logger.h:230
#define JAMI_DBG(...)
Definition logger.h:228
#define JAMI_WARN(...)
Definition logger.h:229
#define JAMI_WARNING(formatstr,...)
Definition logger.h:242
bool isDirectoryWritable(const std::string &directory)
std::string expand_path(const std::string &path)
Expand the given path.
void parseValue(const YAML::Node &node, const char *key, T &value)
Definition yamlparser.h:31
std::set< std::string > parseVector(const YAML::Node &node)
static constexpr const char * CARDIN_KEY
static constexpr const char * RECORDPATH_KEY
static constexpr const char * VOLUMEMIC_KEY
static constexpr const char * CARLIBJAMI_KEY
static constexpr const char * NOISE_REDUCE_KEY
static constexpr const char * AGC_KEY
void emitSignal(Args... args)
Definition jami_signal.h:64
static constexpr const char * AUDIO_API_KEY
static constexpr const char * CAPTURE_MUTED_KEY
static constexpr const char * PLAY_DTMF_KEY
static constexpr const char * RINGING_TIMEOUT
static constexpr const char * DEVICE_RECORD_KEY
constexpr std::string_view DEFAULT_CONFERENCE_RESOLUTION
static constexpr const char * ECHO_CANCEL_KEY
static constexpr const char * HISTORY_MAX_CALLS_KEY
static constexpr const char * SMPLRATE_KEY
static constexpr const char * PLAYBACK_MUTED_KEY
static constexpr const char * CARDOUT_KEY
static constexpr const char * PENDING_ACCOUNTS_KEY
AudioDeviceType
Definition audiolayer.h:57
static constexpr const char * MD5_HASH_KEY
static constexpr const char * ALWAYS_RECORDING_KEY
static constexpr const char * HISTORY_LIMIT_KEY
static constexpr const char * DEVICE_RINGTONE_KEY
static constexpr const char * ALSAMAP_KEY
static constexpr const char * PLAY_TONES_KEY
static constexpr const char * ORDER_KEY
static constexpr int PULSE_LENGTH_DEFAULT
static constexpr const char * VAD_KEY
static constexpr const char * SEARCH_BAR_DISPLAY_KEY
static constexpr const char * VOLUMESPKR_KEY
static constexpr const char * PLUGIN_KEY
static constexpr const char * DEVICE_PLAYBACK_KEY
static constexpr const char * PORTAUDIO_KEY
static constexpr const char * ALSA_DFT_CARD
Default DTMF length.
static constexpr const char * AUDIO_PROCESSOR_KEY
static constexpr const char * PULSEMAP_KEY
static constexpr const char * PULSE_LENGTH_KEY
static constexpr const char * PORT_NUM_KEY
static constexpr const char * ZONE_TONE_CHOICE_KEY