Skip to content

Commit f286728

Browse files
committed
high res emotes, muted settings
1 parent 1eec27e commit f286728

9 files changed

Lines changed: 635 additions & 584 deletions

File tree

Oratio.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from http.server import SimpleHTTPRequestHandler
88
from socketserver import TCPServer
99
import threading
10-
import pywin32_system32
11-
import pywintypes
1210
import ctypes
1311
import ctypes.wintypes as cwin
1412
from win32con import WM_HOTKEY, MOD_CONTROL, SW_SHOWMINIMIZED, SW_MINIMIZE, SW_NORMAL, SW_SHOW

displayserver/2d/index.html

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
opacity: 1;
1818
overflow-wrap: break-word;
1919
}
20-
20+
2121
#feed {
2222
display: inline-block;
2323
padding: 10px;
@@ -35,7 +35,6 @@
3535
</head>
3636

3737
<body>
38-
<!-- <img src='https://cdn.betterttv.net/emote/5f7c9234ccde1f4a870c47c4/1x'> -->
3938
<p style="display: none;" id="oratio">Not connected</p>
4039
<div id="feed" style="display: none;"></div>
4140
<script>
@@ -46,10 +45,12 @@
4645
let typeitSpeed = 25;
4746
let waitTime = 5000;
4847
let fadeOutSpeed = 1000;
48+
let fontSize = "24px";
4949
let globalTypeCheck = [];
5050
let sound = new Howl({
5151
src: ['../sounds/boop.mp3']
5252
});
53+
let muted = false;
5354
let settingInterval;
5455

5556
const settingsText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
@@ -69,11 +70,9 @@
6970
beforeStep: async (instance) => {
7071
},
7172
afterStep: async (instance) => {
72-
// if ()
73-
// instance.getQueue().getItems().forEach((i) => {
74-
// console.log(i[0]);
75-
// });
76-
sound.play();
73+
if (!muted) {
74+
sound.play();
75+
}
7776
},
7877
afterComplete: async (instance) => {
7978
instance.destroy();
@@ -96,7 +95,6 @@
9695
feed.style.display = 'none';
9796
}
9897
}, fadeOutSpeed);
99-
// globalTypeCheck.remove(g);
10098
});
10199
}, 5000);
102100
for (let i=0; i < sliceG.length; i++) {
@@ -139,6 +137,9 @@
139137
Object.entries(d["cssSetting"]).forEach(([k, v]) => {
140138
feed.style[k] = v;
141139
});
140+
if ("font-size" in d["cssSetting"]) {
141+
fontSize = d["cssSetting"]["font-size"];
142+
}
142143
} else if ("settingScreen" in d) {
143144
if (d["settingScreen"]) {
144145
settingInterval = setInterval(() => {
@@ -165,6 +166,9 @@
165166
src: ['../sounds/' + d["jsSetting"]["sound"]]
166167
});
167168
}
169+
if ("muted" in d["jsSetting"]) {
170+
muted = d["jsSetting"]["muted"];
171+
}
168172
}
169173
}
170174

