mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
MidiBuffer: make ::write() return an error code if ::insert_event() fails
This commit is contained in:
parent
6e58f6e2c8
commit
1e6d75d781
1 changed files with 5 additions and 2 deletions
|
|
@ -258,8 +258,11 @@ MidiBuffer::insert_event (const Evoral::Event<TimeType>& ev)
|
||||||
uint32_t
|
uint32_t
|
||||||
MidiBuffer::write (TimeType time, Evoral::EventType type, uint32_t size, const uint8_t* buf)
|
MidiBuffer::write (TimeType time, Evoral::EventType type, uint32_t size, const uint8_t* buf)
|
||||||
{
|
{
|
||||||
insert_event(Evoral::Event<TimeType>(type, time, size, const_cast<uint8_t*>(buf)));
|
if (insert_event (Evoral::Event<TimeType>(type, time, size, const_cast<uint8_t*>(buf)))) {
|
||||||
return size;
|
return size;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Reserve space for a new event in the buffer.
|
/** Reserve space for a new event in the buffer.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue