Skip to content

Commit b1a5137

Browse files
committed
Initial Alpha Realease
This has the basic form to create stage view
1 parent d0cefd4 commit b1a5137

15 files changed

+1760
-0
lines changed

.directory

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Desktop Entry]
2+
Icon=./.icon.png

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#---- Gambas files to ignore (v5)
2+
*.gambas
3+
.lock
4+
*~
5+
core
6+
core.*
7+
vgcore
8+
vgcore.*
9+
.kdbg*
10+
.*.prof
11+
.lang/*.pot
12+
.gambas/*
13+
.settings
14+
.startup
15+
.list
16+
.info
17+
.fuse_hidden*
18+
#----

.hidden/CHANGELOG

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
* Mon May 20 2024 The Harvest Is Ready <steven@theharvestisready.com> 0.0.6
2+
- Padding margin now can be set to fraction of a percentage point
3+
4+
* Mon May 20 2024 The Harvest Is Ready <steven@theharvestisready.com> 0.0.5
5+
- URl and port of OpenLP can be configured
6+
7+
* Mon May 20 2024 The Harvest Is Ready <steven@theharvestisready.com> 0.0.4
8+
- Can use live view from OpenLP to see how it will look. assumes on same PC @ port 4316
9+
10+
* Mon May 20 2024 The Harvest Is Ready <steven@theharvestisready.com> 0.0.3
11+
- Fix BG color property
12+
13+
* Sat May 18 2024 The Harvest Is Ready <steven@theharvestisready.com> 0.0.2
14+
- Initial release
15+
- Can create and modify the following
16+
- Postition of the lower third
17+
- BG Colour
18+
- Size and font of Text
19+
- Drop Shadow
20+

.hidden/jquery.min.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.hidden/stage.js

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
/******************************************************************************
2+
* OpenLP - Open Source Lyrics Projection *
3+
* --------------------------------------------------------------------------- *
4+
* Copyright (c) 2008-2021 OpenLP Developers *
5+
* --------------------------------------------------------------------------- *
6+
* This program is free software; you can redistribute it and/or modify it *
7+
* under the terms of the GNU General Public License as published by the Free *
8+
* Software Foundation; version 2 of the License. *
9+
* *
10+
* This program is distributed in the hope that it will be useful, but WITHOUT *
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
13+
* more details. *
14+
* *
15+
* You should have received a copy of the GNU General Public License along *
16+
* with this program; if not, write to the Free Software Foundation, Inc., 59 *
17+
* Temple Place, Suite 330, Boston, MA 02111-1307 USA *
18+
******************************************************************************/
19+
var intfadein = 300;
20+
var intfadeout= 300;
21+
var strtype="songs";
22+
23+
24+
window.OpenLP = { // Connect to the OpenLP Remote WebSocket to get pushed updates
25+
myWebSocket: function (data, status) {
26+
const host = window.location.hostname;
27+
const websocket_port = 4317;
28+
var curmode;
29+
30+
ws = new WebSocket(`ws://${host}:${websocket_port}`);
31+
ws.onmessage = (event) => {
32+
33+
const reader = new FileReader();
34+
35+
reader.onload = () => {
36+
data = JSON.parse(reader.result.toString()).results;
37+
// set some global var
38+
//set the displaymode
39+
//This will determine if we show text.
40+
OpenLP.curStatus = 'live';
41+
//Showing Theme
42+
curmode = data.theme;
43+
if (curmode==true) {
44+
OpenLP.curStatus = 'theme';
45+
}
46+
//Showing Desktop
47+
curmode = data.display;
48+
if (curmode==true) {
49+
OpenLP.curStatus = 'display';
50+
}
51+
//Showing Black
52+
curmode = data.blank;
53+
if (curmode==true) {
54+
OpenLP.curStatus = 'blank';
55+
}
56+
57+
58+
59+
if (OpenLP.currentItem != data.item ||
60+
OpenLP.currentService != data.service) {
61+
//New item has been selected
62+
OpenLP.currentItem = data.item;
63+
OpenLP.currentService = data.service;
64+
65+
OpenLP.loadSlides();
66+
}
67+
else if (OpenLP.currentSlide != data.slide) {
68+
// New Slide has been selected
69+
OpenLP.currentSlide = parseInt(data.slide, 10);
70+
71+
OpenLP.updateSlide();
72+
73+
} else {
74+
//catch all just reload
75+
OpenLP.loadService();
76+
}
77+
};
78+
reader.readAsText(event.data);
79+
};
80+
},
81+
82+
loadService: function (event) {
83+
$.getJSON(
84+
"/api/v2/service/items",
85+
function (data, status) {
86+
OpenLP.nextSong = "";
87+
88+
89+
90+
data.forEach(function(item, index, array) {
91+
92+
if (item.selected) {
93+
94+
OpenLP.currentItem = item;
95+
OpenLP.curPlugin =data[index].plugin;
96+
97+
if (OpenLP.curPlugin == strtype && OpenLP.curStatus == 'live') {
98+
//hide the text
99+
$("#songtitle").html(item.title);
100+
} else {
101+
$("#songtitle").html("");
102+
}
103+
104+
OpenLP.updateSlide();
105+
106+
107+
}
108+
});
109+
110+
//
111+
}
112+
);
113+
},
114+
115+
loadSlides: function (event) {
116+
$.getJSON(
117+
"/api/v2/controller/live-items",
118+
function (data, status) {
119+
OpenLP.currentSlides = data.slides;
120+
OpenLP.currentSlide = 0;
121+
122+
$.each(data.slides, function(idx, slide) {
123+
124+
125+
if (slide["selected"])
126+
OpenLP.currentSlide = idx;
127+
})
128+
129+
OpenLP.loadService();
130+
131+
}
132+
);
133+
},
134+
135+
updateSlide: function() {
136+
// Show the current slide on top. Any trailing slides for the same verse
137+
// are shown too underneath in grey.
138+
// Then leave a blank line between following verses
139+
140+
var slide = OpenLP.currentSlides[OpenLP.currentSlide];
141+
var text = "";
142+
143+
// use title as alternative
144+
if (slide["text"]) {
145+
text = slide["text"];
146+
} else {
147+
text = slide["title"];
148+
}
149+
150+
text = text.replace(/\n/g, "<br />");
151+
// confirm(curStatus);
152+
if (OpenLP.curPlugin != strtype|| OpenLP.curStatus != 'live') {
153+
//hide the text
154+
text = "";
155+
//set style to remove bg box
156+
var element = document.querySelector("#bgslide");
157+
element.classList.replace("slide", "slideclear");
158+
} else {
159+
//make sure correct background
160+
var element = document.querySelector("#bgslide");
161+
element.classList.replace("slideclear", "slide");
162+
163+
}
164+
165+
if (OpenLP.curtext != text) {
166+
OpenLP.curtext = text
167+
$("#currentslide").fadeOut(intfadeout, function(){
168+
169+
$("#currentslide").html(OpenLP.curtext);
170+
171+
}
172+
);
173+
$("#currentslide").fadeIn(intfadein);
174+
}
175+
176+
177+
},
178+
179+
}
180+
$.ajaxSetup({ cache: false });
181+
//setInterval("OpenLP.updateClock();", 500);
182+
OpenLP.myWebSocket();

