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
b2a24dd5
Commit
b2a24dd5
authored
5 years ago
by
BERTHAUT Florent
Browse files
Options
Downloads
Patches
Plain Diff
Added buffer size setting
parent
addab6e9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gdpd.cpp
+5
-3
5 additions, 3 deletions
src/gdpd.cpp
src/gdpd.hpp
+1
-1
1 addition, 1 deletion
src/gdpd.hpp
with
6 additions
and
4 deletions
src/gdpd.cpp
+
5
−
3
View file @
b2a24dd5
...
...
@@ -15,7 +15,9 @@ void Gdpd::_register_methods() {
register_method
(
"set_volume"
,
&
Gdpd
::
set_volume
);
}
int
Gdpd
::
audioCallback
(
void
*
outputBuffer
,
void
*
inputBuffer
,
unsigned
int
nBufferFrames
,
double
streamTime
,
RtAudioStreamStatus
status
,
void
*
userData
){
int
Gdpd
::
audioCallback
(
void
*
outputBuffer
,
void
*
inputBuffer
,
unsigned
int
nBufferFrames
,
double
streamTime
,
RtAudioStreamStatus
status
,
void
*
userData
){
Gdpd
*
gdpd
=
static_cast
<
Gdpd
*>
(
userData
);
gdpd
->
processAudio
(
outputBuffer
,
inputBuffer
,
nBufferFrames
,
streamTime
,
status
,
userData
);
...
...
@@ -32,7 +34,7 @@ void Gdpd::_init() {
Gdpd
::~
Gdpd
()
{
}
int
Gdpd
::
init
(
int
nbInputs
,
int
nbOutputs
,
int
sampleRate
)
{
int
Gdpd
::
init
(
int
nbInputs
,
int
nbOutputs
,
int
sampleRate
,
int
bufferSize
)
{
if
(
!
m_pd
.
init
(
nbInputs
,
nbOutputs
,
sampleRate
,
true
))
{
Godot
::
print
(
"GDPD : Error starting libpd"
);
...
...
@@ -62,7 +64,7 @@ int Gdpd::init(int nbInputs, int nbOutputs, int sampleRate) {
inParams
.
deviceId
=
m_audio
.
getDefaultOutputDevice
();
outParams
.
nChannels
=
m_nbInputs
=
nbInputs
;
inParams
.
nChannels
=
m_nbOutputs
=
nbOutputs
;
m_bufferFrames
=
128
;
m_bufferFrames
=
bufferSize
;
RtAudio
::
StreamOptions
options
;
options
.
streamName
=
"gdpd"
;
...
...
This diff is collapsed.
Click to expand it.
src/gdpd.hpp
+
1
−
1
View file @
b2a24dd5
...
...
@@ -38,7 +38,7 @@ public:
void
_init
();
//libpd functions
int
init
(
int
nbInputs
,
int
nbOutputs
,
int
sampleRate
);
int
init
(
int
nbInputs
,
int
nbOutputs
,
int
sampleRate
,
int
bufferSize
);
void
openfile
(
String
basename
,
String
dirname
);
void
closefile
();
bool
has_message
();
...
...
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