Skip to content

Commit 713aebf

Browse files
committed
Release 1.0.0. Purged old commits.
0 parents  commit 713aebf

File tree

151 files changed

+26662
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+26662
-0
lines changed

.gitignore

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
############################
2+
# SmartPX's unwanted files #
3+
############################
4+
.vscode/
5+
node_modules/
6+
pkg-builds/
7+
zip-builds/
8+
ZIP_TEMP/
9+
Distro/
10+
bin/
11+
viz/
12+
*.mov
13+
*.mp4
14+
*.mp3
15+
SmartPX_log*.txt
16+
.env
17+
env.txt
18+
.log
19+
devnotes.txt
20+
MEDIA/*
21+
DATAROOT/*
22+
ASSETS/media/video/*
23+
ASSETS/template_stash/
24+
ASSETS/templates/smartpx_internal/
25+
notes/
26+
notes2/
27+
cg20.*
28+
START_GC_IN_BACKGROUND.bat
29+
BUILD_PACKAGES.BAT
30+
BUILD_A_ZIP_PACK.BAT
31+
SPX_STARTER_MENU.bat
32+
config*.json
33+
34+
######################
35+
# OS generated files #
36+
######################
37+
.DS_Store
38+
.DS_Store?
39+
._*
40+
.Spotlight-V100
41+
.Trashes
42+
ehthumbs.db
43+
Thumbs.db
44+
desktop.ini
45+
46+
47+
############
48+
# Packages #
49+
############
50+
# it's better to unpack these files and commit the raw source
51+
# git has its own built in compression methods
52+
*.7z
53+
*.dmg
54+
*.gz
55+
*.iso
56+
*.jar
57+
*.rar
58+
*.tar
59+
*.zip
+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
2+
// --------------------------------------------------------------
3+
// SPX-GC example custom functions for project/global extras.
4+
// --------------------------------------------------------------
5+
//
6+
// These are just SOME THINGS custom controls can do. They can
7+
// also send commands to external devices (light, sound, commands),
8+
// execute commands on the operating system, access the web etc.
9+
//
10+
// See documentation for available user interface controls and
11+
// their settings.
12+
//
13+
// If you need help in developing custom functionality to SPX-GC
14+
// get in touch.
15+
//
16+
// (C) 2020 [email protected]
17+
// MIT License.
18+
//
19+
// --------------------------------------------------------------
20+
21+
function demo_popup(message){
22+
// A basic hello world example
23+
alert('A basic example of a custom function.\nThe text given as function argument was:\n\n' + message)
24+
}
25+
26+
function demo_toggle(eventButton) {
27+
// A basic toggle example
28+
let curValue = eventButton.getAttribute('data-spx-status');
29+
let colClass = eventButton.getAttribute('data-spx-color');
30+
if (curValue=='false'){
31+
eventButton.setAttribute('data-spx-status','true');
32+
eventButton.innerText = eventButton.getAttribute('data-spx-stoptext');
33+
eventButton.classList.remove(colClass);
34+
eventButton.classList.add('bg_red');
35+
// add START logic here
36+
alert('A demo.\nModify the script to actually START something...');
37+
}
38+
else
39+
{
40+
eventButton.setAttribute('data-spx-status','false');
41+
eventButton.innerText = eventButton.getAttribute('data-spx-playtext');
42+
eventButton.classList.remove('bg_red');
43+
eventButton.classList.add(colClass);
44+
// add STOP logic here
45+
alert('Demo continues.\nThe script could actually STOP something...');
46+
}
47+
}
48+
49+
50+
51+
function clearAllChannels() {
52+
// Will CLEAR all playout channels instantly, a "PANIC" button.
53+
console.log('Clearing gfx...');
54+
clearUsedChannels(); // <-- function in spx_gc.js
55+
}
56+
57+
58+
function stopAll(){
59+
// Will send STOP commands to all layers used by current rundown.
60+
// Timeout here allows some time for server to handle the incoming commands.
61+
// TODO: Far from elegant but kind of works. A better approach would be to
62+
// develop a server-side function for this.
63+
let ITEMS = document.querySelectorAll('.itemrow');
64+
ITEMS.forEach(function (templateItem, itemNro) {
65+
setTimeout(function(){
66+
continueUpdateStop('stop', itemNro);
67+
}, (itemNro * 50)); // 50, 100, 150, 200ms etc...
68+
});
69+
}
70+
71+
72+
function openWebpage(url='/help'){
73+
// Opens a new browser tab with url given.
74+
// let tabName = "_helper";
75+
console.log("Hello ", url);
76+
window.open(url, '_blank');
77+
return false;
78+
}
79+
80+
81+
function playSelectedAudio(selectList){
82+
// Reads a path of audio file (in ASSETS folder) from current value of the select list
83+
// and triggers a function which will pass the filename to SPX-GC which will play the
84+
// sound on the server.
85+
sfx = document.getElementById(selectList).value;
86+
playServerAudio(sfx,message='Custom audio button')
87+
}
88+
89+
90+
function logoToggle(eventButton) {
91+
// Will read the current toggle state of the button pressed and will send either
92+
// a PLAY or STOP command to the SPX-GC and will change the toggle state of button.
93+
let curValue = eventButton.getAttribute('data-spx-status');
94+
let colClass = eventButton.getAttribute('data-spx-color');
95+
let data = {};
96+
// ----------------- playout settings ------------------------------------------
97+
data.relpath = 'smartpx/demos/cornerlogo.html'; // template file
98+
data.playserver = 'OVERLAY'; // CCG server or '-'
99+
data.playchannel = '1'; // Channel
100+
data.playlayer = '19'; // Layer
101+
data.webplayout = '19'; // Web layer or '-'
102+
data.relpathCCG = data.relpath.split('.htm')[0];
103+
if (curValue=='false'){
104+
eventButton.setAttribute('data-spx-status','true');
105+
eventButton.innerText = eventButton.getAttribute('data-spx-stoptext');
106+
eventButton.classList.remove(colClass);
107+
eventButton.classList.add('bg_red');
108+
data.command = 'play';
109+
ajaxpost('/gc/playout',data, 'true');
110+
}
111+
else
112+
{
113+
eventButton.setAttribute('data-spx-status','false');
114+
eventButton.innerText = eventButton.getAttribute('data-spx-playtext');
115+
eventButton.classList.remove('bg_red');
116+
eventButton.classList.add(colClass);
117+
data.command = 'stop';
118+
ajaxpost('/gc/playout',data,'true');
119+
}
120+
}
121+
122+

ASSETS/media/images/icons/live.webm

56.4 KB
Binary file not shown.

ASSETS/media/images/icons/phone.webm

78.7 KB
Binary file not shown.

ASSETS/media/wav/applause.wav

1.24 MB
Binary file not shown.

ASSETS/media/wav/no.wav

97.8 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
The node-wav-player is a Node.js module which allows you to play a wav file
3+
on the host computer. It supports Windows 10, MacOS X, and some Linux distros.
4+
5+
https://www.npmjs.com/package/node-wav-player
6+

ASSETS/media/wav/yes.wav

121 KB
Binary file not shown.

ASSETS/templates/empty.html

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!DOCTYPE html>
2+
<!-- this is an empty file, which acts as a placeholder -->
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Empty</title>
8+
<style>
9+
html, body {
10+
background-color: rgba(255,255,255,0.0);
11+
margin: 0px;
12+
box-sizing: border-box;
13+
height: 100%;
14+
overflow: hidden;
15+
font-family: sans-serif;
16+
}
17+
18+
*, *:before, *:after {
19+
box-sizing: inherit;
20+
margin: 0;
21+
padding: 0;
22+
}
23+
</style>
24+
25+
<script>
26+
function echo(msg)
27+
{
28+
document.getElementById('debug').innerText=msg;
29+
}
30+
31+
function play() { emptyMessage('play') }
32+
function stop() { emptyMessage('stop') }
33+
function invoke() { emptyMessage('invoke') }
34+
function update() { emptyMessage('update') }
35+
function data() { emptyMessage('data') }
36+
37+
function emptyMessage(cmd)
38+
{
39+
// console.log('FYI: empty.html received command [' + cmd + '].');
40+
}
41+
42+
</script>
43+
<script>
44+
window.SPXGCTemplateDefinition = {
45+
"description": "INTERNAL GC FILE - Should not be used in projects.",
46+
"playserver": "-",
47+
"playchannel": "1",
48+
"playlayer": "7",
49+
"webplayout": "-",
50+
"out": "none",
51+
"uicolor": "0",
52+
"DataFields": [
53+
{
54+
"field" : "caption",
55+
"ftype" : "caption",
56+
"title" : "EMPTY FILE",
57+
"value" : "Internal GC file. Should not be used in projects."
58+
}
59+
]
60+
};
61+
</script>
62+
</head>
63+
<body>
64+
<span id="debug"></span>
65+
</body>
66+
</html>

ASSETS/templates/smartpx/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
############################
2+
# SmartPX's unwanted files #
3+
############################
4+
PoliisitStreamGfx/
5+
MB2021/
6+
7+
8+
# Except this file
9+
!.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# SPX-GC Template Demo Pack #1
2+
3+
4+
5+
This starter pack consists of a few example HTML -templates to be used for testing [**SPX Graphics Controller**](https://www.github.com/TuomoKu/SPX-GC/) for controlling [CasparCG](https://casparcg.com/) or streaming applications, such as [OBS](https://obsproject.com/), [Wirecast](https://www.telestream.net/wirecast/) and [vMix](https://www.vmix.com/).
6+
7+
Custom made and branded templates should always be used in production but these might help while getting to know the system
8+
9+
10+
## Installation
11+
- Install **SPX Graphics Controller** from [smartpx.fi/gc](http://smartpx.fi/gc) if not installed.
12+
- Download [spx_template_pack_1.zip](http://smartpx.fi/gc/spx_template_pack_1.zip) -file and unzip to your GC's __templates__ -folder.
13+
- in GC, open a project and import demo templates into it.
14+
- open any rundown in that project and add templates to rundown.
15+
- fill in the templates and play.
16+
17+
## List of templates
18+
The pack has 8 templates. Some of them demonstrates various aspects of GC features.
19+
| Template | Features |
20+
| ------ | ------ |
21+
| COLOR BUMPER | A basic color wipe. Uses "none" as __out-mode__ |
22+
| HEADLINE 2 STEPS | Animation has two phases: play > **continue** > stop |
23+
| INFO LEFT | Template has a **dropdown control** for choosing an animated icon |
24+
| INFO RIGHT | Basic oneliner |
25+
| NAME LEFT | Name strap with optional fields |
26+
| NAME RIGHT | Name strap with optional fields |
27+
| TICKER MANUAL | Basic static text strap |
28+
| TICKER SHEET | Dynamic ticker using Google Sheet (and RSS) as **data source**|
29+
30+
## SPX Template Definition
31+
Each template has a Javascript configuration object to expose desired features and default values to GC. See GC documentation for details.
32+
33+
Example configuration for a simple 1 field text template:
34+
35+
```html
36+
<script type="text/javascript">
37+
window.SPXGCTemplateDefinition = {
38+
"description": "One liner",
39+
"playserver": "OVERLAY",
40+
"playchannel": "1",
41+
"playlayer": "8",
42+
"webplayout": "8",
43+
"out": "manual",
44+
"uicolor": "7",
45+
"DataFields": [
46+
{
47+
"field" : "f0",
48+
"ftype" : "textfield",
49+
"title" : "Simple text strap",
50+
"value" : "Firstname Lastname"
51+
}
52+
]};
53+
</script>
54+
```
55+
56+
57+
58+
59+
60+
## "Debug"
61+
Templates utilizes [webcg-devtools](https://github.com/indr/webcg-devtools) for browser based testing. You can open a html file in a browser and give **?debug=true** url parameter to open WebCG devtool user interface.
62+
63+
```sh
64+
SPX1_INFO_RIGHT.html?debug=true
65+
```
66+
Inspect SPX Template Definition object to understand what fields the template expects for it to function properly.
67+
> Note: the debug feature is NOT extensively tested with the templates in this starter pack...
68+
69+
## Customization options
70+
All the templates in this demo pack uses **customize.css** for fonts and colors. You can edit the values in the file and re-play any of the templates to see the effect. There are several example customizations in css -folder. Overwrite the existing customize.css with any of the example files.
71+
- **Googly** - white backgrounds and clear bright colors. (This is the default one.)
72+
- **Swedish furniture** - bold typography with bluish-yellowish colors
73+
- **Motorway** - black and red colors on angled backgrounds.
74+
- **Day spa** - muted, translucent colors and rounded corners
75+
76+
[![snapshot](http://www.smartpx.fi/gc/img/pack1_demo_customizations.png)](http://smartpx.fi/gc/)
77+
78+
**Remember**, these customizations only effect some visual aspects of these demo templates. Animations and layout stays mostly the same. For production purposes a custom made template pack is _the way to go_. [Get in contact](http://www.smartpx.fi/gc/custom_templates) if you need help in creating bespoke templates with advanced features (social media integration, impactful animations, responsive "linked" layers, image galleries, map animations, graphs, particle effects etc...)
79+
80+
## MIT License
81+
Copyright 2020 SmartPX [email protected]
82+
83+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
84+
85+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
86+
87+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)