.icon.png

11.1 KB
Loading

.project

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Gambas Project File 3.0
2+
Title=OpenLP-Companion
3+
Startup=frmstagemake
4+
Version=0.0.6
5+
Component=gb.image
6+
Component=gb.gui
7+
Component=gb.form
8+
Component=gb.eval
9+
Component=gb.eval.highlight
10+
Component=gb.util
11+
Component=gb.form.editor
12+
Component=gb.form.htmlview
13+
Component=gb.settings
14+
Component=gb.form.print
15+
Component=gb.form.stock
16+
Component=gb.gui.webview
17+
Component=gb.util.web
18+
Component=gb.web
19+
Component=gb.xml
20+
Component=gb.web.feed
21+
Component=gb.xml.html
22+
Description="A utility to assist in the creation of making lower thirds. It will create a custom stage view that can be accessed via the stage web view. See OpenLP custom stage views."
23+
TabSize=2
24+
Language=en
25+
Maintainer=The Harvest Is Ready
26+
Vendor=The Harvest is Ready
27+
VendorPrefix=theharvestisready
28+
Address=steven@theharvestisready.com
29+
Url=www.theharvestisready.co,
30+
License=General Public License
31+
Prefix=1
32+
PackageName=theharvestisready-openlp-companion-0.0.6
33+
CreateEachDirectory=1
34+
Packager=1
35+
Systems=fedora
36+
SameFiles=1
37+
Menus=fedora:"Office/Database"
38+
Categories=fedora:"Database;Office"
39+
Groups=fedora:"Applications/Publishing"
40+
ExtraDependencies=*:"\t\t"
41+
ExtraFiles=*:"jquery.min.js\t/usr/local/share/applications/OpenLP-Companion\nstage.js\t/usr/local/share/applications/OpenLP-Companion"

.src/FMain.class

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
' Gambas class file
2+
3+
4+
Public Sub Button1_Click()
5+
6+
frmstagemake.Show
7+
8+
End

.src/FMain.form

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Gambas Form File 3.0
2+
3+
{ Form Form
4+
MoveScaled(0,0,113,67)
5+
{ Button1 Button
6+
MoveScaled(4,4,16,4)
7+
}
8+
}

0 commit comments

Comments
 (0)