summaryrefslogtreecommitdiffhomepage
path: root/config.h
blob: 07d3819b6b656241aab37267caa6e96d28b4c7ab (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
#pragma once

#include <alsa/asoundlib.h>

// Defaults
static const int CLICK_NOTE = 37;
static const int CLICK_CHANNEL = 4;
extern const char *device;    // playback device
const snd_pcm_sframes_t nframes = 1024;   // ~1/44th sec buffer size
const unsigned int f_sample = 44100;
const int log_lines = 10;
const int default_bpm = 120;
const int pcm_latency_us = 100000;
const int click_latency_frames = 10000;

class Config
{
public:
  Config();
  ~Config();

  int get_midi_channel();
  void set_midi_channel(int channel);

  int get_midi_note();
  void set_midi_note(int note);

  int get_bpm();
  void set_bpm(int bpm);

  void recover();
  void persist();

private:
  int m_midi_channel;
  int m_midi_note;
  int m_bpm;
};