various: encapsulate all code in the olive namespace to avoid name collisions
Large-scale code cleanup. Also adds a license to the top of all files that were missing it.
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
|
||||
#include "config/config.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
AudioManager* AudioManager::instance_ = nullptr;
|
||||
|
||||
void AudioManager::CreateInstance()
|
||||
@@ -282,3 +284,5 @@ void AudioRefreshDevicesObject::Refresh()
|
||||
|
||||
emit ListsReady();
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -26,9 +26,12 @@
|
||||
#include <QAudioOutput>
|
||||
#include <QThread>
|
||||
|
||||
#include "common/define.h"
|
||||
#include "outputmanager.h"
|
||||
#include "render/audioparams.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief A thread for refreshing the total list of devices on the system
|
||||
*
|
||||
@@ -133,4 +136,6 @@ private slots:
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // AUDIOMANAGER_H
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "bufferaverage.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
QVector<double> AudioBufferAverage::ProcessAverages(const char *data, int length)
|
||||
{
|
||||
// FIXME: Assumes float and stereo
|
||||
@@ -18,3 +40,5 @@ QVector<double> AudioBufferAverage::ProcessAverages(const char *data, int length
|
||||
|
||||
return averages;
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -1,8 +1,32 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#ifndef AUDIOBUFFERAVERAGE_H
|
||||
#define AUDIOBUFFERAVERAGE_H
|
||||
|
||||
#include <QVector>
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class AudioBufferAverage
|
||||
{
|
||||
public:
|
||||
@@ -11,4 +35,6 @@ public:
|
||||
static QVector<double> ProcessAverages(const char* data, int length);
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // AUDIOBUFFERAVERAGE_H
|
||||
|
||||
@@ -1,8 +1,30 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "outputdeviceproxy.h"
|
||||
|
||||
#include "audiomanager.h"
|
||||
#include "bufferaverage.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
AudioOutputDeviceProxy::AudioOutputDeviceProxy() :
|
||||
device_(nullptr),
|
||||
send_averages_(false)
|
||||
@@ -117,3 +139,5 @@ qint64 AudioOutputDeviceProxy::ReverseAwareRead(char *data, qint64 maxlen)
|
||||
|
||||
return read_count;
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -1,10 +1,33 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#ifndef AUDIOOUTPUTDEVICEPROXY_H
|
||||
#define AUDIOOUTPUTDEVICEPROXY_H
|
||||
|
||||
#include <QIODevice>
|
||||
|
||||
#include "common/define.h"
|
||||
#include "tempoprocessor.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class AudioOutputDeviceProxy : public QIODevice
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -42,4 +65,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // AUDIOOUTPUTDEVICEPROXY_H
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#include "bufferaverage.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
AudioOutputManager::AudioOutputManager(QObject *parent) :
|
||||
QObject(parent),
|
||||
output_(nullptr),
|
||||
@@ -151,3 +153,5 @@ void AudioOutputManager::ProcessAverages(const char *data, int length)
|
||||
|
||||
emit SentSamples(AudioBufferAverage::ProcessAverages(data, length));
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "outputdeviceproxy.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class AudioOutputManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -88,4 +90,6 @@ private slots:
|
||||
void PushMoreSamples();
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // AUDIOHYBRIDDEVICE_H
|
||||
|
||||
@@ -1,7 +1,29 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "sampleformat.h"
|
||||
|
||||
#include "core.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
QString SampleFormat::GetSampleFormatName(const SampleFormat::Format &f)
|
||||
{
|
||||
switch (f) {
|
||||
@@ -35,3 +57,5 @@ void SampleFormat::SetConfiguredFormatForMode(RenderMode::Mode mode, SampleForma
|
||||
{
|
||||
Core::SetPreferenceForRenderMode(mode, QStringLiteral("SampleFormat"), format);
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -23,8 +23,11 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "common/define.h"
|
||||
#include "render/rendermodes.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class SampleFormat : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -51,4 +54,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // SAMPLEFORMAT_H
|
||||
|
||||
@@ -1,7 +1,29 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "sumsamples.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
const int SampleSummer::kSumSampleRate = 200;
|
||||
|
||||
QVector<SampleSummer::Sum> SampleSummer::SumSamples(const float *samples, int nb_samples, int nb_channels)
|
||||
@@ -84,3 +106,5 @@ SampleSummer::Info::Info()
|
||||
{
|
||||
channels = 0;
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#ifndef SUMSAMPLES_H
|
||||
#define SUMSAMPLES_H
|
||||
|
||||
@@ -6,6 +26,8 @@
|
||||
|
||||
#include "codec/samplebuffer.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class SampleSummer {
|
||||
public:
|
||||
struct Sum {
|
||||
@@ -39,4 +61,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // SUMSAMPLES_H
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "tempoprocessor.h"
|
||||
|
||||
extern "C" {
|
||||
@@ -10,6 +30,8 @@ extern "C" {
|
||||
|
||||
#include "codec/ffmpeg/ffmpegcommon.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
TempoProcessor::TempoProcessor() :
|
||||
filter_graph_(nullptr),
|
||||
buffersrc_ctx_(nullptr),
|
||||
@@ -251,3 +273,5 @@ AVFilterContext *TempoProcessor::CreateTempoFilter(AVFilterGraph* graph, AVFilte
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#ifndef TEMPOPROCESSOR_H
|
||||
#define TEMPOPROCESSOR_H
|
||||
|
||||
@@ -15,6 +35,8 @@ extern "C" {
|
||||
|
||||
#include "render/audioparams.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class TempoProcessor
|
||||
{
|
||||
public:
|
||||
@@ -56,4 +78,6 @@ private:
|
||||
bool flushed_;
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // TEMPOPROCESSOR_H
|
||||
|
||||
Reference in New Issue
Block a user