16 ALenum
GetFormat(ChannelConfig chans
, SampleType type
);
19 ContextImpl
*const mContext
;
23 ChannelConfig mChannelConfig
;
24 SampleType mSampleType
;
26 Vector
<Source
> mSources
;
31 BufferImpl(ContextImpl
*context
, ALuint id
, ALuint freq
, ChannelConfig config
, SampleType type
, StringView name
)
32 : mContext(context
), mId(id
), mFrequency(freq
), mChannelConfig(config
), mSampleType(type
)
38 ContextImpl
*getContext() { return mContext
; }
39 ALuint
getId() const { return mId
; }
41 void addSource(Source source
) { mSources
.push_back(source
); }
42 void removeSource(Source source
)
44 auto iter
= std::find(mSources
.cbegin(), mSources
.cend(), source
);
45 if(iter
!= mSources
.cend()) mSources
.erase(iter
);
48 void load(ALuint frames
, ALenum format
, SharedPtr
<Decoder
> decoder
, ContextImpl
*ctx
);
50 ALuint
getLength() const;
52 ALuint
getFrequency() const { return mFrequency
; }
53 ChannelConfig
getChannelConfig() const { return mChannelConfig
; }
54 SampleType
getSampleType() const { return mSampleType
; }
56 ALuint
getSize() const;
58 void setLoopPoints(ALuint start
, ALuint end
);
59 std::pair
<ALuint
,ALuint
> getLoopPoints() const;
61 Vector
<Source
> getSources() const { return mSources
; }
63 const String
&getName() const { return mName
; }
65 bool isInUse() const { return (mSources
.size() > 0); }