Skip to content

Commit

Permalink
concepts: define note port
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jan 4, 2025
1 parent bc81cfd commit adf2e1b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions include/avnd/concepts/note_port.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

/* SPDX-License-Identifier: GPL-3.0-or-later OR BSL-1.0 OR CC0-1.0 OR CC-PDCC OR 0BSD */

#include <avnd/common/concepts_polyfill.hpp>
#include <avnd/concepts/generic.hpp>
#include <avnd/concepts/midi.hpp>

namespace avnd
{

// Note ports
// FIXME MPE, etc.
template <typename T>
concept note_port = requires(T t) { t.notes; };

template <typename T>
concept dynamic_container_notes = note_port<T> && vector_ish<decltype(T::midi_messages)>;

template <typename T>
concept raw_container_note_port
= note_port<T> && std::is_pointer_v<decltype(T::midi_messages)>
&& std::is_integral_v<decltype(T::size)>;

}

0 comments on commit adf2e1b

Please sign in to comment.