~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/src/audio/sound/dtmf.h

  • Committer: Package Import Robot
  • Author(s): Francois Marier
  • Date: 2011-11-25 13:24:12 UTC
  • mfrom: (4.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20111125132412-dc4qvhyosk74cd42
Tags: 1.0.1-4
Don't assume that arch:all packages will get built (closes: #649726)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
 
3
 *  Author : Yan Morin <yan.morin@savoirfairelinux.com>
 
4
 *  Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
 
5
 *
 
6
 *      Portions Copyright (c) 2000 Billy Biggs <bbiggs@div8.net>
 
7
 *  Portions Copyright (c) 2004 Wirlab <kphone@wirlab.net>
 
8
 *
 
9
 *  This program is free software; you can redistribute it and/or modify
 
10
 *  it under the terms of the GNU General Public License as published by
 
11
 *  the Free Software Foundation; either version 3 of the License, or
 
12
 *  (at your option) any later version.
 
13
 *
 
14
 *  This program is distributed in the hope that it will be useful,
 
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 *  GNU General Public License for more details.
 
18
 *
 
19
 *  You should have received a copy of the GNU General Public License
 
20
 *  along with this program; if not, write to the Free Software
 
21
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
22
 *
 
23
 *  Additional permission under GNU GPL version 3 section 7:
 
24
 *
 
25
 *  If you modify this program, or any covered work, by linking or
 
26
 *  combining it with the OpenSSL project's OpenSSL library (or a
 
27
 *  modified version of that library), containing parts covered by the
 
28
 *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
 
29
 *  grants you additional permission to convey the resulting work.
 
30
 *  Corresponding Source for a non-source form of such a combination
 
31
 *  shall include the source code for the parts of OpenSSL used as well
 
32
 *  as that of the covered work.
 
33
 */
 
34
 
 
35
#ifndef __DTMF_H_
 
36
#define __DTMF_H_
 
37
 
 
38
#include "global.h"
 
39
#include "dtmfgenerator.h"
 
40
 
 
41
/**
 
42
 * @file dtmf.h
 
43
 * @brief DMTF library to generate a dtmf sample
 
44
 */
 
45
class DTMF {
 
46
    public:
 
47
        /**
 
48
         * Create a new DTMF.
 
49
         * @param sampleRate frequency of the sample (ex: 8000 hz)
 
50
         */
 
51
        DTMF(unsigned int sampleRate);
 
52
 
 
53
        /**
 
54
         * Start the done for th given dtmf
 
55
         * @param code  The DTMF code
 
56
         */
 
57
        void startTone(char code);
 
58
 
 
59
        /**
 
60
         * Copy the sound inside the sampling* buffer
 
61
         * @param buffer : a SFLDataFormat* buffer
 
62
         * @param n      : The size to generate
 
63
         */
 
64
        bool generateDTMF(SFLDataFormat* buffer, size_t n);
 
65
 
 
66
    private:
 
67
        char currentTone_;
 
68
        char newTone_;
 
69
 
 
70
        DTMFGenerator dtmfgenerator_;
 
71
};
 
72
 
 
73
#endif // __KEY_DTMF_H_