aboutsummaryrefslogtreecommitdiff
path: root/midialsa.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-02-03 02:43:40 +0100
committerJavier <dev.git@javispedro.com>2022-02-03 13:26:11 +0100
commitf6ee95ad975119d7c3106036fd5a581a62695c85 (patch)
tree6fe7d757d7dcd15b275db8e18778d1769071c6c8 /midialsa.h
parent2f1022df0395badf03fc7cb20c82ee770b5b2c1d (diff)
downloadvmusic-f6ee95ad975119d7c3106036fd5a581a62695c85.tar.gz
vmusic-f6ee95ad975119d7c3106036fd5a581a62695c85.zip
mpu401: rework using circbuf and add optional irq support for uart rx
Diffstat (limited to 'midialsa.h')
-rw-r--r--midialsa.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/midialsa.h b/midialsa.h
index f41200b..eb2fe2c 100644
--- a/midialsa.h
+++ b/midialsa.h
@@ -19,8 +19,7 @@
#ifndef VMUSIC_MIDIALSA_H
#define VMUSIC_MIDIALSA_H
-#include <stddef.h>
-#include <stdint.h>
+#include <iprt/types.h>
typedef struct _snd_rawmidi snd_rawmidi_t;
@@ -30,20 +29,24 @@ public:
MIDIAlsa();
~MIDIAlsa();
+ /** dev has no effect right now. */
int open(const char *dev);
int close();
- ssize_t writeAvail();
+ /** reset device, dropping all buffers, but keep open */
+ int reset();
+
+ int poll(uint32_t events, uint32_t *revents, RTMSINTERVAL millies);
+ int pollInterrupt();
+
ssize_t write(uint8_t *data, size_t len);
- ssize_t readAvail();
ssize_t read(uint8_t *buf, size_t len);
- int reset();
-
private:
snd_rawmidi_t *_in;
snd_rawmidi_t *_out;
+ int _eventfd;
};
#endif