~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

Viewing changes to daemon/src/audio/audioloop.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-30 11:40:56 UTC
  • mfrom: (4.1.18 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130630114056-0np50jkyqo6vnmii
Tags: 1.2.3-2
* changeset_r92d62cfc54732bbbcfff2b1d36c096b120b981a5.diff 
  - fixes automatic endian detection 
* Update Vcs: fixes vcs-field-not-canonical

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
3
3
 *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
4
4
 *
5
5
 *  Inspired by tonegenerator of
17
17
 *
18
18
 *  You should have received a copy of the GNU General Public License
19
19
 *  along with this program; if not, write to the Free Software
20
 
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
21
21
 *
22
22
 *  Additional permission under GNU GPL version 3 section 7:
23
23
 *
44
44
 
45
45
class AudioLoop {
46
46
    public:
47
 
        AudioLoop();
 
47
        AudioLoop(unsigned int sampleRate);
48
48
 
49
49
        virtual ~AudioLoop();
50
50
 
57
57
         */
58
58
        void getNext(SFLDataFormat* output, size_t samples, short volume=100);
59
59
 
 
60
        void seek(double relative_position);
 
61
 
60
62
        /**
61
63
         * Reset the pointer position
62
64
         */
72
74
            return size_;
73
75
        }
74
76
 
 
77
        /**
 
78
         * This should be set to true for recording playback
 
79
         */
 
80
        void setIsRecording(bool isRec) {
 
81
           isRecording_ = isRec;
 
82
        }
 
83
 
75
84
 
76
85
    protected:
77
86
        /** The data buffer */
86
95
        /** Sample rate */
87
96
        unsigned int sampleRate_;
88
97
 
 
98
        /** Is a playback recording */
 
99
        bool isRecording_;
 
100
 
89
101
    private:
90
102
        NON_COPYABLE(AudioLoop);
91
103
};