remember play state
This commit is contained in:
parent
be11f015b9
commit
f829eea911
1 changed files with 12 additions and 0 deletions
|
@ -160,10 +160,15 @@ const Record = function(tp) {
|
||||||
const liveUpdater = new LiveUpdater(tp, buffy);
|
const liveUpdater = new LiveUpdater(tp, buffy);
|
||||||
let isInitialized = false;
|
let isInitialized = false;
|
||||||
|
|
||||||
|
let remember = {};
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
if (!isInitialized) {
|
if (!isInitialized) {
|
||||||
tp.core.onChange(tp.sheet.sequence.pointer.playing, (playing) => {
|
tp.core.onChange(tp.sheet.sequence.pointer.playing, (playing) => {
|
||||||
if (isRecording === RECORDING && !playing) {
|
if (isRecording === RECORDING && !playing) {
|
||||||
|
// when you hit space to stop recording,
|
||||||
|
// we want to keep it paused
|
||||||
|
remember.isPlaying = false;
|
||||||
stopRecording();
|
stopRecording();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -440,6 +445,7 @@ const Record = function(tp) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
lastPositions = {};
|
lastPositions = {};
|
||||||
|
remember.isPlaying = tp.core.val(tp.sheet.sequence.pointer.playing);
|
||||||
tp.sheet.sequence.pause();
|
tp.sheet.sequence.pause();
|
||||||
const layerKeys = Object.keys(hot);
|
const layerKeys = Object.keys(hot);
|
||||||
layerKeys.forEach((layerID) => {
|
layerKeys.forEach((layerID) => {
|
||||||
|
@ -554,6 +560,12 @@ const Record = function(tp) {
|
||||||
.classList.remove('visible');
|
.classList.remove('visible');
|
||||||
console.log('Record::stopRecording', 'stopped recording');
|
console.log('Record::stopRecording', 'stopped recording');
|
||||||
isRecording = NOT_RECORDING;
|
isRecording = NOT_RECORDING;
|
||||||
|
|
||||||
|
if (remember.isPlaying) {
|
||||||
|
tp.sheet.sequence.play();
|
||||||
|
} else {
|
||||||
|
tp.sheet.sequence.pause();
|
||||||
|
}
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue