Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MINT
godot-addons
gdpd
Commits
9f095289
Commit
9f095289
authored
May 21, 2020
by
BERTHAUT Florent
Browse files
Added subscribe method
parent
83b02b0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gdpd.cpp
View file @
9f095289
...
@@ -6,6 +6,7 @@ void Gdpd::_register_methods() {
...
@@ -6,6 +6,7 @@ void Gdpd::_register_methods() {
register_method
(
"init"
,
&
Gdpd
::
init
);
register_method
(
"init"
,
&
Gdpd
::
init
);
register_method
(
"openfile"
,
&
Gdpd
::
openfile
);
register_method
(
"openfile"
,
&
Gdpd
::
openfile
);
register_method
(
"closefile"
,
&
Gdpd
::
closefile
);
register_method
(
"closefile"
,
&
Gdpd
::
closefile
);
register_method
(
"subscribe"
,
&
Gdpd
::
subscribe
);
register_method
(
"has_message"
,
&
Gdpd
::
has_message
);
register_method
(
"has_message"
,
&
Gdpd
::
has_message
);
register_method
(
"get_next"
,
&
Gdpd
::
get_next
);
register_method
(
"get_next"
,
&
Gdpd
::
get_next
);
register_method
(
"start_message"
,
&
Gdpd
::
start_message
);
register_method
(
"start_message"
,
&
Gdpd
::
start_message
);
...
@@ -124,6 +125,12 @@ void Gdpd::closefile() {
...
@@ -124,6 +125,12 @@ void Gdpd::closefile() {
m_pd
.
closePatch
(
m_patch
);
m_pd
.
closePatch
(
m_patch
);
}
}
void
Gdpd
::
subscribe
(
String
symbStr
)
{
std
::
wstring
symbWs
=
symbStr
.
unicode_str
();
std
::
string
symbS
(
symbWs
.
begin
(),
symbWs
.
end
());
m_pd
.
subscribe
(
symbS
.
c_str
());
}
bool
Gdpd
::
has_message
()
{
bool
Gdpd
::
has_message
()
{
//receive new messages
//receive new messages
m_pd
.
receiveMessages
();
m_pd
.
receiveMessages
();
...
...
src/gdpd.hpp
View file @
9f095289
...
@@ -44,6 +44,7 @@ public:
...
@@ -44,6 +44,7 @@ public:
bool
has_message
();
bool
has_message
();
Array
get_next
();
Array
get_next
();
int
blocksize
();
int
blocksize
();
void
subscribe
(
String
symbStr
);
int
start_message
(
int
nbValues
);
int
start_message
(
int
nbValues
);
void
add_symbol
(
String
symbStr
);
void
add_symbol
(
String
symbStr
);
void
add_float
(
float
val
);
void
add_float
(
float
val
);
...
...
Write
Preview
Supports
Markdown
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