summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie/surface_port.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/surfaces/mackie/surface_port.cc')
-rw-r--r--libs/surfaces/mackie/surface_port.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/surfaces/mackie/surface_port.cc b/libs/surfaces/mackie/surface_port.cc
index bf5e7417ab..9d0296a9a4 100644
--- a/libs/surfaces/mackie/surface_port.cc
+++ b/libs/surfaces/mackie/surface_port.cc
@@ -117,11 +117,19 @@ SurfacePort::write (const MidiByteArray & mba)
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("port %1 write %2\n", output_port().name(), mba));
- int count = output_port().write (mba.bytes().get(), mba.size(), 0);
+ if (mba[0] != 0xf0 && mba.size() > 3) {
+ std::cerr << "TOO LONG WRITE: " << mba << std::endl;
+ }
+
+ /* this call relies on std::vector<T> using contiguous storage. not
+ * actually guaranteed by the standard, but way, way beyond likely.
+ */
+
+ int count = output_port().write (&mba[0], mba.size(), 0);
- if (count != (int)mba.size()) {
+ if (count != (int) mba.size()) {
- if (errno == 0) {
+ if (errno == 0) {
cout << "port overflow on " << output_port().name() << ". Did not write all of " << mba << endl;