From 6abdf8900928e81ec72a296316ded3567669d7e4 Mon Sep 17 00:00:00 2001 From: rkcf Date: Sun, 26 Feb 2023 05:49:13 -0600 Subject: [PATCH] Refactor: breakout function definition to cpp file --- src/wavetable.cpp | 8 ++++++++ src/wavetable.h | 9 ++------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 src/wavetable.cpp diff --git a/src/wavetable.cpp b/src/wavetable.cpp new file mode 100644 index 0000000..a52393d --- /dev/null +++ b/src/wavetable.cpp @@ -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; +} diff --git a/src/wavetable.h b/src/wavetable.h index d3490f6..2e75ba9 100644 --- a/src/wavetable.h +++ b/src/wavetable.h @@ -9,18 +9,13 @@ /* Table of single cycle wave lookup tables */ class Wavetable { -private: + private: uint16_t m_id{}; // Unique ID number of wavetable std::string m_name{}; // String name of wavetable std::array m_table; // table data public: - std::string name() { - std::string id_str = std::to_string(m_id); - id_str.append(": "); - id_str.append(m_name); - return id_str; - } + std::string name(); void set_table(std::array table) { m_table = table; } };