Push dev work to master #2
7
index.js
7
index.js
|
@ -121,11 +121,10 @@ function rDelay (req, res, next) {
|
||||||
|
|
||||||
function rFrame (req, res, next) {
|
function rFrame (req, res, next) {
|
||||||
log.info('/frame', { method : req.method })
|
log.info('/frame', { method : req.method })
|
||||||
intval.frame(true, 0, () => {
|
intval.frame(true, 0, (dir, len) => {
|
||||||
log.info('frame stopped')
|
res.send({ dir : true, len : len})
|
||||||
|
return next()
|
||||||
})
|
})
|
||||||
res.send({})
|
|
||||||
return next()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function rStatus (req, res, next) {
|
function rStatus (req, res, next) {
|
||||||
|
|
|
@ -297,7 +297,6 @@ intval.frame = function (dir = null, time = null, cb = () => {}) {
|
||||||
}
|
}
|
||||||
if (time !== 0) {
|
if (time !== 0) {
|
||||||
intval._state.frame.paused = true
|
intval._state.frame.paused = true
|
||||||
|
|
||||||
if (dir) {
|
if (dir) {
|
||||||
setTimeout(intval._pause, intval._frame.open)
|
setTimeout(intval._pause, intval._frame.open)
|
||||||
//log.info('frame', { pausing : time + intval._frame.open })
|
//log.info('frame', { pausing : time + intval._frame.open })
|
||||||
|
@ -314,7 +313,9 @@ intval.frame = function (dir = null, time = null, cb = () => {}) {
|
||||||
}, time + intval._frame.closed)
|
}, time + intval._frame.closed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
intval._state.frame.cb = cb
|
intval._state.frame.cb = (len) => {
|
||||||
|
cb(dir, len)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Start a sequence of frames, using defaults or explicit instructions
|
* Start a sequence of frames, using defaults or explicit instructions
|
||||||
|
|
Loading…
Reference in New Issue