diff --git a/app/common/CMakeLists.txt b/app/common/CMakeLists.txt index 6c5ca6ef6..cbe006e96 100644 --- a/app/common/CMakeLists.txt +++ b/app/common/CMakeLists.txt @@ -16,6 +16,7 @@ set(OLIVE_SOURCES ${OLIVE_SOURCES} + common/channellayout.h common/clamp.h common/lerp.h common/rational.h diff --git a/app/common/channellayout.h b/app/common/channellayout.h new file mode 100644 index 000000000..7d62061eb --- /dev/null +++ b/app/common/channellayout.h @@ -0,0 +1,8 @@ +#ifndef CHANNELLAYOUT_H +#define CHANNELLAYOUT_H + +extern "C" { +#include +} + +#endif // CHANNELLAYOUT_H diff --git a/app/common/decibel.cpp b/app/common/decibel.cpp index 7393ba79c..c93efbc95 100644 --- a/app/common/decibel.cpp +++ b/app/common/decibel.cpp @@ -1,6 +1,11 @@ #include "decibel.h" -decibel::decibel() -{ +#include +double amplitude_to_db(double amplitude) { + return (20.0*(qLn(amplitude)/qLn(10.0))); +} + +double db_to_amplitude(double db) { + return qPow(M_E, (db*qLn(10.0))/20.0); } diff --git a/app/dialog/sequence/sequence.cpp b/app/dialog/sequence/sequence.cpp index 9dee5c098..dc191e0e9 100644 --- a/app/dialog/sequence/sequence.cpp +++ b/app/dialog/sequence/sequence.cpp @@ -20,10 +20,6 @@ #include "sequence.h" -extern "C" { -#include -} - #include #include #include @@ -31,6 +27,7 @@ extern "C" { #include #include +#include "common/channellayout.h" #include "common/rational.h" #include "undo/undostack.h" diff --git a/app/project/item/footage/audiostream.h b/app/project/item/footage/audiostream.h index 92e826301..6a89b953a 100644 --- a/app/project/item/footage/audiostream.h +++ b/app/project/item/footage/audiostream.h @@ -21,10 +21,6 @@ #ifndef AUDIOSTREAM_H #define AUDIOSTREAM_H -extern "C" { -#include -} - #include "common/rational.h" #include "stream.h" diff --git a/app/project/item/sequence/sequence.cpp b/app/project/item/sequence/sequence.cpp index a903f1c33..7b604da11 100644 --- a/app/project/item/sequence/sequence.cpp +++ b/app/project/item/sequence/sequence.cpp @@ -20,10 +20,7 @@ #include "sequence.h" -extern "C" { -#include -} - +#include "common/channellayout.h" #include "ui/icons/icons.h" Sequence::Sequence()