-
Notifications
You must be signed in to change notification settings - Fork 3
libsoundio + libsndfile audio backend #33
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
Open
archseer
wants to merge
59
commits into
master
Choose a base branch
from
soundio
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
fb1c086
Started work on changing to libsoundio for audio
IceDragon200 dc44e7d
Added libsoundio paths to build, moved to libsoundio as the default a…
IceDragon200 a776a20
modules/audio-gorilla: Moved headers to mimic libsoundio module
IceDragon200 933bb5f
modules/audio-libsoundio: Stubbed audio structs
IceDragon200 05a2b1d
Make libsoundio a dependency of moon-player
IceDragon200 4b83dc6
modules/audio-libsoundio: Added SoundBuffer#sampleRate
IceDragon200 6541a72
modules/audio-libsoundio: Changed SoundBuffer structure a bit
IceDragon200 b92cd67
Do not build examples or tests for libsoundio
IceDragon200 6c95457
modules/audio-libsoundio: Force linkage static libsoundio.a
IceDragon200 05dcdcb
modules/system: Added M_PI
IceDragon200 21941e0
modules/audio-libsoundio: Beware the sine wave
IceDragon200 828067c
modules/audio-libsoundio: Made suggested changes
IceDragon200 6e62a5a
Updated libsoundio submodule
IceDragon200 f8f7ff9
Get it to build on OS X.
bf37f9e
Get libsndfile to compile and link.
d51ec68
Remove the sndfile submodule because cmake already fetches it.
18dbfeb
Add Source (untested)
820c6c7
Update README
70b15bd
modules/audio-libsoundio: Fixed source.cxx compilation
IceDragon200 e57857b
Set the sample rate to 44.1khz.
972afed
Use a tarball for libsndfile. Removes autotools dep + cached builds.
137044f
Disable soundio dynamic libs
IceDragon200 c2d0d94
Simple mixer extraction (get the code to goddamn compile)
779ac8b
Try getting audio streaming to work.
1266564
Do proper logic for sndfile buffer reads.
1092c99
Add missing file
5fe7ad8
use submodule fork for now
6fea83e
Should be plureal
80e9449
GET IT TO WORK!!
35ff5fd
Don't disable external libs...
80c7c6f
Get mixing to work.
1b00ab4
Link ogg/vorbis/flac.
78aae43
Extract the clipping code.
cf32445
Clear the buffer in case we read less than what was expected.
4ddb5fd
Update README a tiny bit.
e40d991
Oopsie, fix mixing.
9aeb88d
Fix some things, implement Sound.
3b0a843
Implement audio handles.
c886970
meme-set is evil
d62cb85
FLAC vs flac!
IceDragon200 2c98661
modules/system,modules/audio-libsoundio: Added moon_memzerof and code…
IceDragon200 a01ab3f
Fix Sound, sort of.
46ce621
hmm
87d48f7
Works at proper playback speed!
0204445
Add support for pan/pitch/gain and map mono to stereo.
d9edf98
modules/audio-libsoundio: Cleaned up audio.cxx
IceDragon200 0b77791
modules/audio-libsoundio: clamp was not available on my system for so…
IceDragon200 2f001af
modules/audio-libsoundio: Stubbed Music
IceDragon200 46f000a
modules/audio-libsoundio: Stubbed Sound mruby wrapper
IceDragon200 ed5cea0
modules/audio-libsoundio: Code gardening
IceDragon200 1453bc2
travis: When running gcc, use gcc 4.8.
e2d2b95
Updated libsoundio
IceDragon200 f41df49
modules/system: Split helpers header into smaller bits
IceDragon200 4053f5b
modules/{audio-libsound,system}: Butchered audio
IceDragon200 6976975
travis: Added missing audio packages
IceDragon200 0c3645f
Revert "modules/{audio-libsound,system}: Butchered audio"
475afe6
Add seek and tell to the Source interface.
592c876
Add a Loop source.
30c5039
Use a newer xcode7.3 and osx 10.11
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,9 @@ | ||
| #ifndef MOON_MRB_HELPERS | ||
| #define MOON_MRB_HELPERS | ||
|
|
||
| #include <mruby.h> | ||
| #include <mruby/data.h> | ||
| #include <mruby/string.h> | ||
| #include <mruby/variable.h> | ||
| #include "moon/mrb/helpers/class.hxx" | ||
| #include "moon/mrb/helpers/variable.hxx" | ||
| #include "moon/mrb/helpers/error.hxx" | ||
| #include "moon/mrb/helpers/data.hxx" | ||
|
|
||
| #define IVget(_name_) mrb_iv_get(mrb, self, mrb_intern_lit(mrb, _name_)) | ||
| #define IVset(_name_, _value_) mrb_iv_set(mrb, self, mrb_intern_lit(mrb, _name_), _value_) | ||
|
|
||
| #define KEY_SHADER "@shader" | ||
| #define KEY_VBO "@vbo" | ||
| #define KEY_ORIGIN "@origin" | ||
|
|
||
| #define MOON_GET_CLASS(__name__) mrb_class_get_under(mrb, mrb_module_get(mrb, "Moon"), __name__) | ||
| #define MOON_GET_MODULE(__name__) mrb_module_get_under(mrb, mrb_module_get(mrb, "Moon"), __name__) | ||
| ; | ||
|
|
||
| static inline mrb_value | ||
| moon_iv_get(mrb_state *mrb, mrb_value self, const char *name) | ||
| { | ||
| mrb_value iv_value = mrb_iv_get(mrb, self, mrb_intern_cstr(mrb, name)); | ||
| if (mrb_nil_p(iv_value)) { | ||
| mrb_raisef(mrb, E_ARGUMENT_ERROR, "Cannot use a nil %S", mrb_str_new_cstr(mrb, name)); | ||
| } | ||
| return iv_value; | ||
| } | ||
|
|
||
| static inline void | ||
| moon_data_cleanup(mrb_state *mrb, mrb_value self) | ||
| { | ||
| void *ptr = DATA_PTR(self); | ||
| const struct mrb_data_type* type = DATA_TYPE(self); | ||
| if (ptr && type) { | ||
| type->dfree(mrb, ptr); | ||
| } | ||
| DATA_PTR(self) = NULL; | ||
| } | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #ifndef MOON_MRB_CLASS_HELPERS | ||
| #define MOON_MRB_CLASS_HELPERS | ||
|
|
||
| #include <mruby.h> | ||
| #include <mruby/class.h> | ||
|
|
||
| #define MOON_GET_CLASS(__name__) mrb_class_get_under(mrb, mrb_module_get(mrb, "Moon"), __name__) | ||
| #define MOON_GET_MODULE(__name__) mrb_module_get_under(mrb, mrb_module_get(mrb, "Moon"), __name__) | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #ifndef MOON_MRB_DATA_HELPERS | ||
| #define MOON_MRB_DATA_HELPERS | ||
|
|
||
| #include <mruby.h> | ||
| #include <mruby/data.h> | ||
|
|
||
| static inline void | ||
| moon_data_cleanup(mrb_state* mrb, mrb_value self) | ||
| { | ||
| void *ptr = DATA_PTR(self); | ||
| const struct mrb_data_type* type = DATA_TYPE(self); | ||
| if (ptr && type) { | ||
| type->dfree(mrb, ptr); | ||
| } | ||
| DATA_PTR(self) = NULL; | ||
| } | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #ifndef MOON_MRB_ERROR_HELPERS | ||
| #define MOON_MRB_ERROR_HELPERS | ||
|
|
||
| #include "moon/mrb/helpers/class.hxx" | ||
|
|
||
| #define MOON_E_FILE_NOT_FOUND MOON_GET_CLASS("FileNotFoundError") | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #ifndef MOON_MRB_VARIABLE_HELPERS | ||
| #define MOON_MRB_VARIABLE_HELPERS | ||
|
|
||
| #include <mruby.h> | ||
| #include <mruby/variable.h> | ||
| #include <mruby/string.h> | ||
|
|
||
| #define IVget(_name_) mrb_iv_get(mrb, self, mrb_intern_lit(mrb, _name_)) | ||
| #define IVset(_name_, _value_) mrb_iv_set(mrb, self, mrb_intern_lit(mrb, _name_), _value_) | ||
|
|
||
| static inline mrb_value | ||
| moon_iv_get(mrb_state* mrb, mrb_value self, const char* name) | ||
| { | ||
| mrb_value iv_value = mrb_iv_get(mrb, self, mrb_intern_cstr(mrb, name)); | ||
| if (mrb_nil_p(iv_value)) { | ||
| mrb_raisef(mrb, E_ARGUMENT_ERROR, "Cannot use a nil %S", mrb_str_new_cstr(mrb, name)); | ||
| } | ||
| return iv_value; | ||
| } | ||
|
|
||
| #define KEY_VBO "@vbo" | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| module Moon | ||
| # Error raised when a resource cannot be found on disk | ||
| class FileNotFoundError < RuntimeError | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why is this good? Now we just have more files to look at...