re-open jamtrack

This commit is contained in:
Seth Call 2016-09-12 22:25:13 -05:00
parent 57b1bebf44
commit 493ac18650
8 changed files with 54 additions and 9 deletions

View File

@ -181,6 +181,7 @@
}
function initializeInfluxDB() {
/**
context.stats = new InfluxDB({
"host" : gon.global.influxdb_host,
"port" : gon.global.influxdb_port,
@ -190,6 +191,8 @@
});
context.stats.write = context.stats.writePoint;
*/
context.stats = {write:function() {}}
}
function initializeStun(app) {

View File

@ -9,7 +9,7 @@
var $screen = null;
function beforeShow(data) {
}
function afterShow(data) {

View File

@ -298,7 +298,9 @@
}
}
monitorPlaybackTimeout = setTimeout(monitorRecordingPlayback, 500);
if (setTimeout) {
monitorPlaybackTimeout = setTimeout(monitorRecordingPlayback, 500);
}
}
function monitorRecordingPlayback() {

View File

@ -32,10 +32,16 @@ mixins.push(Reflux.listenTo(JamTrackStore, 'onJamTrackStateChanged'))
tempos : [ 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 63, 66, 69, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 126, 132, 138, 144, 152, 160, 168, 176, 184, 192, 200, 208 ]
onJamTrackStateChanged: (jamTrackState) ->
if window.unloaded
return
@monitorControls(@state.controls, @state.mediaSummary, jamTrackState)
@setState({jamTrackState: jamTrackState})
onMediaStateChanged: (changes) ->
if window.unloaded
return
if changes.playbackStateChanged
if @state.controls?
if changes.playbackState == 'play_start'
@ -51,6 +57,8 @@ mixins.push(Reflux.listenTo(JamTrackStore, 'onJamTrackStateChanged'))
@setState({time: changes.time})
onInputsChanged: (sessionMixers) ->
if window.unloaded
return
session = sessionMixers.session
mixers = sessionMixers.mixers
@ -60,9 +68,16 @@ mixins.push(Reflux.listenTo(JamTrackStore, 'onJamTrackStateChanged'))
metro = mixers.metro
@monitorControls(@state.controls, mediaSummary, @state.jamTrackState)
@setState({mediaSummary: mediaSummary, metro: metro})
@updateMetronomeDetails(metro, @state.initializedMetronomeControls)
state = {mediaSummary: mediaSummary, metro: metro}
try
@setState(state)
catch e
logger.error('MediaControls: unable to set state', state, e)
try
@updateMetronomeDetails(metro, @state.initializedMetronomeControls)
catch e
logger.error('MediaControls: unable to update metronome details', e)
updateMetronomeDetails: (metro, initializedMetronomeControls) ->
logger.debug("MediaControls: setting tempo/sound/cricket", metro)
@ -197,6 +212,8 @@ mixins.push(Reflux.listenTo(JamTrackStore, 'onJamTrackStateChanged'))
@updateMetronomeDetails(metro, true)
@setState({initializedMetronomeControls: true})
shouldComponentUpdate:() ->
return !window.unloaded
componentDidUpdate: (prevProps, prevState) ->
@tryPrepareMetronome(@state.metro)

View File

@ -60,14 +60,25 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
session = sessionMixers.session
mixers = sessionMixers.mixers
if @unloaded
#console.log("PopupMediaControls unloaded. ignore onMixersChnaged")
return
@setState(@updateFromMixerHelper(mixers, session))
onMediaStateChanged: (changes) ->
if @unloaded
#console.log("PopupMediaControls unloaded. ignore onMixersChnaged")
return
if changes.currentTimeChanged && @root?
@setState({time: changes.time})
onJamTrackChanged: (changes) ->
if @unloaded
#console.log("PopupMediaControls unloaded. ignore onMixersChnaged")
return
logger.debug("PopupMediaControls: jamtrack changed", changes)
@setState({jamTrackState: changes})
@ -446,7 +457,7 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
`<div className="media-controls-popup">
{header}
<MediaControls disabled={this.state.downloadingJamTrack || this.disableLoading}/>
<MediaControls unloaded={this.unloaded} disabled={this.state.downloadingJamTrack || this.disableLoading}/>
{extraControls}
<div className="actions">
{helpButton}
@ -454,7 +465,12 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
</div>
</div>`
windowUnloaded: () ->
logger.debug('PopupMediaControls: window uploaded')
@unloaded = true
window.unloaded = true
SessionActions.closeMedia(false) unless window.DontAutoCloseMedia
toggleMyMixes: (e) ->
@ -691,6 +707,10 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
@resizeWindow()
setTimeout(@resizeWindow, 1000)
shouldComponentUpdate: () ->
console.log("THIS UNLOADED", @unloaded)
return !@unloaded
resizeWindow: () =>
$container = $('#minimal-container')
width = $container.width()

View File

@ -28,7 +28,7 @@ ChannelGroupIds = context.JK.ChannelGroupIds
SessionActions.downloadingJamTrack(false)
@setState({downloadJamTrack: null})
SessionActions.closeMedia(true)
SessionActions.closeMedia.trigger(true)
#inputsChangedProcessed: (state) ->

View File

@ -936,8 +936,9 @@ ConfigureTracksActions = @ConfigureTracksActions
updateSessionInfo: (session, force) ->
if force == true || @currentTrackChanges < session.track_changes_counter
logger.debug("updating current track changes from %o to %o", @currentTrackChanges, session.track_changes_counter)
@currentTrackChanges = session.track_changes_counter;
@sendClientParticipantChanges(@currentSession, session);
@currentTrackChanges = session.track_changes_counter
@sendClientParticipantChanges(@currentSession, session)
logger.debug('update current session')
@updateCurrentSession(session);
#if(callback != null) {
# callback();
@ -1039,6 +1040,7 @@ ConfigureTracksActions = @ConfigureTracksActions
context.jamClient.UpdateSessionInfo({})
#logger.debug("session changed")
logger.debug("issue change")
@issueChange()
ensureConnected: () ->

View File

@ -11,7 +11,8 @@ task :all_jobs do
ENV['FORK_PER_JOB'] = 'false'
ENV['QUEUE'] = ENV['QUEUE'] || '*'
Resque.logger = Rails.logger
#Resque.logger = Logger.new(STDOUT)
#ActiveRecord::Base.logger = Logger.new(STDOUT)
Rake::Task['resque:work'].invoke
end