Ring Daemon 16.0.0
Loading...
Searching...
No Matches
tonelist.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * Inspired by tonegenerator of
5 * Laurielle Lea <laurielle.lea@savoirfairelinux.com> (2004)
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20#pragma once
21
22#include "tone.h"
23
24#include <string>
25#include <array>
26#include <memory>
27
28namespace jami {
29
31{
32public:
44
45 TelephoneTone(const std::string& countryName, unsigned int sampleRate, AVSampleFormat sampleFormat);
46
48 void setSampleRate(unsigned int sampleRate, AVSampleFormat sampleFormat);
49 std::shared_ptr<Tone> getCurrentTone();
50
51private:
53
54 static CountryId getCountryId(const std::string& countryName);
55
56 void buildTones(unsigned int sampleRate, AVSampleFormat sampleFormat);
57
58 CountryId countryId_;
59 std::array<std::shared_ptr<Tone>, (size_t) Tone::ToneId::TONE_NULL> tones_ {};
60 Tone::ToneId currentTone_;
61};
62
63} // namespace jami
CountryId
Countries.
Definition tonelist.h:34
void setCurrentTone(Tone::ToneId toneId)
Definition tonelist.cpp:55
std::shared_ptr< Tone > getCurrentTone()
Definition tonelist.cpp:70
void setSampleRate(unsigned int sampleRate, AVSampleFormat sampleFormat)
Definition tonelist.cpp:64
ToneId
The different kind of tones.
Definition tone.h:43
void emitSignal(Args... args)
Definition ring_signal.h:64
#define NON_COPYABLE(ClassName)
Definition noncopyable.h:30
Tone sample (dial, busy, ring, congestion)