various small code cleanups and improvements

Largely refactoring work to make the code somewhat nicer to work with.
This commit is contained in:
itsmattkc
2019-12-26 19:00:08 +11:00
parent 83077c939e
commit 61c60e00d6
87 changed files with 596 additions and 567 deletions
+5 -2
View File
@@ -18,22 +18,25 @@ set(OLIVE_SOURCES
${OLIVE_SOURCES}
common/channellayout.h
common/clamp.h
common/constructors.h
common/debug.h
common/debug.cpp
common/define.h
common/filefunctions.h
common/filefunctions.cpp
common/flipmodifiers.h
common/flipmodifiers.cpp
common/lerp.h
common/qtversionabstraction.h
common/qtversionabstraction.cpp
common/range.h
common/rational.h
common/rational.cpp
common/qtversionabstraction.h
common/qtversionabstraction.cpp
common/threadedobject.h
common/threadedobject.cpp
common/timecodefunctions.h
common/timecodefunctions.cpp
common/timelinecommon.h
common/timerange.h
common/timerange.cpp
PARENT_SCOPE
-11
View File
@@ -1,11 +0,0 @@
#include "decibel.h"
#include <QtMath>
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);
}
-18
View File
@@ -1,18 +0,0 @@
#ifndef DECIBEL_H
#define DECIBEL_H
/**
* @brief Converts an amplitude into a value in decibels
*
* Converts a 0.0-1.0 amplitude into an infinity-0.0 decibel value
*/
double amplitude_to_db(double amplitude);
/**
* @brief Converts decibels into an amplitude value
*
* Converts an infinity-0.0 decibel value into a 0.0-1.0 amplitude
*/
double db_to_amplitude(double db);
#endif // DECIBEL_H
+9
View File
@@ -24,4 +24,13 @@
const int kRGBChannels = 3;
const int kRGBAChannels = 4;
/// The minimum size an icon in ProjectExplorer can be
const int kProjectIconSizeMinimum = 16;
/// The maximum size an icon in ProjectExplorer can be
const int kProjectIconSizeMaximum = 256;
/// The default size an icon in ProjectExplorer can be
const int kProjectIconSizeDefault = 64;
#endif // OLIVECOMMONDEFINE_H
+5
View File
@@ -255,3 +255,8 @@ Timecode::Display Timecode::CurrentDisplay()
{
return static_cast<Timecode::Display>(Config::Current()["TimecodeDisplay"].toInt());
}
void Timecode::SetCurrentDisplay(Timecode::Display d)
{
Config::Current()["TimecodeDisplay"] = d;
}
+1
View File
@@ -46,6 +46,7 @@ public:
};
static Display CurrentDisplay();
static void SetCurrentDisplay(Display d);
/**
* @brief Convert a timestamp (according to a rational timebase) to a user-friendly string representation
+8 -14
View File
@@ -1,20 +1,14 @@
#ifndef TIMELINECOMMON_H
#define TIMELINECOMMON_H
namespace olive {
namespace timeline {
enum MovementMode {
kNone,
kMove,
kTrimIn,
kTrimOut
class Timeline {
public:
enum MovementMode {
kNone,
kMove,
kTrimIn,
kTrimOut
};
};
}
}
#endif // TIMELINECOMMON_H