Refactor: breakout function definition to cpp file

pull/5/head
rkcf 2023-02-26 05:49:13 -06:00
parent 145677f0f2
commit 6abdf89009
2 changed files with 10 additions and 7 deletions

8
src/wavetable.cpp Normal file
View File

@ -0,0 +1,8 @@
#include "wavetable.h"
std::string Wavetable::name() {
std::string id_str = std::to_string(m_id);
id_str.append(": ");
id_str.append(m_name);
return id_str;
}

View File

@ -9,18 +9,13 @@
/* Table of single cycle wave lookup tables */ /* Table of single cycle wave lookup tables */
class Wavetable { class Wavetable {
private: private:
uint16_t m_id{}; // Unique ID number of wavetable uint16_t m_id{}; // Unique ID number of wavetable
std::string m_name{}; // String name of wavetable std::string m_name{}; // String name of wavetable
std::array<Wave, DEFAULT_N_SAMPLES> m_table; // table data std::array<Wave, DEFAULT_N_SAMPLES> m_table; // table data
public: public:
std::string name() { std::string name();
std::string id_str = std::to_string(m_id);
id_str.append(": ");
id_str.append(m_name);
return id_str;
}
void set_table(std::array<Wave, DEFAULT_N_SAMPLES> table) { m_table = table; } void set_table(std::array<Wave, DEFAULT_N_SAMPLES> table) { m_table = table; }
}; };