Browse Source

studio improved

bob
BOBINOSCOPE 10 years ago
parent
commit
e1f8261635
7 changed files with 43 additions and 32 deletions
  1. BIN
      public/img/footer/m-cloclo.jpg
  2. BIN
      public/img/footer/m-cloclo.xcf
  3. 6
      routes/index.js
  4. 1
      tools/tools-gphoto2.js
  5. 8
      tools/tools-photobooth.js
  6. 58
      views/index.ejs
  7. 2
      views/view.ejs

BIN
public/img/footer/m-cloclo.jpg

Before After
Width: 1600  |  Height: 333  |  Size: 58 KiB Width: 1600  |  Height: 280  |  Size: 50 KiB

BIN
public/img/footer/m-cloclo.xcf

6
routes/index.js

@ -27,7 +27,7 @@ BOB_mod_router.get('/booth/build/:boothId', function(req, res, next) {
BOB_tol_booth.buildBooth(req.params.boothId, function(pErr) { BOB_tol_booth.buildBooth(req.params.boothId, function(pErr) {
BOB_cfg_config.io.emit('boothState'); BOB_cfg_config.io.emit('boothState');
BOB_var_boothInProgress -= 1; BOB_var_boothInProgress -= 1;
res.send(pErr);
res.json({ error: pErr, data : null, boothId: req.params.boothId});
}); });
}) })
@ -47,7 +47,7 @@ BOB_mod_router.get('/dslr/takepicture/:boothId/:pictId', function(req, res, next
/* GET view page. */ /* GET view page. */
BOB_mod_router.get('/download/final/hd/:pictId', function(req, res, next) { BOB_mod_router.get('/download/final/hd/:pictId', function(req, res, next) {
res.download('public/img/final/'+req.params.pictId);
res.download('/home/cocoon/workspace/bobinoscope/public/img/final/'+req.params.pictId);
}); });
@ -55,7 +55,7 @@ BOB_mod_router.get('/download/final/hd/:pictId', function(req, res, next) {
BOB_var_gamepad.init() BOB_var_gamepad.init()
// List the state of all currently attached devices // List the state of all currently attached devices
for (var i = 0, l = BOB_var_gamepad.numDevices(); i < l; i++) { for (var i = 0, l = BOB_var_gamepad.numDevices(); i < l; i++) {
console.log(i, BOB_var_gamepad.deviceAtIndex());
console.log(i, BOB_var_gamepad.deviceAtIndex(i));
} }
// Create a game loop and poll for events // Create a game loop and poll for events
setInterval(BOB_var_gamepad.processEvents, 16); setInterval(BOB_var_gamepad.processEvents, 16);

1
tools/tools-gphoto2.js

@ -20,6 +20,7 @@ function BOB_upCameraReference(pCallback) {
if (list.length === 0) { if (list.length === 0) {
return pCallback(); return pCallback();
} else { } else {
console.log(list)
BOB_var_camera = list[0]; BOB_var_camera = list[0];
console.log(BOB_var_camera.model); console.log(BOB_var_camera.model);
return pCallback(); return pCallback();

8
tools/tools-photobooth.js

@ -34,8 +34,6 @@ BOB_module.buildBooth = function(pBoothId, pCallback) {
.gravity('Center') .gravity('Center')
.resize(BOB_cfg_config.cropSize.width, BOB_cfg_config.cropSize.height, "^") .resize(BOB_cfg_config.cropSize.width, BOB_cfg_config.cropSize.height, "^")
.crop(BOB_cfg_config.cropSize.width, BOB_cfg_config.cropSize.height) .crop(BOB_cfg_config.cropSize.width, BOB_cfg_config.cropSize.height)
// .modulate(100, 0)
// .contrast(+2)
.write(dstPict, function(pErr) { .write(dstPict, function(pErr) {
if(pErr) console.log("Failed to resize picture", pErr) if(pErr) console.log("Failed to resize picture", pErr)
pCb() pCb()
@ -60,8 +58,8 @@ function BOB_generateBooth(pBoothId, pType, pCallback) {
outPict.fill(BOB_cfg_config.background); outPict.fill(BOB_cfg_config.background);
outPict.drawRectangle(0, 0, BOB_cfg_config.booths[pType].resolution.width, BOB_cfg_config.booths[pType].resolution.height); outPict.drawRectangle(0, 0, BOB_cfg_config.booths[pType].resolution.width, BOB_cfg_config.booths[pType].resolution.height);
outPict.draw('image Over 0,2080 1600,300 \''+BOB_cfg_config.footer+'\'');
// Draw footer
outPict.draw('image Over 0,2070 1600,280 \''+BOB_cfg_config.footer+'\'');
BOB_cfg_config.pictNames.forEach(function(pPictName, pIndex) { BOB_cfg_config.pictNames.forEach(function(pPictName, pIndex) {
var cmdDraw = 'image Over'; var cmdDraw = 'image Over';
@ -71,7 +69,7 @@ function BOB_generateBooth(pBoothId, pType, pCallback) {
cmdDraw += ','+BOB_cfg_config.booths[pType].layout[pIndex].height; cmdDraw += ','+BOB_cfg_config.booths[pType].layout[pIndex].height;
cmdDraw += ' \''+BOB_mod_path.join(prebuiltPath, pPictName)+'\''; cmdDraw += ' \''+BOB_mod_path.join(prebuiltPath, pPictName)+'\'';
console.log(cmdDraw);
// console.log(cmdDraw);
outPict.draw(cmdDraw); outPict.draw(cmdDraw);
}) })

58
views/index.ejs

@ -16,11 +16,20 @@
<div class="inner cover" style="height:900px;position:relative"> <div class="inner cover" style="height:900px;position:relative">
<div id="idBoothPanel" style="position:absolute;width:100%"> <div id="idBoothPanel" style="position:absolute;width:100%">
<div style="height:180px">
<div id="idViewTrigger">
<div style="padding-top:1em">
<div id="idViewCountdown" style="font-size:20em; display:none"></div>
<div id="idViewTrigger" style="display:block">
<h1 class="cover-heading">Prends ta face !</h1> <h1 class="cover-heading">Prends ta face !</h1>
</div> </div>
<div id="idViewCountdown" style="font-size:15em; display:none"></div>
<div id="idViewGenerating" style="display:none">
<h1 class="cover-heading">Bobinogramme <i>en cours de génération...</i></h1>
<br/><br/>
<h3>Merci de bien vouloir patienter<br/>une dizaine de secondes</h3>
</div>
<div id="idViewBobinogramme" style="display:none">
<img src="/img/final_ld/1438098902994.jpg" height="600px"/>
<h3 class="cover-heading">Retrouve ton <b>bobinogramme</b> sur <br/>http://192.168.1.2:3000</h3>
</div>
</div> </div>
<div id="idViewDoIt" style="font-size:8em; height:600px; display:none"> <div id="idViewDoIt" style="font-size:8em; height:600px; display:none">
Faites<br/> Faites<br/>
@ -72,7 +81,7 @@ socket.on('boothClick', function(pData) {
var BOB_var_context = { var BOB_var_context = {
boothOnGoing : false, boothOnGoing : false,
initTimer : 6,
initTimer : 3,
onGoingTimer : 0, onGoingTimer : 0,
boothId : null, boothId : null,
pictureId : 0 pictureId : 0
@ -159,24 +168,29 @@ function BOB_takeThe1Pictures() {
return; return;
} }
} }
// $('#idViewDoIt').hide();
// $('#idViewDoIt-theme').hide();
// BOB_var_themes.selectedId++;
// BOB_displayPictPreview(BOB_var_context.boothId, BOB_var_context.pictureId, function() {
BOB_var_context.pictureId += 1;
if( BOB_var_context.pictureId < 4 ) {
BOB_var_context.onGoingTimer = BOB_var_context.initTimer;
BOB_countdown();
} else {
BOB_var_context.boothOnGoing = false;
$.get('/booth/build/'+BOB_var_context.boothId);
$('#idViewCountdown').fadeOut(500, function() {
$('#idViewTrigger').fadeIn();
});
}
// })
BOB_var_context.pictureId += 1;
if( BOB_var_context.pictureId < 4 ) {
BOB_var_context.onGoingTimer = BOB_var_context.initTimer;
BOB_countdown();
} else {
$('#idViewCountdown').fadeOut(500, function() {
$('#idViewGenerating').fadeIn()
})
$.get('/booth/build/'+BOB_var_context.boothId, function(pResponse) {
$('#idViewBobinogramme > img').attr('src', '/img/final_ld/'+pResponse.boothId+'.jpg');
$('#idViewGenerating').fadeOut(500, function() {
$('#idViewBobinogramme').fadeIn(500, function() {
setTimeout(function(){
BOB_var_context.boothOnGoing = false;
$('#idViewBobinogramme').fadeOut(500, function() {
$('#idViewTrigger').fadeIn();
});
}, 10000)
})
})
});
}
}) })
} }

2
views/view.ejs

@ -21,8 +21,6 @@
</body> </body>
<!-- Latest compiled and minified JQuery --> <!-- Latest compiled and minified JQuery -->
<script src="/js/jquery-1.11.2.min.js"></script> <script src="/js/jquery-1.11.2.min.js"></script>
<!-- Latest compiled and minified javaScript bootstrap-->
<script src="/js/bootstrap.min.js"></script>
<!-- Getting the Socket.IO Client --> <!-- Getting the Socket.IO Client -->
<script src="/js/socket.io-1.3.4.js"></script> <script src="/js/socket.io-1.3.4.js"></script>
</html> </html>

Loading…
Cancel
Save