wip
This commit is contained in:
parent
c3cd742c17
commit
27800d17fd
|
|
@ -580,6 +580,28 @@
|
|||
return foundMixer;
|
||||
}
|
||||
|
||||
function _groupedMixersForClientId(clientId, groupIds, usedMixers) {
|
||||
//logger.debug("clientId", clientId, "groupIds", groupIds, "mixers", mixers)
|
||||
var foundMixers = {};
|
||||
$.each(mixers, function(index, mixer) {
|
||||
if (mixer.client_id === clientId) {
|
||||
for (var i=0; i<groupIds.length; i++) {
|
||||
if (mixer.group_id === groupIds[i]) {
|
||||
if ((mixer.groupId != ChannelGroupIds.UserMusicInputGroup) && !(mixer.id in usedMixers)) {
|
||||
var mixers = foundMixers[mixer.group_id]
|
||||
if(!mixers) {
|
||||
mixers = []
|
||||
foundMixers[mixer.group_id] = mixers;
|
||||
}
|
||||
mixers.push(mixer)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return foundMixers;
|
||||
}
|
||||
|
||||
function _wireTopVolume() {
|
||||
var gainPercent = 0;
|
||||
var mixerIds = [];
|
||||
|
|
@ -837,27 +859,30 @@
|
|||
// particular client, in a particular group, and I'll need to further
|
||||
// identify by track id or something similar.
|
||||
|
||||
var mixer = null;
|
||||
if(sessionModel.isMasterMixMode()) {
|
||||
mixer = _mixerForClientId(
|
||||
participant.client_id,
|
||||
[
|
||||
ChannelGroupIds.AudioInputMusicGroup,
|
||||
ChannelGroupIds.PeerAudioInputMusicGroup
|
||||
],
|
||||
usedMixers);
|
||||
}
|
||||
else {
|
||||
// don't pass in used mixers; we need to associate multiple tracks with the same mixer
|
||||
mixer = _mixerForClientId(
|
||||
var mixers = _groupedMixersForClientId(
|
||||
participant.client_id,
|
||||
[
|
||||
ChannelGroupIds.AudioInputMusicGroup,
|
||||
ChannelGroupIds.PeerAudioInputMusicGroup,
|
||||
ChannelGroupIds.UserMusicInputGroup
|
||||
],
|
||||
{});
|
||||
}
|
||||
usedMixers);
|
||||
|
||||
var mixer = null;
|
||||
var oppositeMixer = null;
|
||||
if(mixers) {
|
||||
if(mixers[ChannelGroupIds.AudioInputMusicGroup]) {
|
||||
mixer = [ChannelGroupIds.AudioInputMusicGroup][0]
|
||||
}
|
||||
else if(sessionModel.isMasterMixMode() && mixers[ChannelGroupIds.PeerAudioInputMusicGroup]) {
|
||||
mixer = [ChannelGroupIds.PeerAudioInputMusicGroup][0]
|
||||
oppositeMixer = [ChannelGroupIds.UserMusicInputGroup][0]
|
||||
}
|
||||
else if(!sessionModel.isMasterMixMode() && mixers[ChannelGroupIds.UserMusicInputGroup]) {
|
||||
mixer = [ChannelGroupIds.UserMusicInputGroup][0]
|
||||
oppositeMixer = [ChannelGroupIds.PeerAudioInputMusicGroup][0]
|
||||
}
|
||||
}
|
||||
if (mixer) {
|
||||
usedMixers[mixer.id] = true;
|
||||
myTrack = (mixer.group_id === ChannelGroupIds.AudioInputMusicGroup);
|
||||
|
|
@ -873,6 +898,7 @@
|
|||
trackData.mixerId = mixer.id;
|
||||
trackData.noaudio = false;
|
||||
trackData.group_id = mixer.group_id;
|
||||
trackData.oppositeMixer = oppositeMixer;
|
||||
context.jamClient.SessionSetUserName(participant.client_id,name);
|
||||
|
||||
} else { // No mixer to match, yet
|
||||
|
|
@ -932,24 +958,20 @@
|
|||
for (var key in lookingForMixers) {
|
||||
var clientId = lookingForMixers[key];
|
||||
var mixer = null;
|
||||
if(sessionModel.isMasterMixMode()) {
|
||||
mixer = _mixerForClientId(
|
||||
clientId,
|
||||
[
|
||||
ChannelGroupIds.AudioInputMusicGroup,
|
||||
ChannelGroupIds.PeerAudioInputMusicGroup
|
||||
],
|
||||
usedMixers);
|
||||
}
|
||||
else {
|
||||
// don't pass in used mixers; we need to associate multiple tracks with the same mixer
|
||||
mixer = _mixerForClientId(
|
||||
clientId,
|
||||
[
|
||||
ChannelGroupIds.AudioInputMusicGroup,
|
||||
ChannelGroupIds.UserMusicInputGroup
|
||||
],
|
||||
{});
|
||||
var mixer = null;
|
||||
var oppositeMixer = null;
|
||||
if(mixers) {
|
||||
if(mixers[ChannelGroupIds.AudioInputMusicGroup]) {
|
||||
mixer = [ChannelGroupIds.AudioInputMusicGroup][0]
|
||||
}
|
||||
else if(sessionModel.isMasterMixMode() && mixers[ChannelGroupIds.PeerAudioInputMusicGroup]) {
|
||||
mixer = [ChannelGroupIds.PeerAudioInputMusicGroup][0]
|
||||
oppositeMixer = [ChannelGroupIds.UserMusicInputGroup][0]
|
||||
}
|
||||
else if(!sessionModel.isMasterMixMode() && mixers[ChannelGroupIds.UserMusicInputGroup]) {
|
||||
mixer = [ChannelGroupIds.UserMusicInputGroup][0]
|
||||
oppositeMixer = [ChannelGroupIds.PeerAudioInputMusicGroup][0]
|
||||
}
|
||||
}
|
||||
if (mixer) {
|
||||
var participant = (sessionModel.getParticipant(clientId) || {name:'unknown'}).name;
|
||||
|
|
@ -962,12 +984,12 @@
|
|||
|
||||
connectTrackToMixer(trackSelector, key, mixer.id, gainPercent, mixer.group_id);
|
||||
var $track = $('div.track[client-id="' + clientId + '"]');
|
||||
$track.find('.track-icon-mute').attr('mixer-id', mixer.id);
|
||||
$track.find('.track-icon-mute').attr('mixer-id', mixer.id).attr('opposite-mixer-id', oppositeMixer.id)
|
||||
// hide overlay for all tracks associated with this client id (if one mixer is present, then all tracks are valid)
|
||||
$('.disabled-track-overlay', $track).hide();
|
||||
$('.track-connection', $track).removeClass('red yellow green').addClass('grey');
|
||||
// Set mute state
|
||||
_toggleVisualMuteControl($track.find('.track-icon-mute'), mixer.mute);
|
||||
_toggleVisualMuteControl($track.find('.track-icon-mute'), mixer.mute, oppositeMixer.mute);
|
||||
}
|
||||
else {
|
||||
// if 1 second has gone by and still no mixer, then we gray the participant's tracks
|
||||
|
|
|
|||
Loading…
Reference in New Issue