Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gdpd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IVMI
Gdpd
Commits
445b278d
Commit
445b278d
authored
2 months ago
by
Florent Berthaut
Browse files
Options
Downloads
Patches
Plain Diff
Fix copying / starting on Android
parent
f132836c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/gdpd.cpp
+17
-12
17 additions, 12 deletions
src/gdpd.cpp
src/gdpd.h
+0
-11
0 additions, 11 deletions
src/gdpd.h
src/rtaudio/RtAudio.os
+0
-0
0 additions, 0 deletions
src/rtaudio/RtAudio.os
with
17 additions
and
23 deletions
src/gdpd.cpp
+
17
−
12
View file @
445b278d
...
...
@@ -413,7 +413,7 @@ bool GdPd::open_patch() {
std
::
string
pdPatchStr
;
std
::
string
pdDirStr
;
/
*
/
/If opening from editor, just set the paths
if
(
OS
::
get_singleton
()
->
has_feature
(
"editor"
))
{
print
(
"Loading patch from editor"
);
String
fullpath
=
ProjectSettings
::
get_singleton
()
...
...
@@ -427,7 +427,8 @@ bool GdPd::open_patch() {
pdPatchStr
=
std
::
string
(
pat
.
utf8
().
get_data
());
pdDirStr
=
std
::
string
(
dir
.
utf8
().
get_data
());
}
else {*/
else
{
// Otherwise, copy the files to user folder
print
(
"Loading patch from package"
);
String
userPath
;
...
...
@@ -457,14 +458,15 @@ bool GdPd::open_patch() {
std
::
vector
<
String
>
gdpdFiles
{
"gdpd.pd"
,
"gdpd_send.pd"
,
"gdpd_receive.pd"
};
for
(
auto
&
f
:
gdpdFiles
)
{
DirAccess
::
copy_absolute
(
"res://addons/gdpd/patches/"
+
f
,
userPath
+
patchDir
+
"/"
+
f
);
Ref
<
DirAccess
>
diracc
=
DirAccess
::
open
(
"res://"
);
diracc
->
copy
(
"res://addons/gdpd/patches/"
+
f
,
userPath
+
patchDir
+
"/"
+
f
);
}
//Define new paths
pdPatchStr
=
std
::
string
(
patch
.
utf8
().
get_data
());
pdDirStr
=
std
::
string
((
userPath
+
patchDir
).
utf8
().
get_data
());
//
}
}
// Open the patch
...
...
@@ -477,6 +479,8 @@ bool GdPd::open_patch() {
else
{
print
(
"Opened patch "
+
pdPatchStr
);
m_patchOpened
=
true
;
std
::
string
patchStr
(
pd_patch
.
utf8
().
get_data
());
m_patchsMap
[
patchStr
]
=
p1
;
}
return
true
;
}
...
...
@@ -490,28 +494,29 @@ void GdPd::recurseCopy(String fromPath, String toPath) {
PackedStringArray
files
=
DirAccess
::
get_files_at
(
fromPath
);
for
(
int
i
=
0
;
i
<
files
.
size
();
++
i
)
{
String
fileName
=
files
[
i
];
print
(
"File "
+
std
::
string
(
fileName
.
utf8
().
get_data
())
);
D
ir
A
cc
ess
::
copy_absolute
(
fromPath
+
"/"
+
fileName
,
toPath
+
"/"
+
fileName
);
Ref
<
DirAccess
>
diracc
=
DirAccess
::
open
(
"res://"
);
d
ir
a
cc
->
copy
(
fromPath
+
"/"
+
fileName
,
toPath
+
"/"
+
fileName
);
print
(
"Copying "
+
std
::
string
(
fileName
.
utf8
().
get_data
())
);
}
//For each dir, call recursCopy
PackedStringArray
dirs
=
DirAccess
::
get_directories_at
(
fromPath
);
for
(
int
i
=
0
;
i
<
dirs
.
size
();
++
i
)
{
String
dirName
=
dirs
[
i
];
print
(
"Dir "
+
std
::
string
(
dirName
.
utf8
().
get_data
())
);
recurseCopy
(
fromPath
+
"/"
+
dirName
,
toPath
+
"/"
+
dirName
);
}
}
void
GdPd
::
close_patch
()
{
/
*
std::string patchStr(patch.utf8().get_data());
/
/FIXME handle multiple patches
std
::
string
patchStr
(
pd_
patch
.
utf8
().
get_data
());
if
(
m_patchsMap
.
find
(
patchStr
)
!=
m_patchsMap
.
end
())
{
m_pd
.
closePatch
(
m_patchsMap
[
patchStr
]);
m_patchsMap
.
erase
(
patchStr
);
m_patchOpened
=
false
;
print
(
"Closed patch "
+
patchStr
);
}
*/
}
}
void
GdPd
::
print
(
const
std
::
string
&
message
)
{
...
...
This diff is collapsed.
Click to expand it.
src/gdpd.h
+
0
−
11
View file @
445b278d
...
...
@@ -141,17 +141,6 @@ public:
void
send
(
String
destination
,
Array
arguments
);
/*
bool has_message();
Array get_next();
int blocksize();
void subscribe(String symbStr);
int start_message(int nbValues);
void add_symbol(String symbStr);
void add_float(float val);
int finish_list(String destStr);
*/
virtual
void
print
(
const
std
::
string
&
message
);
//libpd hooks
...
...
This diff is collapsed.
Click to expand it.
src/rtaudio/RtAudio.os
+
0
−
0
View file @
445b278d
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment