2 #include <sigc++/sigc++.h>
3 #include <cppunit/TestFixture.h>
4 #include <cppunit/extensions/HelperMacros.h>
27 switch (param.
type()) {
35 switch (buf[0] & 0xF0) {
54 template<
typename Time>
67 return std::shared_ptr<Control>(
new Control(param, desc, list));
71 template<
typename Time>
74 TestSink() : _last_event_time(Time::from_double (-1)) {}
77 sigc::signal<uint32_t, Time, EventType, uint32_t, const uint8_t*>
writing;
79 virtual uint32_t
write(Time time,
EventType type, uint32_t size,
const uint8_t* buf) {
81 uint32_t result = writing(time, type, size, buf);
82 _last_event_time = time;
87 Time time,
EventType , uint32_t ,
const uint8_t* ) {
88 CPPUNIT_ASSERT(_last_event_time <= time);
98 template<
typename Time>
103 virtual uint32_t
write(Time time,
EventType type, uint32_t size,
const uint8_t* buf) {
104 if (type == cc_type) {
105 CPPUNIT_ASSERT_EQUAL((uint32_t)3, size);
106 events.push_back(std::make_pair(time, buf[2]));
111 typedef std::vector< std::pair<Time, uint8_t> >
Events;
128 typedef std::vector< std::shared_ptr< Note<Time> > >
Notes;
136 for (
int i = 0; i < 12; i++) {
137 test_notes.push_back(
139 new Note<Time>(0, Time::from_double(i * 100), Time::from_double(100), 64 + i, 64)));
std::vector< std::pair< Time, uint8_t > > Events
virtual uint32_t write(Time time, EventType type, uint32_t size, const uint8_t *buf)
std::string to_symbol(const Parameter &) const
virtual ParameterType midi_parameter_type(const uint8_t *buf, uint32_t len) const
uint8_t parameter_midi_type(const Parameter ¶m) const
ParameterDescriptor descriptor(const Parameter ¶m) const
bool type_is_midi(uint32_t) const
ParameterType type() const
virtual bool find_next_event(double start, double end, ControlEvent &ev, bool only_active) const
std::shared_ptr< Control > control_factory(const Parameter ¶m)
MySequence(const MySequence ©)
MySequence(DummyTypeMap &map)
void controlInterpolationTest()
void preserveEventOrderingTest()
std::vector< std::shared_ptr< Note< Time > > > Notes
CPPUNIT_TEST(controlInterpolationTest)
CPPUNIT_TEST(preserveEventOrderingTest)
CPPUNIT_TEST_SUITE(SequenceTest)
CPPUNIT_TEST(iteratorSeekTest)
uint32_t assertLastEventTimeEarlier(Time time, EventType, uint32_t, const uint8_t *)
virtual uint32_t write(Time time, EventType type, uint32_t size, const uint8_t *buf)
sigc::signal< uint32_t, Time, EventType, uint32_t, const uint8_t * > writing
return value, time, type, size, buffer
Time last_event_time() const
#define MIDI_CMD_COMMON_SYSEX
#define MIDI_CMD_NOTE_OFF
PBD::PropertyDescriptor< timepos_t > start
float upper
Maximum value (in Hz, for frequencies)
unsigned int rangesteps
number of steps, [min,max] (inclusive). <= 1 means continuous. == 2 only min, max....