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
28
namespace
jami
{
29
30
class
TelephoneTone
31
{
32
public
:
34
enum class
CountryId
{
35
ZID_NORTH_AMERICA
= 0,
36
ZID_FRANCE
,
37
ZID_AUSTRALIA
,
38
ZID_UNITED_KINGDOM
,
39
ZID_SPAIN
,
40
ZID_ITALY
,
41
ZID_JAPAN
,
42
ZID_COUNTRIES
,
43
};
44
45
TelephoneTone
(
const
std::string&
countryName
,
unsigned
int
sampleRate,
AVSampleFormat
sampleFormat);
46
47
void
setCurrentTone
(
Tone::ToneId
toneId
);
48
void
setSampleRate
(
unsigned
int
sampleRate,
AVSampleFormat
sampleFormat);
49
std::shared_ptr<Tone>
getCurrentTone
();
50
51
private
:
52
NON_COPYABLE
(
TelephoneTone
);
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
jami::TelephoneTone
Definition
tonelist.h:31
jami::TelephoneTone::CountryId
CountryId
Countries.
Definition
tonelist.h:34
jami::TelephoneTone::CountryId::ZID_JAPAN
@ ZID_JAPAN
jami::TelephoneTone::CountryId::ZID_FRANCE
@ ZID_FRANCE
jami::TelephoneTone::CountryId::ZID_AUSTRALIA
@ ZID_AUSTRALIA
jami::TelephoneTone::CountryId::ZID_UNITED_KINGDOM
@ ZID_UNITED_KINGDOM
jami::TelephoneTone::CountryId::ZID_SPAIN
@ ZID_SPAIN
jami::TelephoneTone::CountryId::ZID_COUNTRIES
@ ZID_COUNTRIES
jami::TelephoneTone::CountryId::ZID_ITALY
@ ZID_ITALY
jami::TelephoneTone::CountryId::ZID_NORTH_AMERICA
@ ZID_NORTH_AMERICA
jami::TelephoneTone::setCurrentTone
void setCurrentTone(Tone::ToneId toneId)
Definition
tonelist.cpp:55
jami::TelephoneTone::getCurrentTone
std::shared_ptr< Tone > getCurrentTone()
Definition
tonelist.cpp:70
jami::TelephoneTone::setSampleRate
void setSampleRate(unsigned int sampleRate, AVSampleFormat sampleFormat)
Definition
tonelist.cpp:64
jami::Tone::ToneId
ToneId
The different kind of tones.
Definition
tone.h:43
jami::Tone::ToneId::TONE_NULL
@ TONE_NULL
jami
Definition
account.cpp:61
jami::emitSignal
void emitSignal(Args... args)
Definition
ring_signal.h:64
NON_COPYABLE
#define NON_COPYABLE(ClassName)
Definition
noncopyable.h:30
tone.h
Tone sample (dial, busy, ring, congestion)
src
media
audio
sound
tonelist.h
Generated on Thu Jun 19 2025 15:50:37 for Ring Daemon by
1.9.8