10 struct SourceGroupProps
{
14 SourceGroupProps() : mGain(1.0f
), mPitch(1.0f
) { }
17 class SourceGroupImpl
: SourceGroupProps
{
18 ContextImpl
&mContext
;
20 Vector
<SourceImpl
*> mSources
;
21 Vector
<SourceGroupImpl
*> mSubGroups
;
23 SourceGroupProps mParentProps
;
24 SourceGroupImpl
*mParent
;
26 void update(ALfloat gain
, ALfloat pitch
);
30 void insertSubGroup(SourceGroupImpl
*group
);
31 void eraseSubGroup(SourceGroupImpl
*group
);
33 bool findInSubGroups(SourceGroupImpl
*group
) const;
35 void collectPlayingSourceIds(Vector
<ALuint
> &sourceids
) const;
36 void updatePausedStatus() const;
38 void collectPausedSourceIds(Vector
<ALuint
> &sourceids
) const;
39 void updatePlayingStatus() const;
41 void collectSourceIds(Vector
<ALuint
> &sourceids
) const;
42 void updateStoppedStatus() const;
45 SourceGroupImpl(ContextImpl
&context
) : mContext(context
), mParent(nullptr) { }
47 ALfloat
getAppliedGain() const { return mGain
* mParentProps
.mGain
; }
48 ALfloat
getAppliedPitch() const { return mPitch
* mParentProps
.mPitch
; }
50 void insertSource(SourceImpl
*source
);
51 void eraseSource(SourceImpl
*source
);
53 void setParentGroup(SourceGroup group
);
54 SourceGroup
getParentGroup() const { return SourceGroup(mParent
); }
56 Vector
<Source
> getSources() const;
58 Vector
<SourceGroup
> getSubGroups() const;
60 void setGain(ALfloat gain
);
61 ALfloat
getGain() const { return mGain
; }
63 void setPitch(ALfloat pitch
);
64 ALfloat
getPitch() const { return mPitch
; }
66 void pauseAll() const;
67 void resumeAll() const;
76 #endif /* SOURCEGROUP_H */