Refactor: create common.h and move logging function there
parent
33b615261f
commit
52a22d53c4
|
|
@ -0,0 +1,17 @@
|
|||
/*! @file common.h
|
||||
@brief Header for shared utilities and constants
|
||||
*/
|
||||
#ifndef COMMON_H_
|
||||
#define COMMON_H_
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
/*! Logs a message
|
||||
@param message The string to be logged
|
||||
*/
|
||||
static void log(std::string message) {
|
||||
std::cout << "wtpp: " << message << '\n';
|
||||
}
|
||||
|
||||
#endif // COMMON_H_
|
||||
12
src/wtpp.cpp
12
src/wtpp.cpp
|
|
@ -1,12 +1,14 @@
|
|||
#include <array>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "ini.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "wave.h"
|
||||
#include "generators.h"
|
||||
#include "wavetable.h"
|
||||
|
|
@ -14,14 +16,6 @@
|
|||
static const uint32_t DEFAULT_SAMPLE_RATE = 44100; // 44.1 kHz sampling rate
|
||||
static const uint8_t DEFAULT_BIT_DEPTH = 12;
|
||||
|
||||
/*! Logs a message
|
||||
@param message The string to be logged
|
||||
*/
|
||||
static void log(std::string message)
|
||||
{
|
||||
std::cout << "wtpp: " << message << '\n';
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
log("Generating wave cycle lookup tables");
|
||||
|
|
|
|||
Loading…
Reference in New Issue