fixing audio config and session related issues

This commit is contained in:
Nuwan 2022-09-02 11:10:51 +05:30
parent cbbfebddc9
commit 7a7986e30a
7 changed files with 147 additions and 68 deletions

View File

@ -488,11 +488,11 @@
(d) => d.request_id !== deferred.request_id
);
} else if (evt_id) {
//logger.log("EVENT RESPONSE FROM CLIENT APP", evt_id, Object.keys(response)[0])
logger.log("EVENT RESPONSE FROM CLIENT APP", evt_id, Object.keys(response)[0])
let method = Object.keys(response)[0]
switch (method) {
case 'execute_script':
logger.log(`execute_script: ${response['execute_script']}`);
//logger.log(`execute_script: ${response['execute_script']}`);
eval(response['execute_script']);
break;

View File

@ -298,7 +298,7 @@ ChannelGroupIds = context.JK.ChannelGroupIds
<a className="open-jamtrack" onClick={this.openJamTrack}>JamTrack</a>
</li>
<li>
<a className="open-backingtrack" onClick={this.openBackingTrack}>Audio File</a>
<a className="open-backingtrack" onClick={ this.openBackingTrack }>Audio File</a>
</li>
</ul>
<div className="use-metronome-header">
@ -430,7 +430,6 @@ ChannelGroupIds = context.JK.ChannelGroupIds
@closeWindow()
handleBackingTrackSelectedCallback: (result) ->
@setState({backingTrackDialogOpen: false})
SessionActions.openBackingTrack(result)

View File

@ -8,6 +8,7 @@ ConfigureTracksActions = @ConfigureTracksActions
mixins: [Reflux.listenTo(@SessionStatsStore,"onStatsChanged")]
onStatsChanged: (stats) ->
console.log('STATS', stats)
@setState({stats: stats[@props.clientId]})
getInitialState: () ->
@ -190,7 +191,7 @@ ConfigureTracksActions = @ConfigureTracksActions
context.JK.helpBubble($root.find('.disabled-track-overlay'), 'missing-my-tracks', {}, {positions:['top'], offsetParent: $root.closest('.top-parent')});
return this.initializeVstEffects();
this.initializeVstEffects();
}`
componentWillUpdate: (nextProps, nextState) ->

View File

@ -247,14 +247,19 @@ StatsInfo = {
onStatsChanged: (stats) ->
stats = window.SessionStatsStore.stats
console.log('=stats', stats)
if stats?
if stats.parent?
# if we have a parent, then use stats from the JamBlaster (parent), not ourselves. Otherwise we'll get bad stats (no Audio etc)
console.log('=stats.parent', stats.parent)
console.log('=@props.participant.client_id', @props.participant.client_id)
console.log('=stats.parent[@props.participant.client_id]', stats.parent[@props.participant.client_id])
clientStats = stats.parent[@props.participant.client_id]
else
clientStats = stats[@props.participant.client_id]
else
clientStats = null
console.log('=clientStats', clientStats)
@setState({stats: clientStats})
getInitialState: () ->

View File

@ -703,19 +703,34 @@ MIX_MODES = context.JK.MIX_MODES;
muteMixer: muteMixer
}
mute: (mixerId, mode, muting) ->
# mute: (mixerId, mode, muting) ->
# mode = @mixMode unless mode?
mode = @mixMode unless mode?
# @fillTrackVolumeObject(mixerId, mode)
@fillTrackVolumeObject(mixerId, mode)
# context.trackVolumeObject.mute = muting
context.trackVolumeObject.mute = muting
# context.jamClient.SessionSetControlState(mixerId, mode)
context.jamClient.SessionSetControlState(mixerId, mode)
# # keep state of mixer in sync with backend
# mixer = @getMixer(mixerId, mode)
# mixer.mute = muting
# keep state of mixer in sync with backend
mixer = @getMixer(mixerId, mode)
mixer.mute = muting
mute: `async function(mixerId, mode, muting) {
if (mode == null) { mode = this.mixMode; }
this.fillTrackVolumeObject(mixerId, mode);
context.trackVolumeObject.mute = muting;
console.log('before SessionSetControlState', mixerId, mode)
await context.jamClient.SessionSetControlState(mixerId, mode);
console.log('after SessionSetControlState', mixerId, mode)
// keep state of mixer in sync with backend
const mixer = this.getMixer(mixerId, mode);
mixer.mute = muting;
}`
getOriginalVolume: (mixers, gainType) ->
originalVolume = null

View File

@ -65,27 +65,48 @@ void removeSearchPath(int typeId, QString pathToRemove);
onPlatformChanged: (platform) ->
@platform = platform
onReset: (loadProfile) ->
logger.debug("ConfigureTracksStore:reset", this)
@trackNumber = null
@editingTrack = null
# onReset: (loadProfile) ->
# logger.debug("ConfigureTracksStore:reset", this)
# @trackNumber = null
# @editingTrack = null
# you have to load the current profile in order to see track info, which we need
#if loadProfile
#currentProfile = context.jamClient.LastUsedProfileName();
#result = context.jamClient.FTUELoadAudioConfiguration(currentProfile);
# # you have to load the current profile in order to see track info, which we need
# #if loadProfile
# #currentProfile = context.jamClient.LastUsedProfileName();
# #result = context.jamClient.FTUELoadAudioConfiguration(currentProfile);
@loadChannels()
@loadTrackInstruments()
# @loadChannels()
# @loadTrackInstruments()
#if force || context.jamClient.hasVstAssignment()
# @performVstScan()
# #if force || context.jamClient.hasVstAssignment()
# # @performVstScan()
@listVsts()
@performMidiScan()
@listPaths()
@changed()
# @listVsts()
# @performMidiScan()
# @listPaths()
# @changed()
onReset: `async function(loadProfile) {
logger.debug("ConfigureTracksStore:reset", this);
this.trackNumber = null;
this.editingTrack = null;
// you have to load the current profile in order to see track info, which we need
//if loadProfile
//currentProfile = context.jamClient.LastUsedProfileName();
//result = context.jamClient.FTUELoadAudioConfiguration(currentProfile);
await this.loadChannels();
await this.loadTrackInstruments();
//if force || context.jamClient.hasVstAssignment()
// @performVstScan()
await this.listVsts();
await this.performMidiScan();
await this.listPaths();
this.changed();
}`
# onEnableVst: () ->
# logger.debug("enabling VSTs")
@ -101,10 +122,10 @@ void removeSearchPath(int typeId, QString pathToRemove);
logger.debug("enabling VSTs");
await context.jamClient.VSTLoad();
return setTimeout((() => {
this.listVsts();
setTimeout((async () => {
await this.listVsts();
return this.changed();
this.changed();
}
), 250);
}`
@ -153,8 +174,8 @@ void removeSearchPath(int typeId, QString pathToRemove);
onClearVsts: `async function() {
await context.jamClient.VSTClearAll();
return setTimeout((() => {
this.listVsts();
return setTimeout((async () => {
await this.listVsts();
return this.changed();
}
@ -165,23 +186,45 @@ void removeSearchPath(int typeId, QString pathToRemove);
logger.debug("manage vst selected")
@app.layout.showDialog('manage-vsts-dialog')
onVstScanComplete: () ->
# XXX must wait a long time to get track assignments after scan/
logger.debug("vst scan complete")
@scanningVsts = false
setTimeout((() =>
@listVsts()
@changed()
), 100 )
# onVstScanComplete: () ->
# # XXX must wait a long time to get track assignments after scan/
# logger.debug("vst scan complete")
# @scanningVsts = false
# setTimeout((() =>
# @listVsts()
# @changed()
# ), 100 )
onVstScanComplete: `function() {
// XXX must wait a long time to get track assignments after scan/
logger.debug("vst scan complete");
this.scanningVsts = false;
setTimeout((async () => {
await this.listVsts();
this.changed();
}
), 100 );
}`
onVstChanged: () ->
setTimeout()
logger.debug("vst changed")
# onVstChanged: () ->
# setTimeout()
# logger.debug("vst changed")
setTimeout((() =>
@listVsts()
@changed()
), 0)
# setTimeout((() =>
# @listVsts()
# @changed()
# ), 0)
onVstChanged: `function() {
setTimeout();
logger.debug("vst changed");
setTimeout((async () => {
await this.listVsts();
this.changed();
}
), 0);
}`
# listPaths: () ->
# @scanPaths = context.jamClient.VSTListSearchPaths()
@ -208,8 +251,8 @@ void removeSearchPath(int typeId, QString pathToRemove);
onAddSearchPath: `async function(path) {
logger.debug("VSTAddSearchPath: " + path);
await context.jamClient.VSTAddSearchPath(this.vstTypeId(), path);
this.listPaths();
return this.changed();
await this.listPaths();
this.changed();
}`
# onRemoveSearchPath: (path) ->
@ -221,7 +264,7 @@ void removeSearchPath(int typeId, QString pathToRemove);
onRemoveSearchPath: `async function(path) {
logger.debug("VSTRemoveSearchPath: " + path);
await context.jamClient.VSTRemoveSearchPath(this.vstTypeId(), path);
this.listPaths();
await this.listPaths();
this.changed();
}`
@ -252,9 +295,14 @@ void removeSearchPath(int typeId, QString pathToRemove);
this.vstTrackAssignments = await context.jamClient.VSTListTrackAssignments();
}`
onMidiScan: () ->
@performMidiScan()
@changed()
# onMidiScan: () ->
# @performMidiScan()
# @changed()
onMidiScan: `async function() {
await this.performMidiScan();
this.changed();
}`
# performMidiScan: () ->
@ -709,8 +757,8 @@ void removeSearchPath(int typeId, QString pathToRemove);
}
// no way to unset VST assignment yet
return setTimeout((() => (
this.listVsts(),
return setTimeout((async () => (
await this.listVsts(),
this.changed()
)), 250);
@ -887,7 +935,7 @@ void removeSearchPath(int typeId, QString pathToRemove);
}
//@performVstScan()
this.performMidiScan();
await this.performMidiScan();
this.changed();
@ -959,8 +1007,8 @@ void removeSearchPath(int typeId, QString pathToRemove);
await context.jamClient.VST_EnableMidiForTrack(this.trackNumber - 1, true, midiInterface);
}
return setTimeout((() => (
this.listVsts(),
setTimeout((async () => (
await this.listVsts(),
this.changed()
)), 250);

View File

@ -105,7 +105,7 @@ rest = context.JK.Rest()
# TODO - no guarantee range will be -80 to 20. Get from the
# GetControlState for this mixer which returns min/max
# value is a DB value from -80 to 20. Convert to float from 0.0-1.0
console.log('handleBridgeCallback@mixers',@mixers)
#console.log('handleBridgeCallback@mixers',@mixers)
@mixers.updateVU(mixerId, mode, (leftValue + 80) / 80, leftClipping, (rightValue + 80) / 80, rightClipping)
#@mixers.updateVU(mixerId + "_vur", (rightValue + 80) / 80, rightClipping)
@ -153,7 +153,6 @@ rest = context.JK.Rest()
# @issueChange()
onSessionChange: `async function(session) {
console.log('onSessionChange', session)
if(!session){ return }
if (!session.inSession()) { this.sessionEnded(); }
@ -167,15 +166,27 @@ rest = context.JK.Rest()
return this.issueChange();
}`
onMute: (mixers, muting) ->
# onMute: (mixers, muting) ->
mixers = [mixers] unless $.isArray(mixers)
# mixers = [mixers] unless $.isArray(mixers)
for mixer in mixers
@mixers.mute(mixer.id, mixer.mode, muting);
# for mixer in mixers
# @mixers.mute(mixer.id, mixer.mode, muting);
# simulate a state change to cause a UI redraw
@issueChange()
# # simulate a state change to cause a UI redraw
# @issueChange()
onMute: `async function(mixers, muting) {
if (!$.isArray(mixers)) { mixers = [mixers]; }
for (let mixer of Array.from(mixers)) {
await this.mixers.mute(mixer.id, mixer.mode, muting);
}
// simulate a state change to cause a UI redraw
this.issueChange();
}`
onFaderChanged: (data, mixers, gainType, controlGroup) ->