VRFS-317 use new JS bridge function to account for device latency

This commit is contained in:
Brian Smith 2013-05-27 15:08:45 -04:00
parent cd01664ce9
commit 0c58542ebc
2 changed files with 11 additions and 3 deletions

View File

@ -142,6 +142,8 @@
function SessionStopPlay() {}
function SessionStopRecording() {}
function SessionGetDeviceLatency() { return 10.0; }
function SessionGetMasterLocalMix() {
logger.debug('SessionGetMasterLocalMix. Returning: ' + _mix);
return _mix;
@ -377,6 +379,7 @@
this.SetVURefreshRate = SetVURefreshRate;
this.SessionGetMasterLocalMix = SessionGetMasterLocalMix;
this.SessionSetMasterLocalMix = SessionSetMasterLocalMix;
this.SessionGetDeviceLatency = SessionGetDeviceLatency;
// Track
this.TrackGetChannels = TrackGetChannels;

View File

@ -28,14 +28,19 @@
var latencyInfo = sessionLatency.sessionInfo(session.id);
var latencyDescription = "";
var latencyStyle = "";
var gearLatency = 0.0; // TODO: call JS bridge to get gear latency
var gearLatency = context.jamClient.SessionGetDeviceLatency();
var showJoinLink = true;
if (latencyInfo.averageLatency + gearLatency <= LATENCY.GOOD.max) {
var totalLatency = latencyInfo.averageLatency + gearLatency;
logger.debug("latencyInfo.averageLatency=" + latencyInfo.averageLatency);
logger.debug("gearLatency=" + gearLatency);
if (totalLatency <= LATENCY.GOOD.max) {
latencyDescription = LATENCY.GOOD.description;
latencyStyle = "latency-green";
}
else if (latencyInfo.averageLatency + gearLatency > LATENCY.MEDIUM.min && latencyInfo.averageLatency + gearLatency <= LATENCY.MEDIUM.max) {
else if (totalLatency > LATENCY.MEDIUM.min && totalLatency <= LATENCY.MEDIUM.max) {
latencyDescription = LATENCY.MEDIUM.description;
latencyStyle = "latency-medium";
}