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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
3
3
 *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
4
4
 *
5
5
 *  Inspired by tonegenerator of
37
37
#include <stdexcept>
38
38
#include "audio/audioloop.h"
39
39
 
40
 
namespace sfl {
41
 
class AudioCodec;
42
 
}
43
 
 
44
40
class AudioFileException : public std::runtime_error {
45
41
    public:
46
42
        AudioFileException(const std::string &str) :
52
48
 */
53
49
class AudioFile : public AudioLoop {
54
50
    public:
55
 
        AudioFile(const std::string &filepath, unsigned int sampleRate) : AudioLoop(sampleRate), filepath_(filepath)
56
 
        {}
 
51
        AudioFile(const std::string &filepath, unsigned int sampleRate);
57
52
 
58
53
        std::string getFilePath() const {
59
54
            return filepath_;
62
57
    protected:
63
58
        /** The absolute path to the sound file */
64
59
        std::string filepath_;
65
 
};
66
 
 
67
 
class RawFile : public AudioFile {
68
 
    public:
69
 
        /**
70
 
         * Constructor
71
 
         */
72
 
        RawFile(const std::string& name, sfl::AudioCodec* codec, unsigned int sampleRate = 8000);
73
60
 
74
61
    private:
75
 
        NON_COPYABLE(RawFile);
76
 
 
77
 
        /** Your preferred codec */
78
 
        sfl::AudioCodec* audioCodec_;
79
 
};
80
 
 
81
 
class WaveFile : public AudioFile {
82
 
    public:
83
 
        /**
84
 
         * Load a sound file in memory
85
 
         * @param filename      The absolute path to the file
86
 
         * @param sampleRate    The sample rate to read it
87
 
         */
88
 
        WaveFile(const std::string&, unsigned int sampleRate);
 
62
        // override
 
63
        void onBufferFinish();
 
64
        unsigned updatePlaybackScale_;
89
65
};
90
66
 
91
67
#endif // __AUDIOFILE_H__