working recordings

This commit is contained in:
Seth Call 2016-11-04 11:18:58 -05:00
parent a8b181394c
commit ffd0469f09
16 changed files with 141 additions and 34 deletions

View File

@ -272,7 +272,9 @@ module JamRuby
music_session.connections.each do |connection|
connection.tracks.each do |track|
recording.recorded_tracks << RecordedTrack.create_from_track(track, recording)
if connection.client_role != 'child'
recording.recorded_tracks << RecordedTrack.create_from_track(track, recording)
end
end
connection.video_sources.each do |video|

View File

@ -65,6 +65,8 @@
return;
}
console.log("GetLocalRecordingState", localResults)
$.each(claimedRecordings, function(index, claimedRecording) {
var options = {

View File

@ -10,6 +10,8 @@
var $dialog = null;
var $saveVideoCheckbox = null
var $uploadToYoutube = null
var timeout = null
var CLIENT_ROLE = context.JK.CLIENT_ROLE
function resetForm() {
// remove all display errors
@ -44,6 +46,47 @@
resetForm();
if(context.jamClient.getClientParentChildRole() == CLIENT_ROLE.CHILD) {
logger.debug("child client; launching preview after xfer");
$('#recording-finished-dialog span.nowait').addClass('hidden')
$('#recording-finished-dialog span.pleasewait').removeClass('hidden')
$('#recording-finished-dialog .preview-area').css('visibility', 'hidden')
$('#recording-finished-dialog form').css('visibility', 'hidden')
waitForMixTransfer()
}
else {
console.log("normal client; launching preview immediately")
$('#recording-finished-dialog span.pleasewait').addClass('hidden')
$('#recording-finished-dialog span.nowait').removeClass('hidden')
$('#recording-finished-dialog .preview-area').css('visibility', 'visible')
$('#recording-finished-dialog form').css('visibility', 'visible')
launchPreview();
}
}
function waitForMixTransfer() {
timeout = setTimeout(function() {
console.log("checking for file transfer", window.RecordingStore.mixTransferred)
if(window.RecordingStore.mixTransferred) {
$('#recording-finished-dialog span.pleasewait').addClass('hidden')
$('#recording-finished-dialog span.nowait').removeClass('hidden')
$('#recording-finished-dialog .preview-area').css('visibility', 'visible')
$('#recording-finished-dialog form').css('visibility', 'visible')
timeout = null
launchPreview()
}
else {
waitForMixTransfer();
}
}, 1000)
}
function launchPreview() {
var parentSelector = '#recording-finished-dialog div.genre-selector';
context.JK.GenreSelectorHelper.render(parentSelector);
@ -117,10 +160,12 @@
playbackControls.startMonitor();
}
}
}
function afterHide() {
if(timeout) {
clearTimeout(timeout)
timeout = null
}
if(recording && recording.video) {
var name = $('#recording-finished-dialog form input[name=name]').val();
name = name.replace(/[^A-Za-z0-9\-\ ]/g, '');

View File

@ -496,7 +496,10 @@
monitoring = false;
logger.debug("playbackControl.stopMonitor")
if (monitorPlaybackTimeout != null) {
clearTimeout(monitorPlaybackTimeout);
if(clearTimeout) {
clearTimeout(monitorPlaybackTimeout);
}
monitorPlaybackTimeout = null;
}
}

View File

@ -716,7 +716,6 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
setTimeout(@resizeWindow, 1000)
shouldComponentUpdate: () ->
console.log("THIS UNLOADED", @unloaded)
return !@unloaded
resizeWindow: () =>

View File

@ -36,6 +36,10 @@ if accessOpener
# this.setState(chatMixer: mixers.chatMixer)
onRecordingStateChanged: (recordingState) ->
if @unloaded
#console.log("PopupMediaControls unloaded. ignore onMixersChnaged")
return
this.setState(isRecording: recordingState.isRecording, recordedOnce: this.state.recordedOnce || recordingState.isRecording)
startStopRecording: () ->
@ -165,6 +169,9 @@ if accessOpener
</div>`
windowUnloaded: () ->
@unloaded = true
window.unloaded = true
window.opener.RecordingActions.recordingControlsClosed()
onChatHelp: (e) ->
@ -215,6 +222,9 @@ if accessOpener
$root = jQuery(this.getDOMNode())
$includeChat = $root.find('#include-chat')
shouldComponentUpdate: () ->
return !@unloaded
resizeWindow: () =>
$container = $('#minimal-container')
width = $container.width()

View File

@ -81,7 +81,7 @@ MixerActions = @MixerActions
<div>Volume</div>
<div>{monitorVolumeLeft}dB</div>
</div>
<SessionTrackGain mixers={this.state.inputGroupMixers} gainType='music' />
<SessionTrackGain mixers={this.state.inputGroupMixers} gainType='music' controlGroup="music" />
<div className={monitorMuteClasses} data-control="mute" onClick={this.handleAudioInputMute}/>
<input type="checkbox" name="mute"/>
@ -108,7 +108,7 @@ MixerActions = @MixerActions
<div>Volume</div>
<div>{chatVolumeLeft}dB</div>
</div>
<SessionTrackGain mixers={this.state.chatGroupMixers} />
<SessionTrackGain mixers={this.state.chatGroupMixers} controlGroup="chat" />
<div className={chatMuteClasses} data-control="mute" onClick={this.handleChatMute}/>
<input type="checkbox" name="mute"/>

View File

@ -180,6 +180,8 @@ StatsInfo = {
framesize = '?'
if audio.framesize == 1.0
framesize = '1 ms'
else if audio.framesize == 2.0
framesize = '1 ms'
else if audio.framesize == 2.5
framesize = '2.5 ms'
else if audio.framesize == 5
@ -242,7 +244,11 @@ StatsInfo = {
onStatsChanged: (stats) ->
stats = window.SessionStatsStore.stats
if stats?
clientStats = stats[@props.participant.client_id]
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)
clientStats = stats.parent[@props.participant.client_id]
else
clientStats = stats[@props.participant.client_id]
else
clientStats = null
@setState({stats: clientStats})

View File

@ -8,6 +8,7 @@ MIX_MODES = context.JK.MIX_MODES
propTypes: {
gainType: React.PropTypes.string
controlGroup: React.PropTypes.string
}
getInitialState: () ->
@ -22,12 +23,11 @@ MIX_MODES = context.JK.MIX_MODES
mixers = @state.mixers.mixer
# if this is a media track, jam track , or media category, affect volume of both mixer and opposing mixer
if @state.mixers.mixer.group_id == ChannelGroupIds.MediaTrackGroup || @state.mixers.mixer.group_id == ChannelGroupIds.JamTrackGroup || ((@state.mixers.mixer.group_id == ChannelGroupIds.MonitorCatGroup || @state.mixers.mixer.group_id == ChannelGroupIds.MasterCatGroup) && @state.mixers.mixer.name == CategoryGroupIds.MediaTrack)
MixerActions.faderChanged(data, [@state.mixers.mixer, @state.mixers.oppositeMixer], @props.gainType)
MixerActions.faderChanged(data, [@state.mixers.mixer, @state.mixers.oppositeMixer], @props.gainType, @props.controlGroup)
else
MixerActions.faderChanged(data, mixers, @props.gainType)
MixerActions.faderChanged(data, mixers, @props.gainType, @props.controlGroup)
render: () ->
# mixer can be a single item or array

View File

@ -11,4 +11,5 @@ context = window
abortedRecording: {}
openRecordingControls: {}
recordingControlsClosed: {}
mixTransferred: {}
})

View File

@ -730,26 +730,43 @@ MIX_MODES = context.JK.MIX_MODES;
originalVolume
faderChanged: (data, mixers, gainType) ->
faderChanged: (data, mixers, gainType, controlGroup) ->
mixers = [mixers] unless $.isArray(mixers)
originalVolume = @getOriginalVolume(mixers, gainType)
for mixer in mixers
broadcast = !(data.dragging) # If fader is still dragging, don't broadcast
mixer = @fillTrackVolumeObject(mixer.id, mixer.mode, broadcast)
if controlGroup?
mixers = [mixers[0]]
relative = gainType == 'music' && (mixer.name == CategoryGroupIds.UserMedia || mixer.name == CategoryGroupIds.MediaTrack)
for mixer in mixers
broadcast = !(data.dragging) # If fader is still dragging, don't broadcast
mixer = @fillTrackVolumeObject(mixer.id, mixer.mode, broadcast)
@setMixerVolume(mixer, data.percentage, relative, originalVolume)
relative = gainType == 'music' && (mixer.name == CategoryGroupIds.UserMedia || mixer.name == CategoryGroupIds.MediaTrack)
# keep state of mixer in sync with backend
mixer = @getMixer(mixer.id, mixer.mode)
mixer.volume_left = context.trackVolumeObject.volL
@setMixerVolume(mixer, data.percentage, relative, originalVolume, controlGroup)
#if groupId == ChannelGroupIds.UserMusicInputGroup
# # there may be other mixers with this same ID in the case of a Peer Music Stream, so update them as well
# context.JK.FaderHelpers.setFaderValue(mixerId, data.percentage)
# keep state of mixer in sync with backend
mixer = @getMixer(mixer.id, mixer.mode)
mixer.volume_left = context.trackVolumeObject.volL
else
for mixer in mixers
broadcast = !(data.dragging) # If fader is still dragging, don't broadcast
mixer = @fillTrackVolumeObject(mixer.id, mixer.mode, broadcast)
relative = gainType == 'music' && (mixer.name == CategoryGroupIds.UserMedia || mixer.name == CategoryGroupIds.MediaTrack)
@setMixerVolume(mixer, data.percentage, relative, originalVolume)
# keep state of mixer in sync with backend
mixer = @getMixer(mixer.id, mixer.mode)
mixer.volume_left = context.trackVolumeObject.volL
#if groupId == ChannelGroupIds.UserMusicInputGroup
# # there may be other mixers with this same ID in the case of a Peer Music Stream, so update them as well
# context.JK.FaderHelpers.setFaderValue(mixerId, data.percentage)
initGain: (mixer) ->
if $.isArray(mixer)
@ -792,7 +809,7 @@ MIX_MODES = context.JK.MIX_MODES;
mixer = @getMixer(mixer.id, mixer.mode)
mixer.loop = context.trackVolumeObject.loop
setMixerVolume: (mixer, volumePercent, relative, originalVolume) ->
setMixerVolume: (mixer, volumePercent, relative, originalVolume, controlGroup) ->
###
// The context.trackVolumeObject has been filled with the mixer values
// that go with mixerId, and the range of that mixer
@ -822,7 +839,15 @@ MIX_MODES = context.JK.MIX_MODES;
else
context.trackVolumeObject.volL = newVolume
context.trackVolumeObject.volR = newVolume
context.jamClient.SessionSetControlState(mixer.id, mixer.mode);
if controlGroup?
if mixer.mode == MIX_MODES.PERSONAL
controlGroupsArg = 0
else
controlGroupsArg = 1
context.jamClient.setSessionMixerCategoryPlayoutState(controlGroup == 'music', controlGroupsArg);
else
context.jamClient.SessionSetControlState(mixer.id, mixer.mode);
percentFromMixerValue: (min, max, value) ->
try

View File

@ -1,6 +1,7 @@
$ = jQuery
context = window
logger = context.JK.logger
RecordingActions = @RecordingActions
SessionActions = @SessionActions
JamBlasterActions = @JamBlasterActions
@ -27,6 +28,9 @@ JamBlasterActions = @JamBlasterActions
JamBlasterActions.pairState(map)
else if map.cmd == 'jamblaster_tracks_updated'
JamBlasterActions.jamblasterTracksUpdated()
else if map.cmd == 'file_xfer_from_parent'
if map.filename && map.filename.indexOf('RT-mix.wav') > -1
RecordingActions.mixTransferred()
}
)

View File

@ -148,9 +148,9 @@ rest = context.JK.Rest()
# simulate a state change to cause a UI redraw
@issueChange()
onFaderChanged: (data, mixers, gainType) ->
onFaderChanged: (data, mixers, gainType, controlGroup) ->
@mixers.faderChanged(data, mixers, gainType)
@mixers.faderChanged(data, mixers, gainType, controlGroup)
@issueChange()

View File

@ -33,10 +33,11 @@ BackendToFrontendFPS = {
this.trigger({isRecording: @recordingModel.isRecording()})
onStartRecording: (recordVideo, recordChat) ->
frameRate = context.jamClient.GetCurrentVideoFrameRate() || 0;
frameRate = BackendToFrontendFPS[frameRate]
frameRate = 0
if recordVideo
if context.jamClient.GetCurrentVideoFrameRate?
frameRate = context.jamClient.GetCurrentVideoFrameRate() || 0;
frameRate = BackendToFrontendFPS[frameRate]
NoVideoRecordActive = 0
WebCamRecordActive = 1
@ -49,12 +50,14 @@ BackendToFrontendFPS = {
onStartingRecording: (details) ->
details.cause = 'starting'
@mixTransferred = false
this.trigger(details)
@popupRecordingControls() unless @recordingWindow?
onStartedRecording: (details) ->
details.cause = 'started'
@mixTransferred = false
this.trigger(details)
@popupRecordingControls() unless @recordingWindow?
@ -92,6 +95,9 @@ BackendToFrontendFPS = {
logger.debug("recording controls closed")
@recordingWindow = null
onMixTransferred: () ->
@mixTransferred = true
popupRecordingControls: () ->
logger.debug("poupRecordingControls")
@recordingWindow = window.open("/popups/recording-controls", 'Recording', 'scrollbars=yes,toolbar=no,status=no,height=315,width=340')

View File

@ -158,6 +158,7 @@ AggregateThresholds = SessionStatThresholds.aggregate
container[participant.id] = participant
return container
changed: () ->
@clientsWithAudio = {}

View File

@ -4,8 +4,11 @@
= image_tag "content/recordbutton-off.png", {:height => 20, :width => 20, :class => 'content-icon'}
%h1 recording finished
.dialog-inner
Fill out the fields below and click the "SAVE" button to save this recording to your library. If you do not want to
keep the recording, click the "DISCARD" button.
%span.nowait
Fill out the fields below and click the "SAVE" button to save this recording to your library. If you do not want to
keep the recording, click the "DISCARD" button.
%span.pleasewait
Please wait while we transfer the necessary audio files from your JamBlaster to your client...
%br/
%br/
%form.left.w40.mr20
@ -36,7 +39,7 @@
%input{:checked => "checked", :name => "is_public", :type => "checkbox"}/
%label{:for => "is_public"} Public Recording
/ <a href="#"><<img src="images/shared/icon_help.png" width="12" height="12" /></a>
.left.w50.ml30
.left.w50.ml30.preview-area
Preview Recording:
\#{render "clients/play_controls"}