main.qml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ ApplicationWindow {
3939
var payload = {};
4040
payload["settingScreen"] = false;
4141
displayServerSocket.sendTextMessage(JSON.stringify(payload));
42+
var payload = {};
43+
payload["jsSetting"] = { "muted": false };
44+
displayServerSocket.sendTextMessage(JSON.stringify(payload));
4245
}
4346
}
4447
if (stackView.depth > 1) {
@@ -100,6 +103,9 @@ ApplicationWindow {
100103
var payload = {};
101104
payload["settingScreen"] = true;
102105
displayServerSocket.sendTextMessage(JSON.stringify(payload));
106+
var payload = {};
107+
payload["jsSetting"] = { "muted": true };
108+
displayServerSocket.sendTextMessage(JSON.stringify(payload));
103109
}
104110
}
105111
activeFocusOnTab: false
@@ -153,6 +159,7 @@ ApplicationWindow {
153159
property var display2Dbackgroundcolor: "#000000FF"
154160
property var display2Dbackgroundborder: "2px solid #FFFFFFFF"
155161
property var display2Dfont: "Segoe UI Black"
162+
property var display2Dfontsize: "24px"
156163
property var display2Dsoundname: "boop.mp3"
157164
property var display2Dsoundfile: appDirPath + "/displayserver/sounds/boop.mp3"
158165
property var display2Dtypespeed: "25"
@@ -168,14 +175,15 @@ ApplicationWindow {
168175
cssPayload["cssSetting"] = {
169176
"background-color": settings.value("display2Dbackgroundcolor", ""),
170177
"border": settings.value("display2Dbackgroundborder", ""),
171-
"font-family": settings.value("display2Ddont", "")
178+
"font-family": settings.value("display2Dfont", ""),
179+
"font-size": settings.value("display2Dfontsize", ""),
172180
};
173181
displayServerSocket.sendTextMessage(JSON.stringify(cssPayload))
174182
var jsPayload = {}
175183
jsPayload["jsSetting"] = {
176184
"typeit-speed": settings.value("display2Dtypespeed", "") ,
177185
"fadeout-speed": settings.value("display2Dfadeoutspeed", ""),
178-
"sound": settings.value("display2Dsoundname", "")
186+
"sound": settings.value("display2Dsoundname", ""),
179187
};
180188
displayServerSocket.sendTextMessage(JSON.stringify(jsPayload));
181189
}

pages/Emotes.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Page {
2424
padding: 8
2525
AnimatedImage {
2626
anchors.horizontalCenter: parent.horizontalCenter
27+
height: 32
28+
width: 32
29+
fillMode: Image.PreserveAspectFit
2730
source: model.url
2831
}
2932
Label {

pages/Feed.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Page {
151151
if (displayServerSocket) {
152152
var payload = {}
153153
var displayText = t;
154-
displayText = displayText.replace(window.emoteRegex, (key) => '<img src="' + window.emoteDict[key].emotePath + '">');
154+
displayText = displayText.replace(window.emoteRegex, (key) => '<img style="height:' + settings.value("display2Dfontsize", "") + '" src="' + window.emoteDict[key].emotePath + '">');
155155
payload["message"] = displayText;
156156
displayServerSocket.sendTextMessage(JSON.stringify(payload))
157157
}

pages/Settings.qml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Page {
4646
Layout.fillWidth: true
4747
Layout.margins: 8
4848
Layout.alignment: Qt.AlignTop
49-
text: qsTr("While on the settings page. Example text will be sent to the display server for you to visualize updates")
49+
text: qsTr("While on the settings page. Example text will be sent to the display server for you to visualize updates, however audio is muted by default")
5050
wrapMode: Text.Wrap
5151
}
5252

@@ -125,6 +125,24 @@ Page {
125125
}
126126
}
127127
}
128+
RowLayout {
129+
Layout.fillWidth: true
130+
Layout.margins: 8
131+
spacing: 8
132+
visible: !settingSwitch.checked
133+
Label {
134+
id: display2DfontsizeText
135+
text: qsTr("Font Size: ")
136+
wrapMode: Text.Wrap
137+
}
138+
TextField {
139+
id: display2Dfontsize
140+
Layout.fillWidth: true
141+
placeholderText: qsTr("Default: 24px")
142+
text: settings.value("display2Dfontsize", "")
143+
selectByMouse: true
144+
}
145+
}
128146
RowLayout {
129147
Layout.fillWidth: true
130148
Layout.margins: 8
@@ -230,14 +248,15 @@ Page {
230248
cssPayload["cssSetting"] = {
231249
"background-color": display2Dbackgroundcolor.text,
232250
"border": display2Dbackgroundborder.text,
233-
"font-family": display2Dfont.currentText
251+
"font-family": display2Dfont.currentText,
252+
"font-size": display2Dfontsize.text,
234253
};
235254
displayServerSocket.sendTextMessage(JSON.stringify(cssPayload))
236255
var jsPayload = {}
237256
jsPayload["jsSetting"] = {
238257
"typeit-speed": display2Dtypespeed.text,
239258
"fadeout-speed": display2Dfadeoutspeed.text,
240-
"sound": display2Dsound.currentText
259+
"sound": display2Dsound.currentText,
241260
};
242261
displayServerSocket.sendTextMessage(JSON.stringify(jsPayload));
243262
statusText.color = "green";
@@ -250,6 +269,7 @@ Page {
250269
settings.setValue('display2Dbackgroundcolor', display2Dbackgroundcolor.text)
251270
settings.setValue('display2Dbackgroundborder', display2Dbackgroundborder.text)
252271
settings.setValue('display2Dfont', display2Dfont.currentText)
272+
settings.setValue('display2Dfontsize', display2Dfontsize.text)
253273
settings.setValue('display2Dsoundfile', display2Dsound.currentValue.toString())
254274
settings.setValue('display2Dsoundname', display2Dsound.currentText)
255275
settings.setValue('display2Dtypespeed', display2Dtypespeed.text)

pages/emotesapi.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class EmotesApi {
112112
'emoteId': e['id'],
113113
'emoteName': e['name'],
114114
'emoteCategory': '7TV Channel',
115-
'emotePath': e['urls'][0][1]
115+
'emotePath': e['urls'][3][1]
116116
};
117117
}
118118
});
@@ -135,7 +135,7 @@ class EmotesApi {
135135
'emoteId': e['id'],
136136
'emoteName': e['name'],
137137
'emoteCategory': '7TV Global',
138-
'emotePath': e['urls'][0][1]
138+
'emotePath': e['urls'][3][1]
139139
};
140140
}
141141
});
@@ -159,7 +159,7 @@ class EmotesApi {
159159
'emoteId': e['id'],
160160
'emoteName': e['code'],
161161
'emoteCategory': 'BTTV Channel',
162-
'emotePath': 'https://cdn.betterttv.net/emote/' + e['id'] + '/1x'
162+
'emotePath': 'https://cdn.betterttv.net/emote/' + e['id'] + '/3x'
163163
};
164164
}
165165
});
@@ -182,7 +182,7 @@ class EmotesApi {
182182
'emoteId': e['id'],
183183
'emoteName': e['code'],
184184
'emoteCategory': 'BTTV Global',
185-
'emotePath': 'https://cdn.betterttv.net/emote/' + e['id'] + '/1x'
185+
'emotePath': 'https://cdn.betterttv.net/emote/' + e['id'] + '/3x'
186186
};
187187
}
188188
});
@@ -206,7 +206,7 @@ class EmotesApi {
206206
'emoteId': e['id'],
207207
'emoteName': e['name'],
208208
'emoteCategory': 'FFZ Channel',
209-
'emotePath': 'https:' + e['urls']['1']
209+
'emotePath': 'https:' + e['urls']['4']
210210
};
211211
}
212212
});
@@ -229,7 +229,7 @@ class EmotesApi {
229229
'emoteId': e['id'],
230230
'emoteName': e['name'],
231231
'emoteCategory': 'FFZ Global',
232-
'emotePath': 'https:' + e['urls']['1']
232+
'emotePath': 'https:' + e['urls']['4']
233233
};
234234
}
235235
});
@@ -254,7 +254,7 @@ class EmotesApi {
254254
'emoteId': e['id'],
255255
'emoteName': e['name'],
256256
'emoteCategory': 'Twitch Channel',
257-
'emotePath': 'https://static-cdn.jtvnw.net/emoticons/v2/' + e['id'] + '/default/dark/1.0'
257+
'emotePath': 'https://static-cdn.jtvnw.net/emoticons/v2/' + e['id'] + '/default/dark/3.0'
258258
};
259259
}
260260
});
@@ -280,7 +280,7 @@ class EmotesApi {
280280
'emoteId': e['id'],
281281
'emoteName': e['name'],
282282
'emoteCategory': 'Twitch Global',
283-
'emotePath': 'https://static-cdn.jtvnw.net/emoticons/v2/' + e['id'] + '/default/dark/1.0'
283+
'emotePath': 'https://static-cdn.jtvnw.net/emoticons/v2/' + e['id'] + '/default/dark/3.0'
284284
};
285285
}
286286
});
@@ -310,7 +310,7 @@ class EmotesApi {
310310
'emoteId': e['id'],
311311
'emoteName': e['name'],
312312
'emoteCategory': 'Twitch' + e['emote_type'],
313-
'emotePath': 'https://static-cdn.jtvnw.net/emoticons/v2/' + e['id'] + '/default/dark/1.0'
313+
'emotePath': 'https://static-cdn.jtvnw.net/emoticons/v2/' + e['id'] + '/default/dark/3.0'
314314
};
315315
}
316316
});

0 commit comments

Comments
 (0)