10 ALenum
GetFormat(ChannelConfig chans
, SampleType type
);
13 ContextImpl
*const mContext
;
17 ChannelConfig mChannelConfig
;
18 SampleType mSampleType
;
20 Vector
<Source
> mSources
;
25 BufferImpl(ContextImpl
*context
, ALuint id
, ALuint freq
, ChannelConfig config
, SampleType type
, StringView name
)
26 : mContext(context
), mId(id
), mFrequency(freq
), mChannelConfig(config
), mSampleType(type
)
32 ContextImpl
*getContext() { return mContext
; }
33 ALuint
getId() const { return mId
; }
35 void addSource(Source source
) { mSources
.push_back(source
); }
36 void removeSource(Source source
)
38 auto iter
= std::find(mSources
.cbegin(), mSources
.cend(), source
);
39 if(iter
!= mSources
.cend()) mSources
.erase(iter
);
42 void load(ALuint frames
, ALenum format
, SharedPtr
<Decoder
> decoder
, ContextImpl
*ctx
);
44 ALuint
getLength() const;
46 ALuint
getFrequency() const { return mFrequency
; }
47 ChannelConfig
getChannelConfig() const { return mChannelConfig
; }
48 SampleType
getSampleType() const { return mSampleType
; }
50 ALuint
getSize() const;
52 void setLoopPoints(ALuint start
, ALuint end
);
53 std::pair
<ALuint
,ALuint
> getLoopPoints() const;
55 Vector
<Source
> getSources() const { return mSources
; }
57 StringView
getName() const { return mName
; }
59 size_t getSourceCount() const { return mSources
.size(); }