10 ALenum
GetFormat(ChannelConfig chans
, SampleType type
);
13 ContextImpl
&mContext
;
17 ChannelConfig mChannelConfig
;
18 SampleType mSampleType
;
20 Vector
<Source
> mSources
;
26 BufferImpl(ContextImpl
&context
, ALuint id
, ALuint freq
, ChannelConfig config
, SampleType type
,
27 StringView name
, size_t name_hash
)
28 : mContext(context
), mId(id
), mFrequency(freq
), mChannelConfig(config
), mSampleType(type
)
29 , mName(String(name
)), mNameHash(name_hash
)
34 ContextImpl
&getContext() { return mContext
; }
35 ALuint
getId() const { return mId
; }
37 void addSource(Source source
) { mSources
.push_back(source
); }
38 void removeSource(Source source
)
40 auto iter
= std::find(mSources
.cbegin(), mSources
.cend(), source
);
41 if(iter
!= mSources
.cend()) mSources
.erase(iter
);
44 void load(ALuint frames
, ALenum format
, SharedPtr
<Decoder
> decoder
, ContextImpl
*ctx
);
46 ALuint
getLength() const;
48 ALuint
getFrequency() const { return mFrequency
; }
49 ChannelConfig
getChannelConfig() const { return mChannelConfig
; }
50 SampleType
getSampleType() const { return mSampleType
; }
52 ALuint
getSize() const;
54 void setLoopPoints(ALuint start
, ALuint end
);
55 std::pair
<ALuint
,ALuint
> getLoopPoints() const;
57 Vector
<Source
> getSources() const { return mSources
; }
59 StringView
getName() const { return mName
; }
61 size_t getSourceCount() const { return mSources
.size(); }
63 size_t getNameHash() const { return mNameHash
; }