~ubuntu-branches/ubuntu/utopic/ardour3/utopic

« back to all changes in this revision

Viewing changes to libs/ardour/ardour/buffer.h

  • Committer: Package Import Robot
  • Author(s): Adrian Knoth
  • Date: 2014-02-25 14:13:18 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140225141318-y760kgxso78rduuf
Tags: 3.5.357~dfsg-1
* Imported Upstream version 3.5.357~dfsg
* Critical bugfix release. All users are recommended to upgrade.
* Details: https://community.ardour.org/node/8015

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        /** Factory function */
47
47
        static Buffer* create(DataType type, size_t capacity);
48
48
 
49
 
        /** Maximum capacity of buffer.
50
 
         * Note in some cases the entire buffer may not contain valid data, use size. */
 
49
        /** Maximum capacity of buffer. */
51
50
        size_t capacity() const { return _capacity; }
52
51
 
53
 
        /** Amount of valid data in buffer.  Use this over capacity almost always. */
54
 
        size_t size() const { return _size; }
55
 
 
56
 
        /** Return true if the buffer contains no data, false otherwise */
57
 
        virtual bool empty() const { return _size == 0; }
58
 
 
59
52
        /** Type of this buffer.
60
53
         * Based on this you can static cast a Buffer* to the desired type. */
61
54
        DataType type() const { return _type; }
80
73
 
81
74
  protected:
82
75
        Buffer(DataType type)
83
 
                : _type(type), _capacity(0), _size(0), _silent (true)
 
76
                : _type(type), _capacity(0), _silent (true)
84
77
        {}
85
78
 
86
79
        DataType  _type;
87
80
        pframes_t _capacity;
88
 
        pframes_t _size;
89
81
        bool      _silent;
90
82
};
91
83