Refactoring: Made imports more specific

This commit is contained in:
Daniel Wolf 2017-09-10 22:17:17 +02:00
parent 4c0d706857
commit 55cf80e40b
54 changed files with 129 additions and 126 deletions

View File

@ -239,6 +239,8 @@ set_target_properties(utf8proc PROPERTIES FOLDER lib)
# Define Rhubarb libraries
include_directories("src")
# ... rhubarb-animation
add_library(rhubarb-animation
src/animation/animationRules.cpp
@ -261,7 +263,7 @@ add_library(rhubarb-animation
src/animation/tweening.cpp
src/animation/tweening.h
)
target_include_directories(rhubarb-animation PUBLIC "src/animation")
target_include_directories(rhubarb-animation PRIVATE "src/animation")
target_link_libraries(rhubarb-animation
rhubarb-core
rhubarb-logging
@ -288,7 +290,7 @@ add_library(rhubarb-audio
src/audio/waveFileWriting.cpp
src/audio/waveFileWriting.h
)
target_include_directories(rhubarb-audio PUBLIC "src/audio")
target_include_directories(rhubarb-audio PRIVATE "src/audio")
target_link_libraries(rhubarb-audio
webRtc
rhubarb-logging
@ -306,7 +308,7 @@ add_library(rhubarb-core
src/core/Shape.cpp
src/core/Shape.h
)
target_include_directories(rhubarb-core PUBLIC "src/core")
target_include_directories(rhubarb-core PRIVATE "src/core")
target_link_libraries(rhubarb-core
rhubarb-tools
)
@ -323,7 +325,7 @@ add_library(rhubarb-exporters
src/exporters/XmlExporter.cpp
src/exporters/XmlExporter.h
)
target_include_directories(rhubarb-exporters PUBLIC "src/exporters")
target_include_directories(rhubarb-exporters PRIVATE "src/exporters")
target_link_libraries(rhubarb-exporters
rhubarb-animation
rhubarb-core
@ -335,7 +337,7 @@ add_library(rhubarb-lib
src/lib/rhubarbLib.cpp
src/lib/rhubarbLib.h
)
target_include_directories(rhubarb-lib PUBLIC "src/lib")
target_include_directories(rhubarb-lib PRIVATE "src/lib")
target_link_libraries(rhubarb-lib
rhubarb-animation
rhubarb-audio
@ -360,7 +362,7 @@ add_library(rhubarb-logging
src/logging/sinks.cpp
src/logging/sinks.h
)
target_include_directories(rhubarb-logging PUBLIC "src/logging")
target_include_directories(rhubarb-logging PRIVATE "src/logging")
target_link_libraries(rhubarb-logging
rhubarb-tools
)
@ -376,7 +378,7 @@ add_library(rhubarb-recognition
src/recognition/tokenization.cpp
src/recognition/tokenization.h
)
target_include_directories(rhubarb-recognition PUBLIC "src/recognition")
target_include_directories(rhubarb-recognition PRIVATE "src/recognition")
target_link_libraries(rhubarb-recognition
flite
pocketSphinx
@ -397,7 +399,7 @@ add_library(rhubarb-time
src/time/TimeRange.cpp
src/time/TimeRange.h
)
target_include_directories(rhubarb-time PUBLIC "src/time")
target_include_directories(rhubarb-time PRIVATE "src/time")
target_link_libraries(rhubarb-time
cppFormat
rhubarb-logging
@ -430,7 +432,7 @@ add_library(rhubarb-tools
src/tools/tools.h
src/tools/tupleHash.h
)
target_include_directories(rhubarb-tools PUBLIC "src/tools")
target_include_directories(rhubarb-tools PRIVATE "src/tools")
target_link_libraries(rhubarb-tools
cppFormat
whereami
@ -440,11 +442,11 @@ target_link_libraries(rhubarb-tools
# Define Rhubarb executable
add_executable(rhubarb
src/main.cpp
src/ExportFormat.cpp
src/ExportFormat.h
src/rhubarb/main.cpp
src/rhubarb/ExportFormat.cpp
src/rhubarb/ExportFormat.h
)
target_include_directories(rhubarb PUBLIC "src")
target_include_directories(rhubarb PUBLIC "src/rhubarb")
target_link_libraries(rhubarb
rhubarb-exporters
rhubarb-lib

View File

@ -1,6 +1,6 @@
#include "ShapeRule.h"
#include <boost/range/adaptor/transformed.hpp>
#include "ContinuousTimeline.h"
#include "time/ContinuousTimeline.h"
using boost::optional;
using boost::adaptors::transformed;

View File

@ -1,9 +1,10 @@
#pragma once
#include "Phone.h"
#include "core/Phone.h"
#include "animationRules.h"
#include "BoundedTimeline.h"
#include "ContinuousTimeline.h"
#include "time/BoundedTimeline.h"
#include "time/ContinuousTimeline.h"
#include "time/TimeRange.h"
struct ShapeRule {
ShapeSet shapeSet;

View File

@ -1,8 +1,8 @@
#include "animationRules.h"
#include <boost/algorithm/clamp.hpp>
#include "shapeShorthands.h"
#include "array.h"
#include "ContinuousTimeline.h"
#include "tools/array.h"
#include "time/ContinuousTimeline.h"
using std::chrono::duration_cast;
using boost::algorithm::clamp;

View File

@ -1,9 +1,9 @@
#pragma once
#include <set>
#include "Shape.h"
#include "Timeline.h"
#include "Phone.h"
#include "core/Shape.h"
#include "time/Timeline.h"
#include "core/Phone.h"
// Returns the basic shape (A-F) that most closely resembles the specified shape.
Shape getBasicShape(Shape shape);

View File

@ -1,5 +1,5 @@
#include "mouthAnimation.h"
#include "timedLogging.h"
#include "time/timedLogging.h"
#include "ShapeRule.h"
#include "roughAnimation.h"
#include "pauseAnimation.h"

View File

@ -1,8 +1,8 @@
#pragma once
#include "Phone.h"
#include "Shape.h"
#include "ContinuousTimeline.h"
#include "core/Phone.h"
#include "core/Shape.h"
#include "time/ContinuousTimeline.h"
#include "targetShapeSet.h"
JoiningContinuousTimeline<Shape> animate(const BoundedTimeline<Phone>& phones, const ShapeSet& targetShapeSet);

View File

@ -1,7 +1,7 @@
#pragma once
#include "Shape.h"
#include "ContinuousTimeline.h"
#include "core/Shape.h"
#include "time/ContinuousTimeline.h"
// Takes an existing animation and modifies the pauses (X shapes) to look better.
JoiningContinuousTimeline<Shape> animatePauses(const JoiningContinuousTimeline<Shape>& animation);

View File

@ -1,6 +1,6 @@
#pragma once
#include "Shape.h"
#include "core/Shape.h"
constexpr Shape A = Shape::A;
constexpr Shape B = Shape::B;

View File

@ -1,7 +1,7 @@
#include "staticSegments.h"
#include <vector>
#include <numeric>
#include "nextCombination.h"
#include "tools/nextCombination.h"
using std::vector;
using boost::optional;

View File

@ -1,7 +1,7 @@
#pragma once
#include "Shape.h"
#include "ContinuousTimeline.h"
#include "core/Shape.h"
#include "time/ContinuousTimeline.h"
#include "ShapeRule.h"
#include <functional>

View File

@ -1,6 +1,6 @@
#pragma once
#include "Shape.h"
#include "core/Shape.h"
#include "ShapeRule.h"
// Returns the closest shape to the specified one that occurs in the target shape set.

View File

@ -1,5 +1,5 @@
#include "timingOptimization.h"
#include "timedLogging.h"
#include "time/timedLogging.h"
#include <boost/lexical_cast.hpp>
#include <map>
#include <algorithm>

View File

@ -1,7 +1,7 @@
#pragma once
#include "Shape.h"
#include "ContinuousTimeline.h"
#include "core/Shape.h"
#include "time/ContinuousTimeline.h"
// Changes the timing of an existing animation to reduce jitter and to make sure all shapes register visually.
// In some cases, shapes may be omitted.

View File

@ -1,7 +1,7 @@
#pragma once
#include "Shape.h"
#include "ContinuousTimeline.h"
#include "core/Shape.h"
#include "time/ContinuousTimeline.h"
// Takes an existing animation and inserts inbetween shapes for smoother results.
JoiningContinuousTimeline<Shape> insertTweens(const JoiningContinuousTimeline<Shape>& animation);

View File

@ -1,9 +1,9 @@
#pragma once
#include <memory>
#include "TimeRange.h"
#include "time/TimeRange.h"
#include <functional>
#include "Lazy.h"
#include "tools/Lazy.h"
class AudioClip;
class SampleIterator;

View File

@ -2,7 +2,7 @@
#include <string.h>
#include "WaveFileReader.h"
#include "ioTools.h"
#include "platformTools.h"
#include "tools/platformTools.h"
using std::runtime_error;
using fmt::format;

View File

@ -3,7 +3,7 @@
#include <vector>
#include <functional>
#include "AudioClip.h"
#include "ProgressBar.h"
#include "tools/ProgressBar.h"
void process16bitAudioClip(const AudioClip& audioClip, std::function<void(const std::vector<int16_t>&)> processBuffer, size_t bufferCapacity, ProgressSink& progressSink);
void process16bitAudioClip(const AudioClip& audioClip, std::function<void(const std::vector<int16_t>&)> processBuffer, ProgressSink& progressSink);

View File

@ -1,15 +1,15 @@
#include "voiceActivityDetection.h"
#include "DcOffset.h"
#include "SampleRateConverter.h"
#include "logging.h"
#include "pairs.h"
#include "logging/logging.h"
#include "tools/pairs.h"
#include <boost/range/adaptor/transformed.hpp>
#include <webrtc/common_audio/vad/include/webrtc_vad.h>
#include "processing.h"
#include <gsl_util.h>
#include "parallel.h"
#include "tools/parallel.h"
#include "AudioSegment.h"
#include "stringTools.h"
#include "tools/stringTools.h"
using std::vector;
using boost::adaptors::transformed;

View File

@ -1,6 +1,6 @@
#pragma once
#include "AudioClip.h"
#include <BoundedTimeline.h>
#include <ProgressBar.h>
#include "time/BoundedTimeline.h"
#include "tools/ProgressBar.h"
JoiningBoundedTimeline<void> detectVoiceActivity(const AudioClip& audioClip, int maxThreadCount, ProgressSink& progressSink);

View File

@ -1,6 +1,6 @@
#pragma once
#include "EnumConverter.h"
#include "tools/EnumConverter.h"
// Defines a subset of the Arpabet
enum class Phone {

View File

@ -1,6 +1,6 @@
#pragma once
#include "EnumConverter.h"
#include "tools/EnumConverter.h"
#include <set>
// The classic Hanna-Barbera mouth shapes A-F plus the common supplements G-H

View File

@ -1,7 +1,7 @@
#pragma once
#include <Shape.h>
#include "ContinuousTimeline.h"
#include "core/Shape.h"
#include "time/ContinuousTimeline.h"
#include <boost/filesystem/path.hpp>
class ExporterInput {

View File

@ -1,6 +1,6 @@
#include "JsonExporter.h"
#include "exporterTools.h"
#include "stringTools.h"
#include "tools/stringTools.h"
using std::string;

View File

@ -1,5 +1,5 @@
#include "TsvExporter.h"
#include "targetShapeSet.h"
#include "animation/targetShapeSet.h"
void TsvExporter::exportAnimation(const ExporterInput& input, std::ostream& outputStream) {
// Output shapes with start times

View File

@ -1,5 +1,5 @@
#include "exporterTools.h"
#include "targetShapeSet.h"
#include "animation/targetShapeSet.h"
// Makes sure there is at least one mouth shape
std::vector<Timed<Shape>> dummyShapeIfEmpty(const JoiningTimeline<Shape>& animation, const ShapeSet& targetShapeSet) {

View File

@ -1,7 +1,7 @@
#pragma once
#include "Shape.h"
#include "Timeline.h"
#include "core/Shape.h"
#include "time/Timeline.h"
// Makes sure there is at least one mouth shape
std::vector<Timed<Shape>> dummyShapeIfEmpty(const JoiningTimeline<Shape>& animation, const ShapeSet& targetShapeSet);

View File

@ -1,9 +1,9 @@
#include "rhubarbLib.h"
#include "Phone.h"
#include "phoneRecognition.h"
#include "textFiles.h"
#include "mouthAnimation.h"
#include "WaveFileReader.h"
#include "core/Phone.h"
#include "recognition/phoneRecognition.h"
#include "tools/textFiles.h"
#include "animation/mouthAnimation.h"
#include "audio/WaveFileReader.h"
using boost::optional;
using std::string;

View File

@ -1,11 +1,11 @@
#pragma once
#include "Shape.h"
#include "ContinuousTimeline.h"
#include "AudioClip.h"
#include "ProgressBar.h"
#include "core/Shape.h"
#include "time/ContinuousTimeline.h"
#include "audio/AudioClip.h"
#include "tools/ProgressBar.h"
#include <boost/filesystem.hpp>
#include "targetShapeSet.h"
#include "animation/targetShapeSet.h"
JoiningContinuousTimeline<Shape> animateAudioClip(
const AudioClip& audioClip,

View File

@ -1,6 +1,6 @@
#pragma once
#include "EnumConverter.h"
#include "tools/EnumConverter.h"
namespace logging {

View File

@ -1,7 +1,7 @@
#include "formatters.h"
#include <format.h>
#include "Entry.h"
#include "tools.h"
#include "tools/tools.h"
using std::string;

View File

@ -1,5 +1,5 @@
#include "logging.h"
#include <tools.h>
#include "tools/tools.h"
#include <mutex>
#include "Entry.h"

View File

@ -1,6 +1,6 @@
#pragma once
#include "EnumConverter.h"
#include "tools/EnumConverter.h"
#include "Sink.h"
#include "Level.h"

View File

@ -1,7 +1,7 @@
#include <g2p.h>
#include <regex>
#include "stringTools.h"
#include "logging.h"
#include "tools/stringTools.h"
#include "logging/logging.h"
using std::vector;
using std::wstring;

View File

@ -1,6 +1,6 @@
#pragma once
#include <vector>
#include "Phone.h"
#include "core/Phone.h"
std::vector<Phone> wordToPhones(const std::string& word);

View File

@ -4,9 +4,9 @@
#include <regex>
#include <map>
#include <tuple>
#include "platformTools.h"
#include "tools/platformTools.h"
#include <boost/filesystem/fstream.hpp>
#include "appInfo.h"
#include "core/appInfo.h"
#include <cmath>
#include <gsl_util.h>

View File

@ -1,7 +1,7 @@
#pragma once
#include <vector>
#include "tools.h"
#include "tools/tools.h"
extern "C" {
#include <pocketsphinx.h>

View File

@ -1,26 +1,26 @@
#include <boost/filesystem.hpp>
#include "phoneRecognition.h"
#include "SampleRateConverter.h"
#include "platformTools.h"
#include "tools.h"
#include "audio/SampleRateConverter.h"
#include "tools/platformTools.h"
#include "tools/tools.h"
#include <format.h>
#include <s3types.h>
#include <regex>
#include <gsl_util.h>
#include <logging.h>
#include "DcOffset.h"
#include "Timeline.h"
#include "voiceActivityDetection.h"
#include "AudioSegment.h"
#include "logging/logging.h"
#include "audio/DcOffset.h"
#include "time/Timeline.h"
#include "audio/voiceActivityDetection.h"
#include "audio/AudioSegment.h"
#include "languageModels.h"
#include "tokenization.h"
#include "g2p.h"
#include "ContinuousTimeline.h"
#include "processing.h"
#include "parallel.h"
#include "time/ContinuousTimeline.h"
#include "audio/processing.h"
#include "tools/parallel.h"
#include <boost/version.hpp>
#include "ObjectPool.h"
#include "timedLogging.h"
#include "tools/ObjectPool.h"
#include "time/timedLogging.h"
extern "C" {
#include <pocketsphinx.h>

View File

@ -1,9 +1,9 @@
#pragma once
#include "AudioClip.h"
#include "Phone.h"
#include "ProgressBar.h"
#include "BoundedTimeline.h"
#include "audio/AudioClip.h"
#include "core/Phone.h"
#include "tools/ProgressBar.h"
#include "time/BoundedTimeline.h"
BoundedTimeline<Phone> recognizePhones(
const AudioClip& audioClip,

View File

@ -1,6 +1,6 @@
#include "tokenization.h"
#include "tools.h"
#include "stringTools.h"
#include "tools/tools.h"
#include "tools/stringTools.h"
#include <regex>
extern "C" {

View File

@ -1,6 +1,6 @@
#pragma once
#include "EnumConverter.h"
#include "tools/EnumConverter.h"
enum class ExportFormat {
Tsv,

View File

@ -1,32 +1,32 @@
#include <iostream>
#include <format.h>
#include <tclap/CmdLine.h>
#include "appInfo.h"
#include "NiceCmdLineOutput.h"
#include "ProgressBar.h"
#include "logging.h"
#include "sinks.h"
#include "formatters.h"
#include "core/appInfo.h"
#include "tools/NiceCmdLineOutput.h"
#include "tools/ProgressBar.h"
#include "logging/logging.h"
#include "logging/sinks.h"
#include "logging/formatters.h"
#include <gsl_util.h>
#include "Exporter.h"
#include "ContinuousTimeline.h"
#include "exporters/Exporter.h"
#include "time/ContinuousTimeline.h"
#include <boost/filesystem/operations.hpp>
#include "stringTools.h"
#include "tools/stringTools.h"
#include <boost/range/adaptor/transformed.hpp>
#include <boost/filesystem/fstream.hpp>
#include "parallel.h"
#include "exceptions.h"
#include "textFiles.h"
#include "rhubarbLib.h"
#include "tools/parallel.h"
#include "tools/exceptions.h"
#include "tools/textFiles.h"
#include "lib/rhubarbLib.h"
#include "ExportFormat.h"
#include "TsvExporter.h"
#include "XmlExporter.h"
#include "JsonExporter.h"
#include "exporters/TsvExporter.h"
#include "exporters/XmlExporter.h"
#include "exporters/JsonExporter.h"
#include <boost/iostreams/stream.hpp>
#include <boost/iostreams/device/null.hpp>
#include "targetShapeSet.h"
#include "animation/targetShapeSet.h"
#include <boost/utility/in_place_factory.hpp>
#include "platformTools.h"
#include "tools/platformTools.h"
using std::exception;
using std::string;

View File

@ -1,6 +1,6 @@
#pragma once
#include <TimeRange.h>
#include "time/TimeRange.h"
#include <iostream>
template<typename TValue>

View File

@ -3,7 +3,7 @@
#include <set>
#include <boost/optional.hpp>
#include <type_traits>
#include "tools.h"
#include "tools/tools.h"
enum class FindMode {
SampleLeft,

View File

@ -3,7 +3,7 @@
#include "centiseconds.h"
#include "TimeRange.h"
#include "Timed.h"
#include "logging.h"
#include "logging/logging.h"
template<typename TValue>
void logTimedEvent(const std::string& eventName, const Timed<TValue> timedValue) {

View File

@ -1,5 +1,5 @@
#include <gmock/gmock.h>
#include "BoundedTimeline.h"
#include "time/BoundedTimeline.h"
using namespace testing;
using std::vector;

View File

@ -1,5 +1,5 @@
#include <gmock/gmock.h>
#include "ContinuousTimeline.h"
#include "time/ContinuousTimeline.h"
using namespace testing;
using std::vector;

View File

@ -1,5 +1,5 @@
#include <gmock/gmock.h>
#include "Lazy.h"
#include "tools/Lazy.h"
using namespace testing;
using std::make_unique;

View File

@ -1,5 +1,5 @@
#include <gmock/gmock.h>
#include "Timeline.h"
#include "time/Timeline.h"
#include <limits>
#include <functional>

View File

@ -1,5 +1,5 @@
#include <gmock/gmock.h>
#include "g2p.h"
#include "recognition/g2p.h"
using namespace testing;
using std::vector;

View File

@ -1,5 +1,5 @@
#include <gmock/gmock.h>
#include "pairs.h"
#include "tools/pairs.h"
using namespace testing;
using std::vector;

View File

@ -1,5 +1,5 @@
#include <gmock/gmock.h>
#include "stringTools.h"
#include "tools/stringTools.h"
using namespace testing;
using std::string;

View File

@ -1,5 +1,5 @@
#include <gmock/gmock.h>
#include "tokenization.h"
#include "recognition/tokenization.h"
#include <regex>
#include <unordered_set>
#include <utf8.h>