pd4web 2.2.5__tar.gz → 2.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pd4web-2.2.5 → pd4web-2.2.7}/PKG-INFO +1 -1
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web/Pd4Web.py +27 -20
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web.cpp +21 -2
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web.hpp +1 -1
- {pd4web-2.2.5 → pd4web-2.2.7}/pyproject.toml +1 -1
- {pd4web-2.2.5 → pd4web-2.2.7}/LICENSE +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/README.md +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/.clang-format +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/.prettierrc +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/.yamlftm +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/Libraries.yaml +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/ambi~.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/cyclone.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/earplug.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/else.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/libpd.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/o.scofo~.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/.git +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/.github/workflows/c-cpp.yml +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/.gitignore +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/CMakeLists.txt +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/.clang-format +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/CMakeLists.txt +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/fft~/fft~-help.pd +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/fft~/fft~.cpp +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/simple/simple-help.pd +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/simple/simple-patch.pd +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/simple/simple.cpp +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/simple~/simple~-help.pd +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Examples/simple~/simple~.cpp +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/LICENSE +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/README.md +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Tests/01.Deprecated-Functions/CMakeLists.txt +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/Tests/CMakeLists.txt +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pd.cmake/pd.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/pmpd.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Libraries/timbreIDLib.cmake +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/1/bula.md +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/1/index.html +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/2/index.html +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/2/sketch.js +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/3/index.html +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/4/index.html +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/4/sketch.js +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/5/index.html +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/Templates/5/tutorial.md +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/__init__.py +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/cmake-format.yaml +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/config.h +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/externals.cpp +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/favicon.ico +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/index.html +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/nogui.html +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web/Builder.py +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web/Compilers.py +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web/Libraries.py +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web/Objects.py +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web/Patch.py +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web/__init__.py +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web.gitignore +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web.gui.js +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web.midi.js +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web.style.css +0 -0
- {pd4web-2.2.5 → pd4web-2.2.7}/Sources/pd4web.threads.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pd4web
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.7
|
|
4
4
|
Summary: pd4web compiles PureData patches with external objects for Wasm, allowing to run entire patches in web browsers.
|
|
5
5
|
Home-page: https://charlesneimog.github.io/pd4web
|
|
6
6
|
Author: Charles K. Neimog
|
|
@@ -5,10 +5,8 @@ import subprocess
|
|
|
5
5
|
import pygit2
|
|
6
6
|
|
|
7
7
|
import shutil
|
|
8
|
-
import requests
|
|
9
8
|
import importlib.metadata as importlib_metadata
|
|
10
9
|
|
|
11
|
-
|
|
12
10
|
import certifi
|
|
13
11
|
|
|
14
12
|
os.environ["SSL_CERT_FILE"] = certifi.where()
|
|
@@ -62,12 +60,12 @@ class Pd4Web:
|
|
|
62
60
|
|
|
63
61
|
parser = parser.parse_args()
|
|
64
62
|
|
|
65
|
-
self.
|
|
63
|
+
self.getMainPaths()
|
|
66
64
|
self.do_actions(parser)
|
|
67
65
|
|
|
68
66
|
self.Parser = parser
|
|
69
67
|
self.Patch = os.path.abspath(self.Parser.patch_file)
|
|
70
|
-
|
|
68
|
+
|
|
71
69
|
if not os.path.isfile(self.Patch):
|
|
72
70
|
self.exception("\n\nError: Patch file not found")
|
|
73
71
|
|
|
@@ -101,7 +99,7 @@ class Pd4Web:
|
|
|
101
99
|
self.declaredLibsObjs = []
|
|
102
100
|
self.declaredPaths = []
|
|
103
101
|
self.processedAbs = []
|
|
104
|
-
|
|
102
|
+
|
|
105
103
|
# Versions
|
|
106
104
|
self.Version = {}
|
|
107
105
|
self.Version["python"] = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
|
|
@@ -124,8 +122,7 @@ class Pd4Web:
|
|
|
124
122
|
# add /bin and /usr/bin to PATH on macOS
|
|
125
123
|
if sys.platform == "darwin":
|
|
126
124
|
self.env["PATH"] += ":/bin:/usr/bin"
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
|
|
129
126
|
def Execute(self):
|
|
130
127
|
from .Builder import GetAndBuildExternals
|
|
131
128
|
from .Compilers import ExternalsCompiler
|
|
@@ -134,7 +131,7 @@ class Pd4Web:
|
|
|
134
131
|
if self.Patch == "":
|
|
135
132
|
self.exception("You must set a patch file")
|
|
136
133
|
|
|
137
|
-
self.
|
|
134
|
+
self.getMainPaths()
|
|
138
135
|
self.InitVariables()
|
|
139
136
|
|
|
140
137
|
# ╭──────────────────────────────────────╮
|
|
@@ -161,24 +158,29 @@ class Pd4Web:
|
|
|
161
158
|
|
|
162
159
|
def RunBrowser(self):
|
|
163
160
|
self.CWD = os.getcwd()
|
|
161
|
+
self.PD4WEB_ROOT = os.path.dirname(os.path.realpath(__file__))
|
|
162
|
+
|
|
164
163
|
if sys.platform == "win32":
|
|
165
|
-
|
|
164
|
+
program_data_path = os.getenv("PROGRAMDATA")
|
|
165
|
+
app_data_subfolder = os.path.join(program_data_path, "pd4web")
|
|
166
|
+
if not os.path.exists(app_data_subfolder):
|
|
167
|
+
os.makedirs(app_data_subfolder)
|
|
168
|
+
self.APPDATA = app_data_subfolder
|
|
166
169
|
elif sys.platform == "darwin":
|
|
167
170
|
self.APPDATA = os.path.join(os.path.expanduser("~/Library/"), "pd4web")
|
|
168
171
|
elif sys.platform == "linux":
|
|
169
172
|
self.APPDATA = os.path.join(os.path.expanduser("~/.local/share"), "pd4web")
|
|
170
173
|
else:
|
|
171
174
|
self.exception("Unsupported platform")
|
|
175
|
+
|
|
172
176
|
emccRun = self.APPDATA + "/emsdk/upstream/emscripten/emrun"
|
|
173
|
-
# check if emrun exists
|
|
174
177
|
if not os.path.exists(emccRun):
|
|
175
178
|
self.exception("emrun not found. Please install Emscripten")
|
|
176
|
-
|
|
177
179
|
projectRoot = os.path.realpath(self.Patch)
|
|
178
180
|
os.chdir(projectRoot)
|
|
179
181
|
subprocess.run(f"{emccRun} {projectRoot}/index.html", shell=True, env=self.env)
|
|
180
182
|
|
|
181
|
-
def
|
|
183
|
+
def getMainPaths(self):
|
|
182
184
|
self.PROJECT_ROOT = os.path.dirname(os.path.realpath(self.Patch))
|
|
183
185
|
self.PROJECT_PATCH = os.path.basename(self.Patch)
|
|
184
186
|
self.PD4WEB_ROOT = os.path.dirname(os.path.realpath(__file__))
|
|
@@ -187,15 +189,20 @@ class Pd4Web:
|
|
|
187
189
|
self.PD4WEB_LIBRARIES = os.path.abspath(self.PD4WEB_LIBRARIES)
|
|
188
190
|
|
|
189
191
|
self.CWD = os.getcwd()
|
|
192
|
+
if not os.path.exists(os.path.join(self.PD4WEB_ROOT, "data")):
|
|
193
|
+
os.makedirs(os.path.join(self.PD4WEB_ROOT, "data"))
|
|
190
194
|
if sys.platform == "win32":
|
|
191
|
-
|
|
195
|
+
program_data_path = os.getenv("PROGRAMDATA")
|
|
196
|
+
app_data_subfolder = os.path.join(program_data_path, "pd4web")
|
|
197
|
+
if not os.path.exists(app_data_subfolder):
|
|
198
|
+
os.makedirs(app_data_subfolder)
|
|
199
|
+
self.APPDATA = app_data_subfolder
|
|
192
200
|
elif sys.platform == "darwin":
|
|
193
201
|
self.APPDATA = os.path.join(os.path.expanduser("~/Library/"), "pd4web")
|
|
194
202
|
elif sys.platform == "linux":
|
|
195
203
|
self.APPDATA = os.path.join(os.path.expanduser("~/.local/share"), "pd4web")
|
|
196
204
|
else:
|
|
197
205
|
self.exception("Unsupported platform")
|
|
198
|
-
|
|
199
206
|
if not os.path.exists(self.APPDATA):
|
|
200
207
|
os.makedirs(self.APPDATA)
|
|
201
208
|
|
|
@@ -305,7 +312,7 @@ class Pd4Web:
|
|
|
305
312
|
type=int,
|
|
306
313
|
help="Initial memory size in MB",
|
|
307
314
|
)
|
|
308
|
-
|
|
315
|
+
|
|
309
316
|
parser.add_argument(
|
|
310
317
|
"--patch-file",
|
|
311
318
|
required=False,
|
|
@@ -349,7 +356,7 @@ class Pd4Web:
|
|
|
349
356
|
type=str,
|
|
350
357
|
help="Pure Data version to use",
|
|
351
358
|
)
|
|
352
|
-
|
|
359
|
+
|
|
353
360
|
# Pd Object
|
|
354
361
|
parser.add_argument(
|
|
355
362
|
"--pd-external",
|
|
@@ -358,7 +365,7 @@ class Pd4Web:
|
|
|
358
365
|
action="store_true",
|
|
359
366
|
help="If is it pd4web external",
|
|
360
367
|
)
|
|
361
|
-
|
|
368
|
+
|
|
362
369
|
parser.add_argument(
|
|
363
370
|
"--pd-external-version",
|
|
364
371
|
required=False,
|
|
@@ -391,13 +398,13 @@ class Pd4Web:
|
|
|
391
398
|
if pd4web:
|
|
392
399
|
if color == "red":
|
|
393
400
|
print("ERROR: " + text)
|
|
394
|
-
sys.stdout.flush()
|
|
401
|
+
sys.stdout.flush()
|
|
395
402
|
elif color == "yellow":
|
|
396
403
|
print("WARNING: " + text)
|
|
397
|
-
sys.stdout.flush()
|
|
404
|
+
sys.stdout.flush()
|
|
398
405
|
else:
|
|
399
406
|
print(text)
|
|
400
|
-
sys.stdout.flush()
|
|
407
|
+
sys.stdout.flush()
|
|
401
408
|
return
|
|
402
409
|
if silence:
|
|
403
410
|
return
|
|
@@ -24,11 +24,29 @@ EM_JS(void, _JS_addSoundToggle, (void), {
|
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
// ─────────────────────────────────────
|
|
28
|
+
EM_JS(void, _JS_pd4webCppClass, (void *Pd4Web), {
|
|
29
|
+
console.log("Received Pd4Web pointer:", Pd4Web);
|
|
30
|
+
});
|
|
31
|
+
|
|
27
32
|
// ─────────────────────────────────────
|
|
28
33
|
EM_JS(void, _JS_setIcon, (const char *icon, const char *animation), {
|
|
29
34
|
let jsIcon = UTF8ToString(icon);
|
|
30
35
|
let jsAnimation = UTF8ToString(animation);
|
|
31
|
-
|
|
36
|
+
|
|
37
|
+
function tryCallSetSoundIcon() {
|
|
38
|
+
if (typeof setSoundIcon === 'function') {
|
|
39
|
+
setSoundIcon(jsIcon, jsAnimation);
|
|
40
|
+
} else {
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
if (typeof setSoundIcon === 'function') {
|
|
43
|
+
setSoundIcon(jsIcon, jsAnimation);
|
|
44
|
+
}
|
|
45
|
+
}, 200); // Retry after 200ms
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
setTimeout(() => tryCallSetSoundIcon(), 200);
|
|
32
50
|
});
|
|
33
51
|
|
|
34
52
|
// ─────────────────────────────────────
|
|
@@ -935,7 +953,6 @@ void Pd4Web::resumeAudio() { emscripten_resume_audio_context_sync(m_Context); }
|
|
|
935
953
|
*/
|
|
936
954
|
void Pd4Web::suspendAudio() { _JS_suspendAudioWorkLet(m_Context); }
|
|
937
955
|
|
|
938
|
-
|
|
939
956
|
/* Sound Switch */
|
|
940
957
|
void Pd4Web::soundToggle() {
|
|
941
958
|
if (m_audioSuspended) {
|
|
@@ -1012,6 +1029,8 @@ void Pd4Web::init() {
|
|
|
1012
1029
|
}
|
|
1013
1030
|
m_audioSuspended = false;
|
|
1014
1031
|
|
|
1032
|
+
_JS_pd4webCppClass(this);
|
|
1033
|
+
|
|
1015
1034
|
return;
|
|
1016
1035
|
}
|
|
1017
1036
|
// ╭─────────────────────────────────────╮
|
|
@@ -140,7 +140,7 @@ EMSCRIPTEN_BINDINGS(WebPd) {
|
|
|
140
140
|
.function("suspendAudio", &Pd4Web::suspendAudio)
|
|
141
141
|
.function("resumeAudio", &Pd4Web::resumeAudio)
|
|
142
142
|
.function("soundToggle", &Pd4Web::soundToggle)
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
// senders
|
|
145
145
|
.function("sendFloat", &Pd4Web::sendFloat)
|
|
146
146
|
.function("sendSymbol", &Pd4Web::sendSymbol)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pd4web"
|
|
3
|
-
version = "2.2.
|
|
3
|
+
version = "2.2.7"
|
|
4
4
|
description = "pd4web compiles PureData patches with external objects for Wasm, allowing to run entire patches in web browsers."
|
|
5
5
|
authors = ["Charles K. Neimog <charlesneimog@outlook.com>"]
|
|
6
6
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|