Skip to content

Commit

Permalink
Version 2.0 with video projector support! File format changed for son…
Browse files Browse the repository at this point in the history
…gs --> redo songs if you have old datas.
  • Loading branch information
reaby committed Oct 10, 2021
1 parent e341b46 commit 4a8764f
Show file tree
Hide file tree
Showing 19 changed files with 1,467 additions and 1,525 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# LoistoTxt
# LoistoTxt 2.0

Notice: Songs data format has been changed since version 1.3.1, app will crash if you attempt to load old files...

Song lyrics and lower 3rd titles displayer to obs, vmix or any casting software that supports browser source. Additionally you can remote control whitelisted scenes at OBS (additional plugin required for this).
Optionally you can control lights on [QLC+ lightdesk app](https://www.qlcplus.org/).

Expand Down Expand Up @@ -59,14 +62,23 @@ After app starts, it says something like this:
http://localhost:3000/admin

OBS add new "browser source" and use this address:
http://localhost:3000
http://localhost:3000/video

Projectors use this address:
http://localhost:3000/


Admin interface is without any passwords for now, since well, I don't need such at our production, and you should run this at a private network anyway...

And for OBS, like the console window says, add a new `browser source`, and paste the address there. You might need to click refresh source, if you restart the service, but it should auto connect anyway after you get initial connetion.
See wiki article `getting started` for tutorial.

## Video projectors

A new feature is ability to use video projectors in addition to stream view.
Background can be set to the projectors view with backgrounds-tab.
Placing .jpg, .png, or .mp4 files at `data/backgrounds` folder to load, notice if you run this outside of intranet the file sizes must be optimized. Videos will loop.

## QLC+ integration

To enable qlcplus remote control, you must add `--web` to the shortcut that opens the app.
Expand Down
10 changes: 2 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const logger = require('morgan');
const sassMiddleware = require('node-sass-middleware');
const indexRouter = require('./routes/index');
const fs = require('fs');
const app = express();
Expand All @@ -18,6 +17,7 @@ console.log("LoistoTxt starting...");
CheckDir("./data");
CheckDir("./data/songs");
CheckDir("./data/shows");
CheckDir("./data/backgrounds");

if (config.obs.enabled) {
connectObs();
Expand All @@ -35,14 +35,8 @@ app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(sassMiddleware({
src: path.join(__dirname, 'public'),
dest: path.join(__dirname, 'public'),
indentedSyntax: true, // true = .sass and false = .scss
sourceMap: true
}));
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'data/songs')));
app.use("/background/", express.static(path.join(__dirname, 'data/backgrounds')));
app.use('/', indexRouter);

// catch 404 and forward to error handler
Expand Down
29 changes: 23 additions & 6 deletions bin/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ class websocket {
currentText: "",
currentShow: "",
currentSong: "",
currentSlideText: "",
showData: {
name: "",
titles: [],
songs: [],
lights: {},
},

blackout: false,
background: "",
showTitle: false,
titles: {
index: -1,
Expand All @@ -34,7 +36,8 @@ class websocket {
title2: "",
sub2: ""
}
}
};

this.qlc = qlc || {};
this.obs = obs || {};
this.io = io;
Expand Down Expand Up @@ -83,6 +86,8 @@ class websocket {
/** @var {SocketIO.client} client */
client => {
io.emit("updateAll", self.serverOptions);
io.emit("syncClient", self.serverOptions);

if (config.obs.enabled) {
self.getObsStatus(client);
}
Expand Down Expand Up @@ -117,21 +122,33 @@ class websocket {

client.on("showTitles", data => {
self.serverOptions.showTitle = true;
self.serverOptions.currentText = "";
// self.serverOptions.currentText = "";
self.serverOptions.titles = data;
io.emit("update", self.serverOptions);
});

client.on("setBackground", data => {
self.serverOptions.background = data;
io.emit("callback.setBackground", self.serverOptions);
});

client.on("toggleBlackout", data => {
self.serverOptions.blackout = !self.serverOptions.blackout;
io.emit("update", self.serverOptions);
});


client.on("hideTitles", data => {
self.serverOptions.showTitle = false;
self.serverOptions.currentText = "";
// self.serverOptions.currentText = "";
self.serverOptions.titles = {};
io.emit("update", self.serverOptions);
});

client.on("setText", data => {
self.serverOptions.showTitle = false;
self.serverOptions.currentText = data.replace("\n", "<br/>");
self.serverOptions.currentText = data.text.replace("\n", "<br/>");
self.serverOptions.currentSlideText = data.slideText.replace("\n", "<br/>");
io.emit("update", self.serverOptions);
})

Expand Down Expand Up @@ -279,7 +296,7 @@ class websocket {
});

client.on("loadSong", file => {
self.serverOptions.currentSong = file;
self.serverOptions.currentSong = file;
io.emit("callback.loadSong", self.getSong(file));
});
});
Expand Down
4 changes: 2 additions & 2 deletions bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ function onListening() {
: 'port ' + addr.port;

console.log('\nAdmin interface now available:\nhttp://' + ip.address() + ":" + addr.port + "/admin\n");
console.log('OBS add new "browser source" and use this address:\nhttp://' + ip.address() + ":" + addr.port + "\n");

console.log('OBS add new "browser source" and use this address:\nhttp://' + ip.address() + ":" + addr.port + "/video\n");
console.log('Projectors use this address:\nhttp://' + ip.address() + ":" + addr.port + "\n");
}
Loading

0 comments on commit 4a8764f

Please sign in to comment.