Skip to content
Open
Show file tree
Hide file tree
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 Sep 8, 2015
dc44e7d
Added libsoundio paths to build, moved to libsoundio as the default a…
IceDragon200 Jun 29, 2016
a776a20
modules/audio-gorilla: Moved headers to mimic libsoundio module
IceDragon200 Jun 29, 2016
933bb5f
modules/audio-libsoundio: Stubbed audio structs
IceDragon200 Jun 29, 2016
05a2b1d
Make libsoundio a dependency of moon-player
IceDragon200 Jun 29, 2016
4b83dc6
modules/audio-libsoundio: Added SoundBuffer#sampleRate
IceDragon200 Jun 29, 2016
6541a72
modules/audio-libsoundio: Changed SoundBuffer structure a bit
IceDragon200 Jun 29, 2016
b92cd67
Do not build examples or tests for libsoundio
IceDragon200 Jun 29, 2016
6c95457
modules/audio-libsoundio: Force linkage static libsoundio.a
IceDragon200 Jun 29, 2016
05dcdcb
modules/system: Added M_PI
IceDragon200 Jun 29, 2016
21941e0
modules/audio-libsoundio: Beware the sine wave
IceDragon200 Jun 29, 2016
828067c
modules/audio-libsoundio: Made suggested changes
IceDragon200 Jun 30, 2016
6e62a5a
Updated libsoundio submodule
IceDragon200 Jun 30, 2016
f8f7ff9
Get it to build on OS X.
Jun 30, 2016
bf37f9e
Get libsndfile to compile and link.
Jun 30, 2016
d51ec68
Remove the sndfile submodule because cmake already fetches it.
Jun 30, 2016
18dbfeb
Add Source (untested)
Jun 30, 2016
820c6c7
Update README
Jun 30, 2016
70b15bd
modules/audio-libsoundio: Fixed source.cxx compilation
IceDragon200 Jul 1, 2016
e57857b
Set the sample rate to 44.1khz.
Jul 2, 2016
972afed
Use a tarball for libsndfile. Removes autotools dep + cached builds.
Jul 4, 2016
137044f
Disable soundio dynamic libs
IceDragon200 Jul 2, 2016
c2d0d94
Simple mixer extraction (get the code to goddamn compile)
Jul 4, 2016
779ac8b
Try getting audio streaming to work.
Jul 4, 2016
1266564
Do proper logic for sndfile buffer reads.
Jul 4, 2016
1092c99
Add missing file
Jul 4, 2016
5fe7ad8
use submodule fork for now
Jul 4, 2016
6fea83e
Should be plureal
Jul 4, 2016
80e9449
GET IT TO WORK!!
Jul 4, 2016
35ff5fd
Don't disable external libs...
Jul 4, 2016
80c7c6f
Get mixing to work.
Jul 5, 2016
1b00ab4
Link ogg/vorbis/flac.
Jul 5, 2016
78aae43
Extract the clipping code.
Jul 5, 2016
cf32445
Clear the buffer in case we read less than what was expected.
Jul 5, 2016
4ddb5fd
Update README a tiny bit.
Jul 5, 2016
e40d991
Oopsie, fix mixing.
Jul 5, 2016
9aeb88d
Fix some things, implement Sound.
Jul 5, 2016
3b0a843
Implement audio handles.
Jul 6, 2016
c886970
meme-set is evil
Jul 6, 2016
d62cb85
FLAC vs flac!
IceDragon200 Jul 6, 2016
2c98661
modules/system,modules/audio-libsoundio: Added moon_memzerof and code…
IceDragon200 Jul 6, 2016
a01ab3f
Fix Sound, sort of.
Jul 6, 2016
46ce621
hmm
Jul 6, 2016
87d48f7
Works at proper playback speed!
Jul 6, 2016
0204445
Add support for pan/pitch/gain and map mono to stereo.
Jul 9, 2016
d9edf98
modules/audio-libsoundio: Cleaned up audio.cxx
IceDragon200 Jul 9, 2016
0b77791
modules/audio-libsoundio: clamp was not available on my system for so…
IceDragon200 Jul 9, 2016
2f001af
modules/audio-libsoundio: Stubbed Music
IceDragon200 Jul 9, 2016
46f000a
modules/audio-libsoundio: Stubbed Sound mruby wrapper
IceDragon200 Jul 9, 2016
ed5cea0
modules/audio-libsoundio: Code gardening
IceDragon200 Jul 9, 2016
1453bc2
travis: When running gcc, use gcc 4.8.
Jul 10, 2016
e2d2b95
Updated libsoundio
IceDragon200 Jul 10, 2016
f41df49
modules/system: Split helpers header into smaller bits
IceDragon200 Jul 15, 2016
4053f5b
modules/{audio-libsound,system}: Butchered audio
IceDragon200 Jul 15, 2016
6976975
travis: Added missing audio packages
IceDragon200 Jul 15, 2016
0c3645f
Revert "modules/{audio-libsound,system}: Butchered audio"
Jul 17, 2016
475afe6
Add seek and tell to the Source interface.
Jul 17, 2016
592c876
Add a Loop source.
Jul 17, 2016
30c5039
Use a newer xcode7.3 and osx 10.11
Jul 17, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 4 additions & 35 deletions modules/system/include/moon/mrb/helpers.hxx
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"
Copy link
Copy Markdown
Member Author

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...

#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
10 changes: 10 additions & 0 deletions modules/system/include/moon/mrb/helpers/class.hxx
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
18 changes: 18 additions & 0 deletions modules/system/include/moon/mrb/helpers/data.hxx
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
8 changes: 8 additions & 0 deletions modules/system/include/moon/mrb/helpers/error.hxx
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
23 changes: 23 additions & 0 deletions modules/system/include/moon/mrb/helpers/variable.hxx
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
2 changes: 1 addition & 1 deletion modules/system/include/moon/mrb_err.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
#include <mruby/class.h>
#include <mruby/value.h>

extern bool mmrb_check_class(mrb_state *mrb, mrb_value obj, struct RClass *klass, bool quiet);
extern bool mmrb_check_class(mrb_state *mrb, mrb_value obj, struct RClass* klass, bool quiet);

#endif
5 changes: 5 additions & 0 deletions modules/system/mrblib/file_not_found_error.rb
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