Skip to content

Commit

Permalink
[core] Fix some tests and refactor files
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jun 24, 2024
1 parent c8b9fcb commit e1d0c9e
Show file tree
Hide file tree
Showing 20 changed files with 546 additions and 494 deletions.
34 changes: 34 additions & 0 deletions src/ossia/dataflow/audio_lock.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once

#include <ossia/detail/config.hpp>

#include <ossia/detail/audio_spin_mutex.hpp>
#include <ossia/detail/mutex.hpp>

#include <mutex>

#if defined(OSSIA_PARALLEL)
using ossia_audio_lock_t = std::unique_lock<ossia::audio_spin_mutex>;
#define OSSIA_EXEC_STATE_LOCK_READ(state) \
ossia_audio_lock_t ossia_read_lock \
{ \
(state).mutex \
}
#define OSSIA_EXEC_STATE_LOCK_WRITE(state) \
ossia_audio_lock_t ossia_write_lock \
{ \
(state).mutex \
}
#else
struct ossia_audio_lock_t
{
void lock() { }
void unlock() { }
};
#define OSSIA_EXEC_STATE_LOCK_READ(state) \
ossia_audio_lock_t ossia_read_lock; \
(void)ossia_read_lock;
#define OSSIA_EXEC_STATE_LOCK_WRITE(state) \
ossia_audio_lock_t ossia_write_lock; \
(void)ossia_write_lock;
#endif
1 change: 1 addition & 0 deletions src/ossia/dataflow/execution/default_policy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "default_policy.hpp"

#include <ossia/dataflow/execution/to_state_element.hpp>
#include <ossia/editor/state/detail/state_flatten_visitor.hpp>

namespace ossia
Expand Down
3 changes: 2 additions & 1 deletion src/ossia/dataflow/execution/default_policy.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include <ossia/dataflow/execution/execution_policy.hpp>
#include <ossia/dataflow/execution/local_state_execution_policy.hpp>
#include <ossia/editor/state/flat_vec_state.hpp>

namespace ossia
{
Expand Down
6 changes: 3 additions & 3 deletions src/ossia/dataflow/execution/direct_policy.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#undef NDEBUG
#include "direct_policy.hpp"

#include <ossia/audio/audio_parameter.hpp>
#include <ossia/dataflow/audio_port.hpp>
#include <ossia/dataflow/midi_port.hpp>
#include <ossia/dataflow/value_port.hpp>
#include <ossia/detail/thread.hpp>
#include <ossia/protocols/midi/midi_parameter.hpp>
#include <ossia/protocols/midi/midi_protocol.hpp>

#include <charconv>

namespace ossia
{
static thread_local std::vector<ossia::bundle_element> g_direct_policy_message_cache
Expand Down
1 change: 1 addition & 0 deletions src/ossia/dataflow/execution/direct_policy.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include <ossia/dataflow/execution/execution_policy.hpp>
#include <ossia/detail/lockfree_queue.hpp>
#include <ossia/network/base/bundle.hpp>

#include <blockingconcurrentqueue.h>
Expand Down
Loading

0 comments on commit e1d0c9e

Please sign in to comment.