|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.server.voice.BasicVoiceGroup
atavism.server.voice.NonpositionalVoiceGroup
public class NonpositionalVoiceGroup
This class implements VoiceGroup interface, and is used to implement two important cases of voice groups: presentations and "raid groups". In a non-positional voice group, all listeners in the group hear the same set of speakers.
Nested Class Summary | |
---|---|
static class |
NonpositionalVoiceGroup.ComparePriorities
Comparator class that compares GroupMembers by priority, and then by index. |
Field Summary | |
---|---|
protected java.util.Set<GroupMember> |
listeners
The listeners for this non-positional voice group. |
Fields inherited from class atavism.server.voice.BasicVoiceGroup |
---|
allowedMembers, association, defaultPriority, groupOid, lock, loggingRecomputeVoices, maxVoices, members, voiceSender |
Constructor Summary | |
---|---|
NonpositionalVoiceGroup(OID groupOid,
java.lang.Object association,
VoiceSender voiceSender,
int maxVoices)
Create a NonpositionalVoiceGroup |
Method Summary | |
---|---|
GroupMember |
addMember(OID memberOid,
VoiceConnection memberCon,
int priority,
boolean allowedSpeaker)
Create a member with the given oid, and associate it with memberCon. |
protected void |
changeListening(GroupMember listener,
boolean add)
Change a listener from not listening to listening, or vice versa |
protected void |
changeSpeaking(GroupMember speaker,
boolean add)
Change a speaker from not speaking to speaking, or vice versa |
boolean |
isAllowedSpeaker(OID memberOid)
Does not need locking, since there are no modifications and the status could change immediately after the call anyway. |
boolean |
isPositional()
Return true if the group is a positional group; that is, if membership in the group is determined by being near the listener, and the priority of speakers is determined by how near any speaker is. |
void |
recomputeListenerVoices(GroupMember listener)
Recompute the voice channels to be sent to the specified listener. |
protected void |
recomputeListenerVoices(GroupMember listener,
java.util.List<GroupMember> membersToConsider)
Recompute the voice channels to be sent to the specified listener, where speakers are chosen from membersToConsider. |
protected void |
speakingStatusChanged()
Some speaker change from speaking to not speaker, or vice versa. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Set<GroupMember> listeners
Constructor Detail |
---|
public NonpositionalVoiceGroup(OID groupOid, java.lang.Object association, VoiceSender voiceSender, int maxVoices)
groupOid
- The oid of the group, which is unique across all
voice groups.association
- An object-valued data member that is unused
in BasicVoiceGroup, but available to derived classes.voiceSender
- The abstraction that allows the voice group to
send messages to listeners.maxVoices
- The maximum number of voice channels that may
ever be simultaneously in use by any clientMethod Detail |
---|
public GroupMember addMember(OID memberOid, VoiceConnection memberCon, int priority, boolean allowedSpeaker)
addMember
in interface VoiceGroup
addMember
in class BasicVoiceGroup
memberOid
- The oid of the member.memberCon
- The VoiceConnection object connecting the
voice server with the clientpriority
- The speaking priority that the member should be
assigned; speakers with higher priorities will be heard over
speakers with lower priorities.allowedSpeaker
- If true, the new member is allowed to
speak in the group; if false they will not be heard by members
by members of the group.
public boolean isPositional()
BasicVoiceGroup
isPositional
in interface VoiceGroup
isPositional
in class BasicVoiceGroup
public boolean isAllowedSpeaker(OID memberOid)
isAllowedSpeaker
in interface VoiceGroup
isAllowedSpeaker
in class BasicVoiceGroup
memberOid
- The oid of the member whose allowed speaker
status will be returned.
protected void changeSpeaking(GroupMember speaker, boolean add)
changeSpeaking
in class BasicVoiceGroup
speaker
- A GroupMember instance whose speaking state is to be changed.add
- If true, change the speaker from not speaking to speaking, if
false, from speaking to not speaking.protected void changeListening(GroupMember listener, boolean add)
changeListening
in class BasicVoiceGroup
listener
- A GroupMember instance whose listening state is to be changed.add
- If true, change the listener from not listening to listening, if
false, from listening to not listening.public void recomputeListenerVoices(GroupMember listener)
recomputeListenerVoices
in class BasicVoiceGroup
listener
- The group member for which voice channels are to be recomputed.protected void recomputeListenerVoices(GroupMember listener, java.util.List<GroupMember> membersToConsider)
listener
- The group member for which voice channels are to be recomputed.membersToConsider
- The list of speakers.protected void speakingStatusChanged()
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |