-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for DSP buffer size #96
Changes from 3 commits
6842eec
03ee1bf
5b277b1
cc59eb4
e481043
61835aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,8 @@ namespace godot { | |
int actualListenerNumber = 0; | ||
Listener listeners[FMOD_MAX_LISTENERS]; | ||
bool listenerWarning = true; | ||
unsigned int bufferlength = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there is no value in storing those variables inside the class. In the 2 getters, you can just create a local variable, pass its pointers to FMOD, then return it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
int numbuffers = 0; | ||
|
||
Vector<LoadingBank *> loadingBanks; | ||
Map<String, FMOD::Studio::Bank *> banks; | ||
|
@@ -183,6 +185,9 @@ namespace godot { | |
void setListenerLock(int index, bool isLocked); | ||
bool getListenerLock(int index); | ||
Node* getObjectAttachedToListener(int index); | ||
void setSystemDSPBufferSize(unsigned int bufferlength, int numbuffers); | ||
int getSystemDSPBufferLength(); | ||
int getSystemDSPNumBuffers(); | ||
|
||
String loadBank(String pathToBank, unsigned int flag); | ||
void unloadBank(String pathToBank); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we should not return an array containing lenght and num instead of having two getter that does same things but only return partial information ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a long think about this: from a usability perspective, it will be quite confusing to Godot users to suddenly get an
Array
as return type as it is not very explicit what these values actually mean. On the contrary, it is not performant to request both values separately, however, the FMOD C++ binding forces us to pass in both by reference always.If you are happy I can make that change to return an
Array
, however, it may get confusing to users what these values mean.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more on the side of having 2 getters. It's not like we need performance for that, it's just a simple API call. So it's better to favor usability.
We can also gave both: 2 separate getter returning one value, and one getter
getSystemDSPInfo
that returns an array or dictionnary with string key.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed!