Merge pull request #20 from DanielSWolf/feature/refactoring
Various refactorings
This commit is contained in:
commit
97a6c74c3c
|
@ -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
|
||||
|
@ -347,10 +349,20 @@ target_link_libraries(rhubarb-lib
|
|||
|
||||
# ... rhubarb-logging
|
||||
add_library(rhubarb-logging
|
||||
src/logging/Entry.cpp
|
||||
src/logging/Entry.h
|
||||
src/logging/Formatter.h
|
||||
src/logging/formatters.cpp
|
||||
src/logging/formatters.h
|
||||
src/logging/Level.cpp
|
||||
src/logging/Level.h
|
||||
src/logging/logging.cpp
|
||||
src/logging/logging.h
|
||||
src/logging/Sink.h
|
||||
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
|
||||
)
|
||||
|
@ -366,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
|
||||
|
@ -387,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
|
||||
|
@ -420,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
|
||||
|
@ -430,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
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CTOR_INIT/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue">NONE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue">NEXT_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/EMPTY_BLOCK_STYLE/@EntryValue">TOGETHER</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_EMBEDDED_STATEMENT_STYLE/@EntryValue">ON_SINGLE_LINE</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ENUMERATION_STYLE/@EntryValue">CHOP_ALWAYS</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020fields/@EntryIndexedValue"><NamingElement Priority="10"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="struct field" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="_" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020methods/@EntryIndexedValue"><NamingElement Priority="9"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="member function" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020public_0020fields/@EntryIndexedValue"><NamingElement Priority="11"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="PUBLIC"><type Name="class field" /><type Name="struct field" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Classes_0020and_0020structs/@EntryIndexedValue"><NamingElement Priority="1"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="__interface" /><type Name="class" /><type Name="struct" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Enum_0020members/@EntryIndexedValue"><NamingElement Priority="13"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="enumerator" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Enums/@EntryIndexedValue"><NamingElement Priority="2"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="enum" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020constants/@EntryIndexedValue"><NamingElement Priority="15"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="True" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020functions/@EntryIndexedValue"><NamingElement Priority="8"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global function" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020variables/@EntryIndexedValue"><NamingElement Priority="7"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Local_0020variables/@EntryIndexedValue"><NamingElement Priority="6"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="local variable" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Namespaces/@EntryIndexedValue"><NamingElement Priority="16"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="namespace" /><type Name="namespace alias" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Other_0020constants/@EntryIndexedValue"><NamingElement Priority="14"><Descriptor Static="True" Constexpr="Indeterminate" Const="True" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="local variable" /><type Name="struct field" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Parameters/@EntryIndexedValue"><NamingElement Priority="5"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="parameter" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Template_0020parameters/@EntryIndexedValue"><NamingElement Priority="4"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="template parameter" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Typedefs/@EntryIndexedValue"><NamingElement Priority="17"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="type alias" /><type Name="typedef" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Union_0020members/@EntryIndexedValue"><NamingElement Priority="12"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="union member" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Unions/@EntryIndexedValue"><NamingElement Priority="3"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="union" /></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FCONSTANT/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FFUNCTION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FCLASS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FCONSTRUCTOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FFUNCTION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FGLOBAL_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FLABEL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FLOCAL_005FCONSTRUCTOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FLOCAL_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FOBJECT_005FPROPERTY_005FOF_005FFUNCTION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FPARAMETER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FCLASS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FENUM/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FENUM_005FMEMBER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FINTERFACE/@EntryIndexedValue"><Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMIXED_005FENUM/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE_005FEXPORTED/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE_005FLOCAL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FALIAS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FPARAMETER/@EntryIndexedValue"><Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FHTML_005FCONTROL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FTAG_005FNAME/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FTAG_005FPREFIX/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ESettingsUpgrade_002EFunctionReturnStyleSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ESettingsUpgrade_002ENamespaceIndentationSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
|
||||
</wpf:ResourceDictionary>
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "mouthAnimation.h"
|
||||
#include "timedLogging.h"
|
||||
#include "time/timedLogging.h"
|
||||
#include "ShapeRule.h"
|
||||
#include "roughAnimation.h"
|
||||
#include "pauseAnimation.h"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "Shape.h"
|
||||
#include "core/Shape.h"
|
||||
|
||||
constexpr Shape A = Shape::A;
|
||||
constexpr Shape B = Shape::B;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "staticSegments.h"
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
#include "nextCombination.h"
|
||||
#include "tools/nextCombination.h"
|
||||
|
||||
using std::vector;
|
||||
using boost::optional;
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "timingOptimization.h"
|
||||
#include "timedLogging.h"
|
||||
#include "time/timedLogging.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "EnumConverter.h"
|
||||
#include "tools/EnumConverter.h"
|
||||
|
||||
// Defines a subset of the Arpabet
|
||||
enum class Phone {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,11 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <Shape.h>
|
||||
#include "ContinuousTimeline.h"
|
||||
#include "core/Shape.h"
|
||||
#include "time/ContinuousTimeline.h"
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
class ExporterInput {
|
||||
public:
|
||||
ExporterInput(
|
||||
const boost::filesystem::path& inputFilePath,
|
||||
const JoiningContinuousTimeline<Shape>& animation,
|
||||
const ShapeSet& targetShapeSet) :
|
||||
inputFilePath(inputFilePath),
|
||||
animation(animation),
|
||||
targetShapeSet(targetShapeSet) {}
|
||||
|
||||
boost::filesystem::path inputFilePath;
|
||||
JoiningContinuousTimeline<Shape> animation;
|
||||
ShapeSet targetShapeSet;
|
||||
};
|
||||
|
||||
class Exporter {
|
||||
public:
|
||||
virtual ~Exporter() {}
|
||||
virtual void exportAnimation(const boost::filesystem::path& inputFilePath, const JoiningContinuousTimeline<Shape>& animation, const ShapeSet& targetShapeSet, std::ostream& outputStream) = 0;
|
||||
virtual void exportAnimation(const ExporterInput& input, std::ostream& outputStream) = 0;
|
||||
};
|
||||
|
|
|
@ -1,50 +1,20 @@
|
|||
#include "JsonExporter.h"
|
||||
#include "exporterTools.h"
|
||||
#include <utf8.h>
|
||||
#include "tools/stringTools.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
string escapeJsonString(const string& s) {
|
||||
// JavaScript uses UTF-16 internally. As a result, character escaping in JSON strings is UTF-16-based.
|
||||
// Convert string to UTF-16
|
||||
std::u16string utf16String;
|
||||
utf8::utf8to16(s.begin(), s.end(), std::back_inserter(utf16String));
|
||||
|
||||
string result;
|
||||
for (char16_t c : utf16String) {
|
||||
switch (c) {
|
||||
case '"': result += "\\\""; break;
|
||||
case '\\': result += "\\\\"; break;
|
||||
case '\b': result += "\\b"; break;
|
||||
case '\f': result += "\\f"; break;
|
||||
case '\n': result += "\\n"; break;
|
||||
case '\r': result += "\\r"; break;
|
||||
case '\t': result += "\\t"; break;
|
||||
default:
|
||||
{
|
||||
bool needsEscaping = c < '\x20' || c >= 0x80;
|
||||
if (needsEscaping) {
|
||||
result += fmt::format("\\u{0:04x}", c);
|
||||
} else {
|
||||
result += static_cast<char>(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void JsonExporter::exportAnimation(const boost::filesystem::path& inputFilePath, const JoiningContinuousTimeline<Shape>& animation, const ShapeSet& targetShapeSet, std::ostream& outputStream) {
|
||||
void JsonExporter::exportAnimation(const ExporterInput& input, std::ostream& outputStream) {
|
||||
// Export as JSON.
|
||||
// I'm not using a library because the code is short enough without one and it lets me control the formatting.
|
||||
outputStream << "{\n";
|
||||
outputStream << " \"metadata\": {\n";
|
||||
outputStream << " \"soundFile\": \"" << escapeJsonString(inputFilePath.string()) << "\",\n";
|
||||
outputStream << " \"duration\": " << formatDuration(animation.getRange().getDuration()) << "\n";
|
||||
outputStream << " \"soundFile\": \"" << escapeJsonString(input.inputFilePath.string()) << "\",\n";
|
||||
outputStream << " \"duration\": " << formatDuration(input.animation.getRange().getDuration()) << "\n";
|
||||
outputStream << " },\n";
|
||||
outputStream << " \"mouthCues\": [\n";
|
||||
bool isFirst = true;
|
||||
for (auto& timedShape : dummyShapeIfEmpty(animation, targetShapeSet)) {
|
||||
for (auto& timedShape : dummyShapeIfEmpty(input.animation, input.targetShapeSet)) {
|
||||
if (!isFirst) outputStream << ",\n";
|
||||
isFirst = false;
|
||||
outputStream << " { \"start\": " << formatDuration(timedShape.getStart())
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
|
||||
class JsonExporter : public Exporter {
|
||||
public:
|
||||
void exportAnimation(const boost::filesystem::path& inputFilePath, const JoiningContinuousTimeline<Shape>& animation, const ShapeSet& targetShapeSet, std::ostream& outputStream) override;
|
||||
void exportAnimation(const ExporterInput& input, std::ostream& outputStream) override;
|
||||
};
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
#include "TsvExporter.h"
|
||||
#include "targetShapeSet.h"
|
||||
|
||||
void TsvExporter::exportAnimation(const boost::filesystem::path& inputFilePath, const JoiningContinuousTimeline<Shape>& animation, const ShapeSet& targetShapeSet, std::ostream& outputStream) {
|
||||
UNUSED(inputFilePath);
|
||||
#include "animation/targetShapeSet.h"
|
||||
|
||||
void TsvExporter::exportAnimation(const ExporterInput& input, std::ostream& outputStream) {
|
||||
// Output shapes with start times
|
||||
for (auto& timedShape : animation) {
|
||||
for (auto& timedShape : input.animation) {
|
||||
outputStream << formatDuration(timedShape.getStart()) << "\t" << timedShape.getValue() << "\n";
|
||||
}
|
||||
|
||||
// Output closed mouth with end time
|
||||
outputStream << formatDuration(animation.getRange().getEnd()) << "\t" << convertToTargetShapeSet(Shape::X, targetShapeSet) << "\n";
|
||||
outputStream
|
||||
<< formatDuration(input.animation.getRange().getEnd())
|
||||
<< "\t"
|
||||
<< convertToTargetShapeSet(Shape::X, input.targetShapeSet)
|
||||
<< "\n";
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
|
||||
class TsvExporter : public Exporter {
|
||||
public:
|
||||
void exportAnimation(const boost::filesystem::path& inputFilePath, const JoiningContinuousTimeline<Shape>& animation, const ShapeSet& targetShapeSet, std::ostream& outputStream) override;
|
||||
void exportAnimation(const ExporterInput& input, std::ostream& outputStream) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
using std::string;
|
||||
using boost::property_tree::ptree;
|
||||
|
||||
void XmlExporter::exportAnimation(const boost::filesystem::path& inputFilePath, const JoiningContinuousTimeline<Shape>& animation, const ShapeSet& targetShapeSet, std::ostream& outputStream) {
|
||||
void XmlExporter::exportAnimation(const ExporterInput& input, std::ostream& outputStream) {
|
||||
ptree tree;
|
||||
|
||||
// Add metadata
|
||||
tree.put("rhubarbResult.metadata.soundFile", inputFilePath.string());
|
||||
tree.put("rhubarbResult.metadata.duration", formatDuration(animation.getRange().getDuration()));
|
||||
tree.put("rhubarbResult.metadata.soundFile", input.inputFilePath.string());
|
||||
tree.put("rhubarbResult.metadata.duration", formatDuration(input.animation.getRange().getDuration()));
|
||||
|
||||
// Add mouth cues
|
||||
for (auto& timedShape : dummyShapeIfEmpty(animation, targetShapeSet)) {
|
||||
for (auto& timedShape : dummyShapeIfEmpty(input.animation, input.targetShapeSet)) {
|
||||
ptree& mouthCueElement = tree.add("rhubarbResult.mouthCues.mouthCue", timedShape.getValue());
|
||||
mouthCueElement.put("<xmlattr>.start", formatDuration(timedShape.getStart()));
|
||||
mouthCueElement.put("<xmlattr>.end", formatDuration(timedShape.getEnd()));
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
|
||||
class XmlExporter : public Exporter {
|
||||
public:
|
||||
void exportAnimation(const boost::filesystem::path& inputFilePath, const JoiningContinuousTimeline<Shape>& animation, const ShapeSet& targetShapeSet, std::ostream& outputStream) override;
|
||||
void exportAnimation(const ExporterInput& input, std::ostream& outputStream) override;
|
||||
};
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
#include "Entry.h"
|
||||
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
using std::lock_guard;
|
||||
using std::unordered_map;
|
||||
using std::string;
|
||||
|
||||
namespace logging {
|
||||
|
||||
// Returns an int representing the current thread.
|
||||
// This used to be a simple thread_local variable, but Xcode doesn't support that yet
|
||||
int getThreadCounter() {
|
||||
using thread_id = std::thread::id;
|
||||
|
||||
static std::mutex counterMutex;
|
||||
lock_guard<std::mutex> lock(counterMutex);
|
||||
|
||||
static unordered_map<thread_id, int> threadCounters;
|
||||
static int lastThreadId = 0;
|
||||
thread_id threadId = std::this_thread::get_id();
|
||||
if (threadCounters.find(threadId) == threadCounters.end()) {
|
||||
threadCounters.insert({threadId, ++lastThreadId});
|
||||
}
|
||||
return threadCounters.find(threadId)->second;
|
||||
}
|
||||
|
||||
Entry::Entry(Level level, const string& message) :
|
||||
level(level),
|
||||
message(message)
|
||||
{
|
||||
time(×tamp);
|
||||
this->threadCounter = getThreadCounter();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#include "Level.h"
|
||||
|
||||
namespace logging {
|
||||
|
||||
struct Entry {
|
||||
Entry(Level level, const std::string& message);
|
||||
|
||||
time_t timestamp;
|
||||
int threadCounter;
|
||||
Level level;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "Entry.h"
|
||||
|
||||
namespace logging {
|
||||
|
||||
class Formatter {
|
||||
public:
|
||||
virtual ~Formatter() = default;
|
||||
virtual std::string format(const Entry& entry) = 0;
|
||||
};
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
#include "Level.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace logging {
|
||||
|
||||
LevelConverter& LevelConverter::get() {
|
||||
static LevelConverter converter;
|
||||
return converter;
|
||||
}
|
||||
|
||||
string LevelConverter::getTypeName() {
|
||||
return "Level";
|
||||
}
|
||||
|
||||
EnumConverter<Level>::member_data LevelConverter::getMemberData() {
|
||||
return member_data{
|
||||
{Level::Trace, "Trace"},
|
||||
{Level::Debug, "Debug"},
|
||||
{Level::Info, "Info"},
|
||||
{Level::Warn, "Warn"},
|
||||
{Level::Error, "Error"},
|
||||
{Level::Fatal, "Fatal"}
|
||||
};
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, Level value) {
|
||||
return LevelConverter::get().write(stream, value);
|
||||
}
|
||||
|
||||
std::istream& operator >> (std::istream& stream, Level& value) {
|
||||
return LevelConverter::get().read(stream, value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "tools/EnumConverter.h"
|
||||
|
||||
namespace logging {
|
||||
|
||||
enum class Level {
|
||||
Trace,
|
||||
Debug,
|
||||
Info,
|
||||
Warn,
|
||||
Error,
|
||||
Fatal,
|
||||
EndSentinel
|
||||
};
|
||||
|
||||
class LevelConverter : public EnumConverter<Level> {
|
||||
public:
|
||||
static LevelConverter& get();
|
||||
protected:
|
||||
std::string getTypeName() override;
|
||||
member_data getMemberData() override;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, Level value);
|
||||
|
||||
std::istream& operator >> (std::istream& stream, Level& value);
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include "Entry.h"
|
||||
|
||||
namespace logging {
|
||||
|
||||
class Sink {
|
||||
public:
|
||||
virtual ~Sink() = default;
|
||||
virtual void receive(const Entry& entry) = 0;
|
||||
};
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
#include "formatters.h"
|
||||
#include <format.h>
|
||||
#include "Entry.h"
|
||||
#include "tools/tools.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace logging {
|
||||
|
||||
string SimpleConsoleFormatter::format(const Entry& entry) {
|
||||
return fmt::format("[{0}] {1}", entry.level, entry.message);
|
||||
}
|
||||
|
||||
string SimpleFileFormatter::format(const Entry& entry) {
|
||||
return fmt::format("[{0}] {1} {2}", formatTime(entry.timestamp, "%F %H:%M:%S"), entry.threadCounter, consoleFormatter.format(entry));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include "Formatter.h"
|
||||
|
||||
namespace logging {
|
||||
|
||||
class SimpleConsoleFormatter : public Formatter {
|
||||
public:
|
||||
std::string format(const Entry& entry) override;
|
||||
};
|
||||
|
||||
class SimpleFileFormatter : public Formatter {
|
||||
public:
|
||||
std::string format(const Entry& entry) override;
|
||||
private:
|
||||
SimpleConsoleFormatter consoleFormatter;
|
||||
};
|
||||
|
||||
}
|
|
@ -1,130 +1,13 @@
|
|||
#include "logging.h"
|
||||
#include <tools.h>
|
||||
#include <iostream>
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <unordered_map>
|
||||
#include "tools/tools.h"
|
||||
#include <mutex>
|
||||
#include "Entry.h"
|
||||
|
||||
using namespace logging;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
using std::shared_ptr;
|
||||
using std::lock_guard;
|
||||
using std::unordered_map;
|
||||
|
||||
LevelConverter& LevelConverter::get() {
|
||||
static LevelConverter converter;
|
||||
return converter;
|
||||
}
|
||||
|
||||
string LevelConverter::getTypeName() {
|
||||
return "Level";
|
||||
}
|
||||
|
||||
EnumConverter<Level>::member_data LevelConverter::getMemberData() {
|
||||
return member_data {
|
||||
{ Level::Trace, "Trace" },
|
||||
{ Level::Debug, "Debug" },
|
||||
{ Level::Info, "Info" },
|
||||
{ Level::Warn, "Warn" },
|
||||
{ Level::Error, "Error" },
|
||||
{ Level::Fatal, "Fatal" }
|
||||
};
|
||||
}
|
||||
|
||||
std::ostream& logging::operator<<(std::ostream& stream, Level value) {
|
||||
return LevelConverter::get().write(stream, value);
|
||||
}
|
||||
|
||||
std::istream& logging::operator>>(std::istream& stream, Level& value) {
|
||||
return LevelConverter::get().read(stream, value);
|
||||
}
|
||||
|
||||
// Returns an int representing the current thread.
|
||||
// This used to be a simple thread_local variable, but Xcode doesn't support that yet
|
||||
int getThreadCounter() {
|
||||
using thread_id = std::thread::id;
|
||||
|
||||
static std::mutex counterMutex;
|
||||
lock_guard<std::mutex> lock(counterMutex);
|
||||
|
||||
static unordered_map<thread_id, int> threadCounters;
|
||||
static int lastThreadId = 0;
|
||||
thread_id threadId = std::this_thread::get_id();
|
||||
if (threadCounters.find(threadId) == threadCounters.end()) {
|
||||
threadCounters.insert({threadId, ++lastThreadId});
|
||||
}
|
||||
return threadCounters.find(threadId)->second;
|
||||
}
|
||||
|
||||
Entry::Entry(Level level, const string& message) :
|
||||
level(level),
|
||||
message(message)
|
||||
{
|
||||
time(×tamp);
|
||||
this->threadCounter = getThreadCounter();
|
||||
}
|
||||
|
||||
string SimpleConsoleFormatter::format(const Entry& entry) {
|
||||
return fmt::format("[{0}] {1}", entry.level, entry.message);
|
||||
}
|
||||
|
||||
string SimpleFileFormatter::format(const Entry& entry) {
|
||||
return fmt::format("[{0}] {1} {2}", formatTime(entry.timestamp, "%F %H:%M:%S"), entry.threadCounter, consoleFormatter.format(entry));
|
||||
}
|
||||
|
||||
LevelFilter::LevelFilter(shared_ptr<Sink> innerSink, Level minLevel) :
|
||||
innerSink(innerSink),
|
||||
minLevel(minLevel)
|
||||
{}
|
||||
|
||||
void LevelFilter::receive(const Entry& entry) {
|
||||
if (entry.level >= minLevel) {
|
||||
innerSink->receive(entry);
|
||||
}
|
||||
}
|
||||
|
||||
StreamSink::StreamSink(shared_ptr<std::ostream> stream, shared_ptr<Formatter> formatter) :
|
||||
stream(stream),
|
||||
formatter(formatter)
|
||||
{}
|
||||
|
||||
void StreamSink::receive(const Entry& entry) {
|
||||
string line = formatter->format(entry);
|
||||
*stream << line << std::endl;
|
||||
}
|
||||
|
||||
StdErrSink::StdErrSink(shared_ptr<Formatter> formatter) :
|
||||
StreamSink(std::shared_ptr<std::ostream>(&std::cerr, [](void*) {}), formatter)
|
||||
{}
|
||||
|
||||
PausableSink::PausableSink(shared_ptr<Sink> innerSink) :
|
||||
innerSink(innerSink)
|
||||
{}
|
||||
|
||||
void PausableSink::receive(const Entry& entry) {
|
||||
lock_guard<std::mutex> lock(mutex);
|
||||
if (isPaused) {
|
||||
buffer.push_back(entry);
|
||||
} else {
|
||||
innerSink->receive(entry);
|
||||
}
|
||||
}
|
||||
|
||||
void PausableSink::pause() {
|
||||
lock_guard<std::mutex> lock(mutex);
|
||||
isPaused = true;
|
||||
|
||||
}
|
||||
|
||||
void PausableSink::resume() {
|
||||
lock_guard<std::mutex> lock(mutex);
|
||||
isPaused = false;
|
||||
for (const Entry& entry : buffer) {
|
||||
innerSink->receive(entry);
|
||||
}
|
||||
buffer.clear();
|
||||
}
|
||||
|
||||
std::mutex& getLogMutex() {
|
||||
static std::mutex mutex;
|
||||
|
|
|
@ -1,103 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include "tools.h"
|
||||
#include "EnumConverter.h"
|
||||
#include "tools/EnumConverter.h"
|
||||
#include "Sink.h"
|
||||
#include "Level.h"
|
||||
|
||||
namespace logging {
|
||||
|
||||
enum class Level {
|
||||
Trace,
|
||||
Debug,
|
||||
Info,
|
||||
Warn,
|
||||
Error,
|
||||
Fatal,
|
||||
EndSentinel
|
||||
};
|
||||
|
||||
class LevelConverter : public EnumConverter<Level> {
|
||||
public:
|
||||
static LevelConverter& get();
|
||||
protected:
|
||||
std::string getTypeName() override;
|
||||
member_data getMemberData() override;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, Level value);
|
||||
|
||||
std::istream& operator>>(std::istream& stream, Level& value);
|
||||
|
||||
struct Entry {
|
||||
Entry(Level level, const std::string& message);
|
||||
|
||||
time_t timestamp;
|
||||
int threadCounter;
|
||||
Level level;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
class Formatter {
|
||||
public:
|
||||
virtual ~Formatter() = default;
|
||||
virtual std::string format(const Entry& entry) = 0;
|
||||
};
|
||||
|
||||
class SimpleConsoleFormatter : public Formatter {
|
||||
public:
|
||||
std::string format(const Entry& entry) override;
|
||||
};
|
||||
|
||||
class SimpleFileFormatter : public Formatter {
|
||||
public:
|
||||
std::string format(const Entry& entry) override;
|
||||
private:
|
||||
SimpleConsoleFormatter consoleFormatter;
|
||||
};
|
||||
|
||||
class Sink {
|
||||
public:
|
||||
virtual ~Sink() = default;
|
||||
virtual void receive(const Entry& entry) = 0;
|
||||
};
|
||||
|
||||
class LevelFilter : public Sink {
|
||||
public:
|
||||
LevelFilter(std::shared_ptr<Sink> innerSink, Level minLevel);
|
||||
void receive(const Entry& entry) override;
|
||||
private:
|
||||
std::shared_ptr<Sink> innerSink;
|
||||
Level minLevel;
|
||||
};
|
||||
|
||||
class StreamSink : public Sink {
|
||||
public:
|
||||
StreamSink(std::shared_ptr<std::ostream> stream, std::shared_ptr<Formatter> formatter);
|
||||
void receive(const Entry& entry) override;
|
||||
private:
|
||||
std::shared_ptr<std::ostream> stream;
|
||||
std::shared_ptr<Formatter> formatter;
|
||||
};
|
||||
|
||||
class StdErrSink : public StreamSink {
|
||||
public:
|
||||
explicit StdErrSink(std::shared_ptr<Formatter> formatter);
|
||||
};
|
||||
|
||||
class PausableSink : public Sink {
|
||||
public:
|
||||
explicit PausableSink(std::shared_ptr<Sink> innerSink);
|
||||
void receive(const Entry& entry) override;
|
||||
void pause();
|
||||
void resume();
|
||||
private:
|
||||
std::shared_ptr<Sink> innerSink;
|
||||
std::vector<Entry> buffer;
|
||||
std::mutex mutex;
|
||||
bool isPaused = false;
|
||||
};
|
||||
|
||||
void addSink(std::shared_ptr<Sink> sink);
|
||||
|
||||
void log(Level level, const std::string& message);
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
#include "sinks.h"
|
||||
#include <iostream>
|
||||
#include "Entry.h"
|
||||
|
||||
using std::string;
|
||||
using std::lock_guard;
|
||||
using std::shared_ptr;
|
||||
|
||||
namespace logging {
|
||||
|
||||
LevelFilter::LevelFilter(shared_ptr<Sink> innerSink, Level minLevel) :
|
||||
innerSink(innerSink),
|
||||
minLevel(minLevel)
|
||||
{}
|
||||
|
||||
void LevelFilter::receive(const Entry& entry) {
|
||||
if (entry.level >= minLevel) {
|
||||
innerSink->receive(entry);
|
||||
}
|
||||
}
|
||||
|
||||
StreamSink::StreamSink(shared_ptr<std::ostream> stream, shared_ptr<Formatter> formatter) :
|
||||
stream(stream),
|
||||
formatter(formatter)
|
||||
{}
|
||||
|
||||
void StreamSink::receive(const Entry& entry) {
|
||||
string line = formatter->format(entry);
|
||||
*stream << line << std::endl;
|
||||
}
|
||||
|
||||
StdErrSink::StdErrSink(shared_ptr<Formatter> formatter) :
|
||||
StreamSink(std::shared_ptr<std::ostream>(&std::cerr, [](void*) {}), formatter)
|
||||
{}
|
||||
|
||||
PausableSink::PausableSink(shared_ptr<Sink> innerSink) :
|
||||
innerSink(innerSink)
|
||||
{}
|
||||
|
||||
void PausableSink::receive(const Entry& entry) {
|
||||
lock_guard<std::mutex> lock(mutex);
|
||||
if (isPaused) {
|
||||
buffer.push_back(entry);
|
||||
} else {
|
||||
innerSink->receive(entry);
|
||||
}
|
||||
}
|
||||
|
||||
void PausableSink::pause() {
|
||||
lock_guard<std::mutex> lock(mutex);
|
||||
isPaused = true;
|
||||
|
||||
}
|
||||
|
||||
void PausableSink::resume() {
|
||||
lock_guard<std::mutex> lock(mutex);
|
||||
isPaused = false;
|
||||
for (const Entry& entry : buffer) {
|
||||
innerSink->receive(entry);
|
||||
}
|
||||
buffer.clear();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
#pragma once
|
||||
|
||||
#include "Sink.h"
|
||||
#include <memory>
|
||||
#include "Formatter.h"
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
|
||||
namespace logging {
|
||||
enum class Level;
|
||||
|
||||
class LevelFilter : public Sink {
|
||||
public:
|
||||
LevelFilter(std::shared_ptr<Sink> innerSink, Level minLevel);
|
||||
void receive(const Entry& entry) override;
|
||||
private:
|
||||
std::shared_ptr<Sink> innerSink;
|
||||
Level minLevel;
|
||||
};
|
||||
|
||||
class StreamSink : public Sink {
|
||||
public:
|
||||
StreamSink(std::shared_ptr<std::ostream> stream, std::shared_ptr<Formatter> formatter);
|
||||
void receive(const Entry& entry) override;
|
||||
private:
|
||||
std::shared_ptr<std::ostream> stream;
|
||||
std::shared_ptr<Formatter> formatter;
|
||||
};
|
||||
|
||||
class StdErrSink : public StreamSink {
|
||||
public:
|
||||
explicit StdErrSink(std::shared_ptr<Formatter> formatter);
|
||||
};
|
||||
|
||||
class PausableSink : public Sink {
|
||||
public:
|
||||
explicit PausableSink(std::shared_ptr<Sink> innerSink);
|
||||
void receive(const Entry& entry) override;
|
||||
void pause();
|
||||
void resume();
|
||||
private:
|
||||
std::shared_ptr<Sink> innerSink;
|
||||
std::vector<Entry> buffer;
|
||||
std::mutex mutex;
|
||||
bool isPaused = false;
|
||||
};
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "Phone.h"
|
||||
#include "core/Phone.h"
|
||||
|
||||
std::vector<Phone> wordToPhones(const std::string& word);
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "tools.h"
|
||||
#include "tools/tools.h"
|
||||
|
||||
extern "C" {
|
||||
#include <pocketsphinx.h>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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" {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "EnumConverter.h"
|
||||
#include "tools/EnumConverter.h"
|
||||
|
||||
enum class ExportFormat {
|
||||
Tsv,
|
|
@ -1,30 +1,32 @@
|
|||
#include <iostream>
|
||||
#include <format.h>
|
||||
#include <tclap/CmdLine.h>
|
||||
#include "appInfo.h"
|
||||
#include "NiceCmdLineOutput.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "logging.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;
|
||||
|
@ -184,7 +186,8 @@ int main(int platformArgc, char *platformArgv[]) {
|
|||
outputFile = boost::in_place(outputFileName.getValue());
|
||||
outputFile->exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
}
|
||||
exporter->exportAnimation(inputFilePath, animation, targetShapeSet, outputFile ? *outputFile : std::cout);
|
||||
ExporterInput exporterInput = ExporterInput(inputFilePath, animation, targetShapeSet);
|
||||
exporter->exportAnimation(exporterInput, outputFile ? *outputFile : std::cout);
|
||||
|
||||
logging::info("Exiting application normally.");
|
||||
} catch (...) {
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <TimeRange.h>
|
||||
#include "time/TimeRange.h"
|
||||
#include <iostream>
|
||||
|
||||
template<typename TValue>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <set>
|
||||
#include <boost/optional.hpp>
|
||||
#include <type_traits>
|
||||
#include "tools.h"
|
||||
#include "tools/tools.h"
|
||||
|
||||
enum class FindMode {
|
||||
SampleLeft,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <utf8.h>
|
||||
#include <utf8proc.h>
|
||||
#include <regex>
|
||||
#include <format.h>
|
||||
|
||||
using std::string;
|
||||
using std::wstring;
|
||||
|
@ -157,3 +158,33 @@ string normalizeUnicode(const string s, NormalizationOptions options) {
|
|||
free(result);
|
||||
return resultString;
|
||||
}
|
||||
|
||||
string escapeJsonString(const string& s) {
|
||||
// JavaScript uses UTF-16 internally. As a result, character escaping in JSON strings is UTF-16-based.
|
||||
// Convert string to UTF-16
|
||||
std::u16string utf16String;
|
||||
utf8::utf8to16(s.begin(), s.end(), std::back_inserter(utf16String));
|
||||
|
||||
string result;
|
||||
for (char16_t c : utf16String) {
|
||||
switch (c) {
|
||||
case '"': result += "\\\""; break;
|
||||
case '\\': result += "\\\\"; break;
|
||||
case '\b': result += "\\b"; break;
|
||||
case '\f': result += "\\f"; break;
|
||||
case '\n': result += "\\n"; break;
|
||||
case '\r': result += "\\r"; break;
|
||||
case '\t': result += "\\t"; break;
|
||||
default:
|
||||
{
|
||||
bool needsEscaping = c < '\x20' || c >= 0x80;
|
||||
if (needsEscaping) {
|
||||
result += fmt::format("\\u{0:04x}", c);
|
||||
} else {
|
||||
result += static_cast<char>(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -48,3 +48,5 @@ std::string join(T range, const std::string separator) {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string escapeJsonString(const std::string& s);
|
|
@ -1,5 +1,5 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include "BoundedTimeline.h"
|
||||
#include "time/BoundedTimeline.h"
|
||||
|
||||
using namespace testing;
|
||||
using std::vector;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include "ContinuousTimeline.h"
|
||||
#include "time/ContinuousTimeline.h"
|
||||
|
||||
using namespace testing;
|
||||
using std::vector;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include "Lazy.h"
|
||||
#include "tools/Lazy.h"
|
||||
|
||||
using namespace testing;
|
||||
using std::make_unique;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include "Timeline.h"
|
||||
#include "time/Timeline.h"
|
||||
#include <limits>
|
||||
#include <functional>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include "g2p.h"
|
||||
#include "recognition/g2p.h"
|
||||
|
||||
using namespace testing;
|
||||
using std::vector;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include "pairs.h"
|
||||
#include "tools/pairs.h"
|
||||
|
||||
using namespace testing;
|
||||
using std::vector;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include "stringTools.h"
|
||||
#include "tools/stringTools.h"
|
||||
|
||||
using namespace testing;
|
||||
using std::string;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include "tokenization.h"
|
||||
#include "recognition/tokenization.h"
|
||||
#include <regex>
|
||||
#include <unordered_set>
|
||||
#include <utf8.h>
|
||||
|
|
Loading…
Reference in New Issue