Skip to content

Commit

Permalink
Revert "Add support for building DLLs on Windows"
Browse files Browse the repository at this point in the history
This reverts commit 9f824f0.
  • Loading branch information
Be-ing committed Jan 15, 2021
1 parent 1c55a91 commit 64cfc92
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 40 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ add_library(keyfinder
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(FFTW3 REQUIRED)
target_link_libraries(keyfinder PUBLIC FFTW3::fftw3)

target_include_directories(keyfinder PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if(MSVC AND BUILD_SHARED_LIBS)
target_compile_definitions(keyfinder PRIVATE KEYFINDER_DLLEXPORT)
endif()

#
# Installation
Expand Down
2 changes: 1 addition & 1 deletion src/audiodata.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC AudioData {
class AudioData {
public:
AudioData();

Expand Down
4 changes: 1 addition & 3 deletions src/binode.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
#ifndef BINODE_H
#define BINODE_H

#include "constants.h"

namespace KeyFinder {

template <class T>
class KEYFINDER_DECLSPEC Binode {
class Binode {
public:
Binode(T x = 0): l(0), r(0), data(x) {}
Binode* l, *r;
Expand Down
2 changes: 1 addition & 1 deletion src/chromagram.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC Chromagram {
class Chromagram {
public:
Chromagram(unsigned int hops = 0);
void append(const Chromagram& that);
Expand Down
2 changes: 1 addition & 1 deletion src/chromatransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC ChromaTransform {
class ChromaTransform {
public:
ChromaTransform(unsigned int frameRate);
std::vector<double> chromaVector(const FftAdapter* const fft) const;
Expand Down
6 changes: 3 additions & 3 deletions src/chromatransformfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#ifndef CHROMATRANSFORMFACTORY_H
#define CHROMATRANSFORMFACTORY_H

#include "chromatransform.h"
#include "constants.h"
#include "chromatransform.h"

namespace KeyFinder {

class KEYFINDER_DECLSPEC ChromaTransformFactory {
class ChromaTransformFactory {
public:
ChromaTransformFactory();
~ChromaTransformFactory();
Expand All @@ -38,7 +38,7 @@ namespace KeyFinder {
std::mutex chromaTransformFactoryMutex;
};

class KEYFINDER_DECLSPEC ChromaTransformFactory::ChromaTransformWrapper {
class ChromaTransformFactory::ChromaTransformWrapper {
public:
ChromaTransformWrapper(unsigned int frameRate, const ChromaTransform* const transform);
~ChromaTransformWrapper();
Expand Down
14 changes: 4 additions & 10 deletions src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
#ifndef CONSTANTS_H
#define CONSTANTS_H

#ifdef KEYFINDER_DLLEXPORT
#define KEYFINDER_DECLSPEC __declspec(dllexport)
#else
#define KEYFINDER_DECLSPEC
#endif

#include <cmath>
#include <vector>
#include <deque>
Expand Down Expand Up @@ -101,11 +95,11 @@ namespace KeyFinder {
SCALE_MINOR
};

KEYFINDER_DECLSPEC double getFrequencyOfBand(unsigned int band);
KEYFINDER_DECLSPEC double getLastFrequency();
double getFrequencyOfBand(unsigned int band);
double getLastFrequency();

KEYFINDER_DECLSPEC const std::vector<double>& toneProfileMajor();
KEYFINDER_DECLSPEC const std::vector<double>& toneProfileMinor();
const std::vector<double>& toneProfileMajor();
const std::vector<double>& toneProfileMinor();
}

#endif
4 changes: 1 addition & 3 deletions src/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
#include <stdexcept>
#include <sstream>

#include "constants.h"

namespace KeyFinder {

class KEYFINDER_DECLSPEC Exception : public std::runtime_error {
class Exception : public std::runtime_error {
public:
Exception(const char* msg) : std::runtime_error(msg) { }
};
Expand Down
4 changes: 2 additions & 2 deletions src/fftadapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace KeyFinder {
class FftAdapterPrivate;
class InverseFftAdapterPrivate;

class KEYFINDER_DECLSPEC FftAdapter {
class FftAdapter {
public:
FftAdapter(unsigned int frameSize);
~FftAdapter();
Expand All @@ -44,7 +44,7 @@ namespace KeyFinder {
FftAdapterPrivate* priv;
};

class KEYFINDER_DECLSPEC InverseFftAdapter {
class InverseFftAdapter {
public:
InverseFftAdapter(unsigned int frameSize);
~InverseFftAdapter();
Expand Down
2 changes: 1 addition & 1 deletion src/keyclassifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC KeyClassifier {
class KeyClassifier {
public:
KeyClassifier(const std::vector<double>& majorProfile, const std::vector<double>& minorProfile);
~KeyClassifier();
Expand Down
3 changes: 1 addition & 2 deletions src/keyfinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@
#define KEYFINDER_H

#include "audiodata.h"
#include "constants.h"
#include "lowpassfilterfactory.h"
#include "chromatransformfactory.h"
#include "spectrumanalyser.h"
#include "keyclassifier.h"

namespace KeyFinder {

class KEYFINDER_DECLSPEC KeyFinder {
class KeyFinder {
public:

// for progressive analysis
Expand Down
2 changes: 1 addition & 1 deletion src/lowpassfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace KeyFinder {

class LowPassFilterPrivate;

class KEYFINDER_DECLSPEC LowPassFilter {
class LowPassFilter {
public:
LowPassFilter(unsigned int order, unsigned int frameRate, double cornerFrequency, unsigned int fftFrameSize);
~LowPassFilter();
Expand Down
4 changes: 2 additions & 2 deletions src/lowpassfilterfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC LowPassFilterFactory {
class LowPassFilterFactory {
public:
LowPassFilterFactory();
~LowPassFilterFactory();
Expand All @@ -38,7 +38,7 @@ namespace KeyFinder {
std::mutex lowPassFilterFactoryMutex;
};

class KEYFINDER_DECLSPEC LowPassFilterFactory::LowPassFilterWrapper {
class LowPassFilterFactory::LowPassFilterWrapper {
public:
LowPassFilterWrapper(unsigned int order, unsigned int frameRate, double cornerFrequency, unsigned int fftFrameSize, const LowPassFilter* const filter);
~LowPassFilterWrapper();
Expand Down
2 changes: 1 addition & 1 deletion src/spectrumanalyser.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC SpectrumAnalyser {
class SpectrumAnalyser {
public:
SpectrumAnalyser(unsigned int frameRate, ChromaTransformFactory* ctFactory, TemporalWindowFactory* twFactory);
Chromagram* chromagramOfWholeFrames(AudioData& audio, FftAdapter* const fft) const;
Expand Down
4 changes: 2 additions & 2 deletions src/temporalwindowfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC TemporalWindowFactory {
class TemporalWindowFactory {
public:
TemporalWindowFactory();
~TemporalWindowFactory();
Expand All @@ -38,7 +38,7 @@ namespace KeyFinder {
std::mutex temporalWindowFactoryMutex;
};

class KEYFINDER_DECLSPEC TemporalWindowFactory::TemporalWindowWrapper {
class TemporalWindowFactory::TemporalWindowWrapper {
public:
TemporalWindowWrapper(unsigned int frameSize);
unsigned int getFrameSize() const;
Expand Down
2 changes: 1 addition & 1 deletion src/toneprofiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC ToneProfile {
class ToneProfile {
public:
ToneProfile(const std::vector<double>& customProfile);
~ToneProfile();
Expand Down
2 changes: 1 addition & 1 deletion src/windowfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace KeyFinder {

class KEYFINDER_DECLSPEC WindowFunction {
class WindowFunction {
public:
double window(temporal_window_t windowType, int sample, int width) const;
double gaussianWindow(int sample, int width, double sigma) const;
Expand Down
3 changes: 1 addition & 2 deletions src/workspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
#include "audiodata.h"
#include "binode.h"
#include "chromagram.h"
#include "constants.h"
#include "fftadapter.h"

namespace KeyFinder {

class KEYFINDER_DECLSPEC Workspace {
class Workspace {
public:
Workspace();
~Workspace();
Expand Down

0 comments on commit 64cfc92

Please sign in to comment.