From 318b37d8b556add13b3f156f31c9e72eca339a16 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 17 Aug 2012 02:14:07 +0000 Subject: Implement real logging system, LV2 log extension support, and purge evil/ugly/untranslatable C++ stream printing. Remove coloured log stuff from Raul. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4717 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/internals/Note.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'src/server/internals/Note.cpp') diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 81562f83..25e8aee5 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -21,7 +21,6 @@ #include "lv2/lv2plug.in/ns/ext/midi/midi.h" #include "raul/Array.hpp" #include "raul/Maid.hpp" -#include "raul/log.hpp" #include "Buffer.hpp" #include "Driver.hpp" @@ -34,8 +33,6 @@ #include "internals/Note.hpp" #include "util.hpp" -#define LOG(s) s << "[NoteNode] " - // #define NOTE_DEBUG 1 using namespace std; @@ -190,9 +187,6 @@ NoteNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, F uint32_t voice_num = 0; if (key->state != Key::OFF) { -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "Double midi note received" << endl; -#endif return; } @@ -221,19 +215,11 @@ NoteNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, F assert(voice != NULL); assert(voice == &(*_voices)[voice_num]); -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "Note " << (int)note_num << " on @ " << time - << ". Voice " << voice_num << " / " << _polyphony << endl; -#endif - // Update stolen key, if applicable if (voice->state == Voice::Voice::ACTIVE) { assert(_keys[voice->note].state == Key::ON_ASSIGNED); assert(_keys[voice->note].voice == voice_num); _keys[voice->note].state = Key::Key::ON_UNASSIGNED; -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "Stole voice " << voice_num << endl; -#endif } // Store key information for later reallocation on note off @@ -268,31 +254,15 @@ NoteNode::note_off(ProcessContext& context, uint8_t note_num, FrameTime time) Key* key = &_keys[note_num]; -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "Note " << (int)note_num << " off @ " << time << endl; -#endif - if (key->state == Key::ON_ASSIGNED) { // Assigned key, turn off voice and key if ((*_voices)[key->voice].state == Voice::ACTIVE) { assert((*_voices)[key->voice].note == note_num); - if ( ! _sustain) { -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "Free voice " << key->voice << endl; -#endif free_voice(context, key->voice, time); } else { -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "Hold voice " << key->voice << endl; -#endif (*_voices)[key->voice].state = Voice::HOLDING; } - - } else { -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "WARNING: Assigned key, but voice not active" << endl; -#endif } } @@ -331,9 +301,6 @@ NoteNode::free_voice(ProcessContext& context, uint32_t voice, FrameTime time) (*_voices)[voice].state = Voice::ACTIVE; } else { // No new note for voice, deactivate (set gate low) -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "Note off: key " << (int)(*_voices)[voice].note << " voice " << voice << endl; -#endif _gate_port->set_voice_value(context, voice, time, 0.0f); (*_voices)[voice].state = Voice::FREE; } @@ -344,10 +311,6 @@ NoteNode::all_notes_off(ProcessContext& context, FrameTime time) { assert(time >= context.start() && time <= context.end()); -#ifdef NOTE_DEBUG - LOG(Raul::debug) << "All notes off @ " << time << endl; -#endif - // FIXME: set all keys to Key::OFF? for (uint32_t i = 0; i < _polyphony; ++i) { -- cgit v1.2.1