10 struct SourceGroupProps
{
14 SourceGroupProps() : mGain(1.0f
), mPitch(1.0f
) { }
17 class SourceGroupImpl
: SourceGroupProps
{
18 ContextImpl
*const mContext
;
20 Vector
<SourceImpl
*> mSources
;
21 Vector
<SourceGroupImpl
*> mSubGroups
;
23 SourceGroupProps mParentProps
;
24 SourceGroupImpl
*mParent
;
28 void update(ALfloat gain
, ALfloat pitch
);
32 void insertSubGroup(SourceGroupImpl
*group
);
33 void eraseSubGroup(SourceGroupImpl
*group
);
35 bool findInSubGroups(SourceGroupImpl
*group
) const;
37 void collectPlayingSourceIds(Vector
<ALuint
> &sourceids
) const;
38 void updatePausedStatus() const;
40 void collectPausedSourceIds(Vector
<ALuint
> &sourceids
) const;
41 void updatePlayingStatus() const;
43 void collectSourceIds(Vector
<ALuint
> &sourceids
) const;
44 void updateStoppedStatus() const;
47 SourceGroupImpl(ContextImpl
*context
, StringView name
)
48 : mContext(context
), mParent(nullptr), mName(String(name
))
51 ALfloat
getAppliedGain() const { return mGain
* mParentProps
.mGain
; }
52 ALfloat
getAppliedPitch() const { return mPitch
* mParentProps
.mPitch
; }
54 void insertSource(SourceImpl
*source
);
55 void eraseSource(SourceImpl
*source
);
57 void setParentGroup(SourceGroup group
);
58 SourceGroup
getParentGroup() const { return SourceGroup(mParent
); }
60 Vector
<Source
> getSources() const;
62 Vector
<SourceGroup
> getSubGroups() const;
64 void setGain(ALfloat gain
);
65 ALfloat
getGain() const { return mGain
; }
67 void setPitch(ALfloat pitch
);
68 ALfloat
getPitch() const { return mPitch
; }
70 void pauseAll() const;
71 void resumeAll() const;
75 StringView
getName() const { return mName
; }
82 #endif /* SOURCEGROUP_H */