summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_ring_buffer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-01-10 17:31:43 +0000
committerCarl Hetherington <carl@carlh.net>2011-01-10 17:31:43 +0000
commitbc84cb7479a4f05f3a96de42a917a25d6a5f7dc7 (patch)
tree391a6ceae2b04ba549987ee3d0176ed254875022 /libs/ardour/midi_ring_buffer.cc
parent65c97361a959a4b8e4be20a189338cc6480ebe3c (diff)
Make a couple of bits of debug conditional to avoid mallocs when they are turned off.
git-svn-id: svn://localhost/ardour2/branches/3.0@8492 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_ring_buffer.cc')
-rw-r--r--libs/ardour/midi_ring_buffer.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/libs/ardour/midi_ring_buffer.cc b/libs/ardour/midi_ring_buffer.cc
index b25154fefb..a10ad0b199 100644
--- a/libs/ardour/midi_ring_buffer.cc
+++ b/libs/ardour/midi_ring_buffer.cc
@@ -137,16 +137,18 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, framepos_t start, framepos_t end, frame
success = read_contents (ev_size, write_loc);
#ifndef NDEBUG
- DEBUG_STR_DECL(a);
- DEBUG_STR_APPEND(a, string_compose ("wrote MidiEvent to Buffer (time=%1, start=%2 offset=%3)", ev_time, start, offset));
- for (size_t i=0; i < ev_size; ++i) {
- DEBUG_STR_APPEND(a,hex);
- DEBUG_STR_APPEND(a,"0x");
- DEBUG_STR_APPEND(a,(int)write_loc[i]);
- DEBUG_STR_APPEND(a,' ');
+ if (DEBUG::MidiDiskstreamIO && PBD::debug_bits) {
+ DEBUG_STR_DECL(a);
+ DEBUG_STR_APPEND(a, string_compose ("wrote MidiEvent to Buffer (time=%1, start=%2 offset=%3)", ev_time, start, offset));
+ for (size_t i=0; i < ev_size; ++i) {
+ DEBUG_STR_APPEND(a,hex);
+ DEBUG_STR_APPEND(a,"0x");
+ DEBUG_STR_APPEND(a,(int)write_loc[i]);
+ DEBUG_STR_APPEND(a,' ');
+ }
+ DEBUG_STR_APPEND(a,'\n');
+ DEBUG_TRACE (DEBUG::MidiDiskstreamIO, DEBUG_STR(a).str());
}
- DEBUG_STR_APPEND(a,'\n');
- DEBUG_TRACE (DEBUG::MidiDiskstreamIO, DEBUG_STR(a).str());
#endif
if (success) {