blob: 8045684c0fca67ac4e1c4e443a2a86a750fd04fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#pragma once
#include "config.h"
#include "debug.h"
#include "log.h"
#include <boost/signals2.hpp>
#include <fmt/format.h>
#include <iostream>
class MIDI
{
public:
MIDI();
~MIDI();
boost::signals2::signal<void(int, int, uint64_t)> signal_note;
boost::signals2::signal<void()> signal_active_sensing;
boost::signals2::signal<void()> signal_clock;
boost::signals2::signal<void()> signal_count_events;
int fd();
bool event_ready();
snd_seq_event_t *read(void);
// returns if click starts
void process(snd_seq_event_t *ev);
void flush();
void wait_for_event();
private:
snd_seq_t *seq_handle;
int in_port;
int npfd;
struct pollfd* pfd;
};
|