Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MINT
godot-addons
gdpd
Commits
24051ef4
Commit
24051ef4
authored
Jul 17, 2020
by
BERTHAUT Florent
Browse files
Changed to single libpd
parent
cacb0f5f
Changes
5
Hide whitespace changes
Inline
Side-by-side
GdpdExample/Main.tscn
View file @
24051ef4
...
...
@@ -4,17 +4,10 @@
script/source = "extends Control
var gdpd = load(\"res://addons/gdpd/bin/gdpd.gdns\")
var patch
#
var patch
func _ready():
#initialize pd
patch = gdpd.new()
#retrieve
var inps = patch.get_available_input_devices()
var outs = patch.get_available_output_devices()
patch.init_devices(inps[0], outs[0])
#the patch path should be the absolute one
_load_patch(ProjectSettings.globalize_path(\"res://patch1.pd\"))
_load_patch(ProjectSettings.globalize_path(\"res://patch2.pd\"))
...
...
@@ -25,6 +18,15 @@ func _load_patch(pd_patch) :
var patch_name = pd_patch.split(\"/\")[-1]
var patch_dir = pd_patch.trim_suffix(patch_name)
#initialize pd
var patch = gdpd.new()
#retrieve
var inps = patch.get_available_input_devices()
var outs = patch.get_available_output_devices()
patch.init_devices(inps[0], outs[0])
#load patch
patch.openfile(patch_name, patch_dir)
"
...
...
GdpdExample/addons/gdpd/bin/libgdpd.gdnlib
View file @
24051ef4
[general]
singleton=false
load_once=
tru
e
load_once=
fals
e
symbol_prefix="godot_"
reloadable=true
...
...
@@ -13,6 +13,6 @@ OSX.64="res://addons/gdpd/bin/osx/libgdpd.dylib"
[dependencies]
X11.64=[]
X11.64=[
]
Windows.64=[ ]
OSX.64=[ ]
src/gdpd.cpp
View file @
24051ef4
...
...
@@ -156,7 +156,7 @@ int Gdpd::start() {
void
Gdpd
::
stop
()
{
m_audio
.
stopStream
();
m_audio
.
closeStream
();
m_pd
.
cl
osePatch
(
m_patch
);
m_pd
.
cl
ear
(
);
m_pd
.
computeAudio
(
false
);
print
(
"Stopped"
);
}
...
...
@@ -181,13 +181,16 @@ void Gdpd::openfile(godot::String baseStr, godot::String dirStr) {
std
::
string
dirS
(
dirWs
.
begin
(),
dirWs
.
end
());
//libpd_openfile(baseS.c_str(), dirS.c_str());
m_patch
=
m_pd
.
openPatch
(
baseS
.
c_str
(),
dirS
.
c_str
());
//m_patch = m_pd.openPatch(baseS.c_str(), dirS.c_str());
m_pd
.
openPatch
(
baseS
.
c_str
(),
dirS
.
c_str
());
print
(
"Opened patch"
);
}
void
Gdpd
::
closefile
()
{
m_pd
.
closePatch
(
m_patch
);
void
Gdpd
::
closefile
(
godot
::
String
baseStr
)
{
std
::
wstring
baseWs
=
baseStr
.
unicode_str
();
std
::
string
baseS
(
baseWs
.
begin
(),
baseWs
.
end
());
m_pd
.
closePatch
(
baseS
.
c_str
());
}
void
Gdpd
::
subscribe
(
String
symbStr
)
{
...
...
src/gdpd.hpp
View file @
24051ef4
...
...
@@ -48,7 +48,7 @@ public:
int
start
();
void
stop
();
void
openfile
(
String
basename
,
String
dirname
);
void
closefile
();
void
closefile
(
String
basename
);
bool
has_message
();
Array
get_next
();
int
blocksize
();
...
...
src/rtaudio/RtAudio.os
View file @
24051ef4
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment