Skip to content

Commit

Permalink
[code] Cleanups, remove useless includes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed May 29, 2023
1 parent df7e69d commit d1820cb
Show file tree
Hide file tree
Showing 45 changed files with 165 additions and 110 deletions.
26 changes: 14 additions & 12 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,20 @@ if(OSSIA_PROTOCOL_OSCQUERY)
ossia_add_example(preset_print_namespace "${CMAKE_CURRENT_SOURCE_DIR}/Preset/PrintNamespace.cpp")

if(NOT "${CMAKE_BUILD_TYPE}" MATCHES "Debug")
find_package(OpenCV
COMPONENTS
core
videoio
imgcodecs
imgproc)
if(OpenCV_FOUND)
ossia_add_example(jpeg_streamer "${CMAKE_CURRENT_SOURCE_DIR}/Web/JpegStreamer.cpp")
target_link_libraries(ossia_jpeg_streamer_example PRIVATE ${OpenCV_LIBS})

ossia_add_example(double_ws_server "${CMAKE_CURRENT_SOURCE_DIR}/Web/DoubleWSServer.cpp")
target_link_libraries(ossia_double_ws_server_example PRIVATE ${OpenCV_LIBS})
if(NOT "${CMAKE_CXX_FLAGS}" MATCHES "GLIBCXX_DEBUG")
find_package(OpenCV
COMPONENTS
core
videoio
imgcodecs
imgproc)
if(OpenCV_FOUND)
ossia_add_example(jpeg_streamer "${CMAKE_CURRENT_SOURCE_DIR}/Web/JpegStreamer.cpp")
target_link_libraries(ossia_jpeg_streamer_example PRIVATE ${OpenCV_LIBS})

ossia_add_example(double_ws_server "${CMAKE_CURRENT_SOURCE_DIR}/Web/DoubleWSServer.cpp")
target_link_libraries(ossia_double_ws_server_example PRIVATE ${OpenCV_LIBS})
endif()
endif()
endif()
endif()
Expand Down
91 changes: 91 additions & 0 deletions minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
cmake_minimum_required(VERSION 3.26 FATAL_ERROR)
project(ossia C CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(OSSIA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/..")
set(OSSIA_3RDPARTY_FOLDER ${OSSIA_ROOT}/3rdparty)
set(SRC ${OSSIA_ROOT}/src/ossia)
include(${OSSIA_ROOT}/src/ossia_sources.cmake)

configure_file(${OSSIA_ROOT}/src/ossia-config.hpp.in ossia-config.hpp)

add_library(ossia)
target_compile_options(ossia PRIVATE -std=c++20)
target_compile_definitions(ossia PRIVATE OSSIA_EXPORTS=1 OSSIA_FREESTANDING=1)
target_link_libraries(ossia PRIVATE -Wl,-z,defs -fuse-ld=mold)
target_include_directories(ossia PRIVATE /home/jcelerier/ossia/score/3rdparty/libossia/3rdparty/boost_1_82_0)

target_include_directories(ossia PRIVATE
${OSSIA_ROOT}/src
#$<BUILD_INTERFACE:${OSSIA_3RDPARTY_FOLDER}/compile-time-regular-expressions/include>
$<BUILD_INTERFACE:${OSSIA_3RDPARTY_FOLDER}/nano-signal-slot/include>
$<BUILD_INTERFACE:${OSSIA_3RDPARTY_FOLDER}/tuplet/include>
$<BUILD_INTERFACE:${OSSIA_3RDPARTY_FOLDER}/SmallFunction/smallfun/include>
$<BUILD_INTERFACE:${OSSIA_3RDPARTY_FOLDER}/span/include>
$<BUILD_INTERFACE:${OSSIA_3RDPARTY_FOLDER}/unordered_dense/include>
$<BUILD_INTERFACE:${OSSIA_3RDPARTY_FOLDER}/libremidi/include>
)

target_sources(ossia PRIVATE

"${SRC}/detail/lockfree_queue.hpp"
"${SRC}/context.cpp"
"${SRC}/detail/thread.cpp"
"${SRC}/detail/any_map.cpp"

"${SRC}/network/base/device.cpp"
"${SRC}/network/base/protocol.cpp"
"${SRC}/network/base/parameter.cpp"
"${SRC}/network/base/name_validation.cpp"
"${SRC}/network/base/node.cpp"
"${SRC}/network/base/node_attributes.cpp"
"${SRC}/network/base/node_functions.cpp"
"${SRC}/network/common/complex_type.cpp"
"${SRC}/network/common/path.cpp"
"${SRC}/network/base/osc_address.cpp"
"${SRC}/network/common/extended_types.cpp"
"${SRC}/network/common/value_mapping.cpp"
"${SRC}/network/dataspace/dataspace_visitors.cpp"
"${SRC}/network/dataspace/detail/dataspace_impl.cpp"
"${SRC}/network/domain/domain_base.cpp"
"${SRC}/network/domain/detail/domain_impl.cpp"
"${SRC}/network/domain/clamp.cpp"
"${SRC}/network/domain/clamp_min.cpp"
"${SRC}/network/domain/clamp_max.cpp"
"${SRC}/network/domain/wrap.cpp"
"${SRC}/network/domain/fold.cpp"
"${SRC}/network/exceptions.cpp"
"${SRC}/network/value/value.cpp"

"${SRC}/dataflow/data.cpp"
"${SRC}/dataflow/port.cpp"
"${SRC}/dataflow/graph_node.cpp"
"${SRC}/dataflow/execution_state.cpp"
"${SRC}/dataflow/nodes/state.cpp"

"${SRC}/editor/curve/curve.cpp"

"${SRC}/editor/exceptions.cpp"
"${SRC}/editor/expression/expression.cpp"
"${SRC}/editor/expression/expression_bool.cpp"
"${SRC}/editor/expression/expression_composition.cpp"
"${SRC}/editor/expression/expression_generic.cpp"
"${SRC}/editor/expression/expression_not.cpp"
"${SRC}/editor/expression/expression_pulse.cpp"
"${SRC}/editor/expression/expression_atom.cpp"

"${SRC}/editor/state/message.cpp"
"${SRC}/editor/state/state.cpp"
"${SRC}/editor/state/state_element.cpp"

"${SRC}/editor/scenario/scenario.cpp"
"${SRC}/editor/scenario/time_interval.cpp"
"${SRC}/editor/scenario/time_event.cpp"
"${SRC}/editor/scenario/time_process.cpp"
"${SRC}/editor/scenario/time_sync.cpp"
"${SRC}/editor/scenario/detail/scenario_sync_musical_execution.cpp"
"${SRC}/editor/scenario/detail/scenario_offset.cpp"
"${SRC}/editor/scenario/detail/scenario_sync_execution.cpp"
"${SRC}/editor/scenario/detail/scenario_execution.cpp"

)
1 change: 0 additions & 1 deletion src/ossia-c/ossia/ossia_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <ossia/detail/flat_map.hpp>
#include <ossia/network/generic/generic_device.hpp>

#include <iostream>
#include <map>

global_devices& static_devices()
Expand Down
1 change: 1 addition & 0 deletions src/ossia-config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

#cmakedefine OSSIA_HAS_FMT
#cmakedefine OSSIA_HAS_RE2
#cmakedefine OSSIA_HAS_CTRE
#cmakedefine OSSIA_HAS_RAPIDFUZZ

// Code configuration
Expand Down
3 changes: 0 additions & 3 deletions src/ossia-qt/qt_logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <spdlog/sinks/sink.h>

#include <iostream>
#include <verdigris>

Q_DECLARE_METATYPE(spdlog::level::level_enum)
Expand All @@ -29,8 +28,6 @@ class OSSIA_EXPORT log_sink final
void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) override { }
void log(const spdlog::details::log_msg& msg) override
{
std::cerr.write(msg.payload.data(), msg.payload.size());
std::cerr << std::endl;
l(msg.level, QString::fromUtf8(msg.payload.data(), msg.payload.size()));
}

Expand Down
1 change: 0 additions & 1 deletion src/ossia/audio/pipewire_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <cassert>
#include <cerrno>
#include <cstdio>
#include <iostream>
#include <stdexcept>

#include <spa/param/latency-utils.h>
Expand Down
1 change: 0 additions & 1 deletion src/ossia/audio/portaudio_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <ossia/audio/audio_engine.hpp>

#include <portaudio.h>

#include <iostream>

#define OSSIA_AUDIO_PORTAUDIO 1
Expand Down
2 changes: 0 additions & 2 deletions src/ossia/audio/pulseaudio_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <pulse/pulseaudio.h>

#include <iostream>

#define OSSIA_AUDIO_PULSEAUDIO 1
namespace ossia
{
Expand Down
1 change: 0 additions & 1 deletion src/ossia/audio/sdl_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <SDL2/SDL.h>
#include <SDL2/SDL_audio.h>

#include <iostream>
#define OSSIA_AUDIO_SDL 1

namespace ossia
Expand Down
1 change: 0 additions & 1 deletion src/ossia/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <smallfun.hpp>

#include <iostream>
#include <memory>

#if defined(_MSC_VER)
Expand Down
2 changes: 2 additions & 0 deletions src/ossia/dataflow/graph/graph_static.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ struct graph_static final
}
catch(...)
{
#if 0
std::cout << "Error: graph isn't a DAG: ";
print_graph(gr, std::cout);
std::cout << std::endl;
#endif
}
}

Expand Down
19 changes: 10 additions & 9 deletions src/ossia/dataflow/graph/node_executors.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <ossia/detail/logger.hpp>
#include <ossia/dataflow/graph/graph_utils.hpp>
#include <iostream>

namespace ossia
{
struct node_exec
Expand All @@ -18,7 +19,7 @@ struct node_exec
}
catch(...)
{
std::cerr << "Error while executing a node\n";
ossia::logger().error("Error while executing a node");
}
};
struct node_exec_bench
Expand Down Expand Up @@ -49,7 +50,7 @@ struct node_exec_bench
}
catch(...)
{
std::cerr << "Error while executing a node\n";
ossia::logger().error("Error while executing a node");
}
};

Expand All @@ -72,7 +73,7 @@ struct node_exec_logger
}
catch(...)
{
std::cerr << "Error while executing a node\n";
ossia::logger().error("Error while executing a node");
}
};

Expand Down Expand Up @@ -115,7 +116,7 @@ struct node_exec_logger_bench
}
catch(...)
{
std::cerr << "Error while executing a node\n";
ossia::logger().error("Error while executing a node");
}
};

Expand Down Expand Up @@ -152,7 +153,7 @@ struct static_exec
}
catch(...)
{
std::cerr << "Error while executing a node\n";
ossia::logger().error("Error while executing a node");
}
};

Expand Down Expand Up @@ -214,7 +215,7 @@ struct static_exec_bench
}
catch(...)
{
std::cerr << "Error while executing a node\n";
ossia::logger().error("Error while executing a node");
}
};

Expand Down Expand Up @@ -256,7 +257,7 @@ struct static_exec_logger
}
catch(...)
{
std::cerr << "Error while executing a node\n";
ossia::logger().error("Error while executing a node");
}
};

Expand Down Expand Up @@ -326,7 +327,7 @@ struct static_exec_logger_bench
}
catch(...)
{
std::cerr << "Error while executing a node\n";
ossia::logger().error("Error while executing a node");
}
};
}
2 changes: 0 additions & 2 deletions src/ossia/dataflow/nodes/faust/faust_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <faust/gui/UI.h>

#include <iostream>

#include <faust/dsp/poly-llvm-dsp.h>

namespace ossia::nodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <RubberBandStretcher.h>

#include <iostream>
namespace ossia
{
#if __has_include(<RubberBandStretcher.h>)
Expand Down
1 change: 0 additions & 1 deletion src/ossia/dataflow/safe_nodes/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <ossia/detail/apply_type.hpp>
#include <ossia/detail/flat_map.hpp>

#include <brigand/types/args.hpp>
#include <tuplet/tuple.hpp>

#include <array>
Expand Down
9 changes: 1 addition & 8 deletions src/ossia/detail/buffer_pool.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#pragma once
#include <ossia/detail/pod_vector.hpp>
#include <ossia/detail/lockfree_queue.hpp>

#include <concurrentqueue.h>
namespace ossia
{
template <typename Obj_T>
struct object_pool
{
template <typename T, size_t MAX_BLOCK_SIZE = 64>
using mpmc_queue = moodycamel::ConcurrentQueue<T>;

mpmc_queue<Obj_T> buffers;

Obj_T acquire()
Expand All @@ -35,8 +32,6 @@ template <typename Obj_T, typename Alloc, std::size_t... sz>
struct sized_object_pool
{
using SizeSpec = std::integer_sequence<std::size_t, sz...>;
template <typename T, size_t MAX_BLOCK_SIZE = 64>
using mpmc_queue = moodycamel::ConcurrentQueue<T>;

static const constexpr auto buckets = SizeSpec::size() + 1;
std::array<mpmc_queue<Obj_T>, buckets> queues;
Expand Down Expand Up @@ -99,8 +94,6 @@ struct container_memory_manager

struct buffer_pool
{
template <typename T, size_t MAX_BLOCK_SIZE = 64>
using mpmc_queue = moodycamel::ConcurrentQueue<T>;
using buffer = ossia::pod_vector<char>;

mpmc_queue<buffer> buffers;
Expand Down
1 change: 0 additions & 1 deletion src/ossia/detail/mpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <brigand/algorithms/transform.hpp>
#include <brigand/sequences/make_sequence.hpp>

#include <iostream>
#include <list>
#include <tuple>
#include <utility>
Expand Down
1 change: 0 additions & 1 deletion src/ossia/editor/scenario/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <ossia/editor/state/state.hpp>

#include <cassert>
#include <iostream>

namespace ossia
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <ossia/editor/scenario/time_interval.hpp>
#include <ossia/editor/scenario/time_sync.hpp>

#include <iostream>
namespace ossia
{

Expand Down
3 changes: 1 addition & 2 deletions src/ossia/editor/scenario/execution_log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

#include <rapidjson/prettywriter.h>

#include <fstream>
#include <functional>
#include <iostream>

namespace ossia
{
struct on_destruct {
Expand Down
Loading

0 comments on commit d1820cb

Please sign in to comment.