blob: 811bea40068a0c65c7a9e52f7f9cfb14a9499c4e (
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
|
#pragma once
#include <string>
#include <vector>
#include <boost/process.hpp>
#include <alsa/asoundlib.h>
#include <filesystem>
class MIDIPlayer
{
public:
MIDIPlayer(const std::filesystem::path& path = ".");
void start();
void stop();
bool is_playing();
void set_file(const std::string& filename);
std::string get_file();
std::vector<std::string> get_filelist();
int get_midi_port();
private:
void init_seq(void);
void close_seq(void);
void iterate_ports(void);
boost::process::child m_child;
std::filesystem::path m_dir;
std::string m_file;
snd_seq_t* m_seq;
int m_client;
};
|