aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/midi/base.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-01 00:36:44 -0700
committerChris Robinson <[email protected]>2014-07-01 00:36:44 -0700
commit3c6752e76521cf8c2437c01377dcf354ca080196 (patch)
treeac18e430aa60c89e8431c333a34b17082ba8d07e /Alc/midi/base.h
parentc06bb88756b60b5d1fe7b9c30d629bad75a6f68b (diff)
Print SF2 text INFO chunks
Diffstat (limited to 'Alc/midi/base.h')
-rw-r--r--Alc/midi/base.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Alc/midi/base.h b/Alc/midi/base.h
index 42a4c279..157f2399 100644
--- a/Alc/midi/base.h
+++ b/Alc/midi/base.h
@@ -17,8 +17,13 @@ typedef struct Reader {
void *ptr;
int error;
} Reader;
-#define READ(x_, buf_, len_) ((x_)->cb((buf_), (len_), (x_)->ptr))
-#define READERR(x_) ((x_)->error)
+inline size_t Reader_read(Reader *self, void *buf, size_t len)
+{
+ size_t got = (!self->error) ? self->cb(buf, len, self->ptr) : 0;
+ if(got < len) self->error = 1;
+ return got;
+}
+#define READERR(x_) ((x_)->error)
ALboolean loadSf2(Reader *stream, struct ALsoundfont *sfont, ALCcontext *context);