Put common parts of cvin/cvout into cvbase class
parent
ade023d2d5
commit
8b8e5e4e97
|
@ -10,6 +10,7 @@ pkg_check_modules(JACK jack>=0.118)
|
||||||
SET(SOURCES
|
SET(SOURCES
|
||||||
client.cpp
|
client.cpp
|
||||||
client.h
|
client.h
|
||||||
|
cvbase.h
|
||||||
cvin.cpp
|
cvin.cpp
|
||||||
cvin.h
|
cvin.h
|
||||||
cvout.cpp
|
cvout.cpp
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
#ifndef CVBASE_H
|
||||||
|
#define CVBASE_H
|
||||||
|
|
||||||
|
#include "client.h"
|
||||||
|
#include "mapping.h"
|
||||||
|
|
||||||
|
class CVBase : protected Client
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
MappingList m_mapping_list;
|
||||||
|
bool m_ready;
|
||||||
|
tick_t m_tick;
|
||||||
|
|
||||||
|
sample_t **m_buffers;
|
||||||
|
|
||||||
|
MappingList::iterator m_it_begin;
|
||||||
|
MappingList::iterator m_it_end;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void add_mapping(Mapping m)
|
||||||
|
{
|
||||||
|
m_mapping_list.push_back(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
void stop()
|
||||||
|
{
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CVBASE_H
|
22
cvin.h
22
cvin.h
|
@ -1,36 +1,18 @@
|
||||||
#ifndef CVIN_H
|
#ifndef CVIN_H
|
||||||
#define CVIN_H
|
#define CVIN_H
|
||||||
|
|
||||||
#include "client.h"
|
#include "cvbase.h"
|
||||||
#include "mapping.h"
|
|
||||||
|
|
||||||
class CVIn : Client
|
class CVIn : public CVBase
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
MappingList m_mapping_list;
|
|
||||||
jack_port_t *m_midi_out;
|
jack_port_t *m_midi_out;
|
||||||
bool m_ready;
|
|
||||||
tick_t m_tick;
|
|
||||||
|
|
||||||
sample_t **m_buffers;
|
|
||||||
|
|
||||||
MappingList::iterator m_it_begin;
|
|
||||||
MappingList::iterator m_it_end;
|
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
int process(jack_nframes_t nframes);
|
int process(jack_nframes_t nframes);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void add_mapping(Mapping m)
|
|
||||||
{
|
|
||||||
m_mapping_list.push_back(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
void stop()
|
|
||||||
{
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CVIN_H
|
#endif // CVIN_H
|
||||||
|
|
26
cvout.h
26
cvout.h
|
@ -1,20 +1,14 @@
|
||||||
#include "client.h"
|
#ifndef CVOUT_H
|
||||||
#include "mapping.h"
|
#define CVOUT_H
|
||||||
|
|
||||||
|
#include "cvbase.h"
|
||||||
|
|
||||||
#define MAX_MIDI_CHANNELS 16
|
#define MAX_MIDI_CHANNELS 16
|
||||||
|
|
||||||
class CVOut : Client
|
class CVOut : public CVBase
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
MappingList m_mapping_list;
|
|
||||||
jack_port_t *m_midi_in;
|
jack_port_t *m_midi_in;
|
||||||
bool m_ready;
|
|
||||||
tick_t m_tick;
|
|
||||||
|
|
||||||
sample_t **m_buffers;
|
|
||||||
|
|
||||||
MappingList::iterator m_it_begin;
|
|
||||||
MappingList::iterator m_it_end;
|
|
||||||
|
|
||||||
char m_nrpn_msb[MAX_MIDI_CHANNELS];
|
char m_nrpn_msb[MAX_MIDI_CHANNELS];
|
||||||
char m_nrpn_lsb[MAX_MIDI_CHANNELS];
|
char m_nrpn_lsb[MAX_MIDI_CHANNELS];
|
||||||
|
@ -24,15 +18,7 @@ private:
|
||||||
int process(jack_nframes_t nframes);
|
int process(jack_nframes_t nframes);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void add_mapping(Mapping m)
|
|
||||||
{
|
|
||||||
m_mapping_list.push_back(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
void stop()
|
|
||||||
{
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // CVOUT_H
|
||||||
|
|
Loading…
Reference in New Issue