recordable.h 2.54 KB
Newer Older
1
/*
2
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
3
 *  Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
Julien Bonjean's avatar
Julien Bonjean committed
4
 *
5 6 7 8 9 10 11 12
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
Julien Bonjean's avatar
Julien Bonjean committed
13
 *
14 15
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
16
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
17 18 19 20 21 22 23 24 25 26 27
 *
 *  Additional permission under GNU GPL version 3 section 7:
 *
 *  If you modify this program, or any covered work, by linking or
 *  combining it with the OpenSSL project's OpenSSL library (or a
 *  modified version of that library), containing parts covered by the
 *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
 *  grants you additional permission to convey the resulting work.
 *  Corresponding Source for a non-source form of such a combination
 *  shall include the source code for the parts of OpenSSL used as well
 *  as that of the covered work.
28 29 30 31 32
 */

#ifndef RECORDABLE_H
#define RECORDABLE_H

33 34
#include "audiorecord.h"
#include "audiorecorder.h"
35

36
class Recordable {
37 38 39 40

    public:

        Recordable();
41
        virtual ~Recordable();
42

Julien Bonjean's avatar
Julien Bonjean committed
43 44 45
        /**
         * Return recording state (true/false)
         */
46 47
        bool isRecording() const {
            return recAudio_.isRecording();
Julien Bonjean's avatar
Julien Bonjean committed
48
        }
49

Julien Bonjean's avatar
Julien Bonjean committed
50 51 52 53 54
        /**
         * This method must be implemented for this interface as calls and conferences
         * have different behavior.
         */
        virtual bool setRecording() = 0;
55

Julien Bonjean's avatar
Julien Bonjean committed
56 57 58
        /**
         * Stop recording
         */
59
        void stopRecording() {
60
            recAudio_.stopRecording();
Julien Bonjean's avatar
Julien Bonjean committed
61
        }
62

Julien Bonjean's avatar
Julien Bonjean committed
63 64 65
        /**
         * Init the recording file name according to path specified in configuration
         */
66
        void initRecFilename(const std::string &filename);
67

68 69 70
        /**
         * Return the file path for this recording
         */
71
        virtual std::string getFilename() const;
72

Julien Bonjean's avatar
Julien Bonjean committed
73 74 75
        /**
         * Set recording sampling rate.
         */
76
        void setRecordingSmplRate(int smplRate);
77

78 79 80
    protected:
        AudioRecord recAudio_;
        AudioRecorder recorder_;
81 82 83
};

#endif