From 2f31d6e400e4fbdf0ebbb4e50704d4b2500d1398 Mon Sep 17 00:00:00 2001 From: jsiegle <jsiegle@mit.edu> Date: Fri, 24 Jan 2014 22:04:33 -0500 Subject: [PATCH] Remove unnecessary debugging output --- Source/MainWindow.cpp | 14 +++-- Source/Processors/AudioNode.cpp | 6 +-- Source/Processors/AudioResamplingNode.cpp | 6 +-- Source/Processors/ChannelMappingNode.cpp | 2 +- Source/Processors/Editors/ChannelSelector.cpp | 2 +- Source/Processors/Editors/GenericEditor.cpp | 8 +-- Source/Processors/FilterNode.cpp | 2 +- Source/Processors/GenericProcessor.cpp | 2 +- Source/Processors/LfpDisplayNode.cpp | 4 +- Source/Processors/ProcessorGraph.cpp | 4 +- Source/Processors/RecordNode.cpp | 12 ++--- .../Visualization/SpikeDisplayCanvas.cpp | 2 +- Source/UI/DataViewport.cpp | 2 +- Source/UI/EditorViewport.cpp | 2 +- Source/UI/SignalChainManager.cpp | 52 +++++++++---------- Source/UI/UIComponent.cpp | 11 ++-- 16 files changed, 72 insertions(+), 59 deletions(-) diff --git a/Source/MainWindow.cpp b/Source/MainWindow.cpp index fe84eeedc..c7e516550 100644 --- a/Source/MainWindow.cpp +++ b/Source/MainWindow.cpp @@ -41,7 +41,13 @@ MainWindow::MainWindow() // Callbacks will be set by the play button in the control panel processorGraph = new ProcessorGraph(); + std::cout << std::endl; + std::cout << "Created processor graph." << std::endl; + std::cout << std::endl; + audioComponent = new AudioComponent(); + std::cout << "Created audio component." << std::endl; + audioComponent->connectToProcessorGraph(processorGraph); setContentOwned(new UIComponent(this, processorGraph, audioComponent), true); @@ -58,7 +64,7 @@ MainWindow::MainWindow() loadWindowBounds(); setUsingNativeTitleBar(true); Component::addToDesktop(getDesktopWindowStyleFlags()); // prevents the maximize - // button from randomly disappearing + // button from randomly disappearing setVisible(true); // Constraining the window's size doesn't seem to work: @@ -104,9 +110,9 @@ void MainWindow::closeButtonPressed() void MainWindow::saveWindowBounds() { - + std::cout << std::endl; std::cout << "Saving window bounds." << std::endl; - + std::cout << std::endl; File executable = File::getSpecialLocation(File::currentExecutableFile); File executableDirectory = executable.getParentDirectory(); @@ -151,7 +157,9 @@ void MainWindow::saveWindowBounds() void MainWindow::loadWindowBounds() { + std::cout << std::endl; std::cout << "Loading window bounds." << std::endl; + std::cout << std::endl; //File file = File::getCurrentWorkingDirectory().getChildFile("windowState.xml"); diff --git a/Source/Processors/AudioNode.cpp b/Source/Processors/AudioNode.cpp index 533f7ce66..93f65bc6a 100755 --- a/Source/Processors/AudioNode.cpp +++ b/Source/Processors/AudioNode.cpp @@ -161,9 +161,9 @@ void AudioNode::prepareToPlay(double sampleRate_, int estimatedSamplesPerBlock) { - std::cout << "Processor sample rate: " << getSampleRate() << std::endl; - std::cout << "Audio card sample rate: " << sampleRate_ << std::endl; - std::cout << "Samples per block: " << estimatedSamplesPerBlock << std::endl; + // std::cout << "Processor sample rate: " << getSampleRate() << std::endl; + // std::cout << "Audio card sample rate: " << sampleRate_ << std::endl; + // std::cout << "Samples per block: " << estimatedSamplesPerBlock << std::endl; numSamplesExpected = (int) (getSampleRate()/sampleRate_*float(estimatedSamplesPerBlock)) + 1; // processor sample rate divided by sound card sample rate diff --git a/Source/Processors/AudioResamplingNode.cpp b/Source/Processors/AudioResamplingNode.cpp index 49136a8d1..671fd2381 100644 --- a/Source/Processors/AudioResamplingNode.cpp +++ b/Source/Processors/AudioResamplingNode.cpp @@ -91,7 +91,7 @@ void AudioResamplingNode::setParameter(int parameterIndex, float newValue) void AudioResamplingNode::prepareToPlay(double sampleRate_, int estimatedSamplesPerBlock) { - std::cout << "AudioResamplingNode preparing to play." << std::endl; + // std::cout << "AudioResamplingNode preparing to play." << std::endl; if (destBufferIsTempBuffer) { @@ -109,8 +109,8 @@ void AudioResamplingNode::prepareToPlay(double sampleRate_, int estimatedSamples destBufferPos = 0; - std::cout << "Temp buffer size: " << tempBuffer->getNumChannels() << " x " - << tempBuffer->getNumSamples() << std::endl; + // std::cout << "Temp buffer size: " << tempBuffer->getNumChannels() << " x " + // << tempBuffer->getNumSamples() << std::endl; updateFilter(); diff --git a/Source/Processors/ChannelMappingNode.cpp b/Source/Processors/ChannelMappingNode.cpp index bff623d80..b503bdf64 100644 --- a/Source/Processors/ChannelMappingNode.cpp +++ b/Source/Processors/ChannelMappingNode.cpp @@ -55,7 +55,7 @@ AudioProcessorEditor* ChannelMappingNode::createEditor() { editor = new ChannelMappingEditor(this, true); - std::cout << "Creating editor." << std::endl; + //std::cout << "Creating editor." << std::endl; return editor; } diff --git a/Source/Processors/Editors/ChannelSelector.cpp b/Source/Processors/Editors/ChannelSelector.cpp index de724f5d1..0b4470e40 100755 --- a/Source/Processors/Editors/ChannelSelector.cpp +++ b/Source/Processors/Editors/ChannelSelector.cpp @@ -112,7 +112,7 @@ void ChannelSelector::setNumChannels(int numChans) int difference = numChans - parameterButtons.size(); - std::cout << difference << " buttons needed." << std::endl; + // std::cout << difference << " buttons needed." << std::endl; if (difference > 0) { diff --git a/Source/Processors/Editors/GenericEditor.cpp b/Source/Processors/Editors/GenericEditor.cpp index 7590062cb..5e41dc348 100755 --- a/Source/Processors/Editors/GenericEditor.cpp +++ b/Source/Processors/Editors/GenericEditor.cpp @@ -76,7 +76,7 @@ void GenericEditor::constructorInitialize(GenericProcessor* owner, bool useDefau if (!owner->isMerger() && !owner->isSplitter() && !owner->isUtility()) { - std::cout << "Adding drawer button." << std::endl; + // std::cout << "Adding drawer button." << std::endl; drawerButton = new DrawerButton("name"); drawerButton->addListener(this); @@ -141,7 +141,7 @@ void GenericEditor::addParameterEditors(bool useDefaultParameterEditors=true) int maxX = 15; int maxY = 30; - std::cout << "Adding parameter editors." << std::endl; + // std::cout << "Adding parameter editors." << std::endl; for (int i = 0; i < getProcessor()->getNumParameters(); i++) { @@ -466,11 +466,11 @@ void GenericEditor::sliderValueChanged(Slider* slider) void GenericEditor::update() { - std::cout << "Editor for "; + //std::cout << "Editor for "; GenericProcessor* p = (GenericProcessor*) getProcessor(); - std::cout << p->getName() << " updating settings." << std::endl; + //std::cout << p->getName() << " updating settings." << std::endl; int numChannels; diff --git a/Source/Processors/FilterNode.cpp b/Source/Processors/FilterNode.cpp index 44c7346cd..4e1eb2e4d 100755 --- a/Source/Processors/FilterNode.cpp +++ b/Source/Processors/FilterNode.cpp @@ -61,7 +61,7 @@ AudioProcessorEditor* FilterNode::createEditor() FilterEditor* ed = (FilterEditor*) getEditor(); ed->setDefaults(defaultLowCut, defaultHighCut); - std::cout << "Creating editor." << std::endl; + //std::cout << "Creating editor." << std::endl; return editor; } diff --git a/Source/Processors/GenericProcessor.cpp b/Source/Processors/GenericProcessor.cpp index 462624f08..a6f03264e 100755 --- a/Source/Processors/GenericProcessor.cpp +++ b/Source/Processors/GenericProcessor.cpp @@ -288,7 +288,7 @@ void GenericProcessor::clearSettings() void GenericProcessor::update() { - std::cout << getName() << " updating settings." << std::endl; + //std::cout << getName() << " updating settings." << std::endl; // SO patched here to keep original channel names int oldNumChannels = channels.size(); diff --git a/Source/Processors/LfpDisplayNode.cpp b/Source/Processors/LfpDisplayNode.cpp index 4b5a3a122..cac9272fc 100755 --- a/Source/Processors/LfpDisplayNode.cpp +++ b/Source/Processors/LfpDisplayNode.cpp @@ -30,7 +30,7 @@ LfpDisplayNode::LfpDisplayNode() displayBufferIndex(0), displayGain(1), bufferLength(5.0f), abstractFifo(100), ttlState(0) { - std::cout << " LFPDisplayNodeConstructor" << std::endl; + //std::cout << " LFPDisplayNodeConstructor" << std::endl; displayBuffer = new AudioSampleBuffer(8, 100); eventBuffer = new MidiBuffer(); @@ -58,7 +58,7 @@ AudioProcessorEditor* LfpDisplayNode::createEditor() void LfpDisplayNode::updateSettings() { - std::cout << "Setting num inputs on LfpDisplayNode to " << getNumInputs() << std::endl; + // std::cout << "Setting num inputs on LfpDisplayNode to " << getNumInputs() << std::endl; } bool LfpDisplayNode::resizeBuffer() diff --git a/Source/Processors/ProcessorGraph.cpp b/Source/Processors/ProcessorGraph.cpp index 0da0f26e6..f4eaed345 100644 --- a/Source/Processors/ProcessorGraph.cpp +++ b/Source/Processors/ProcessorGraph.cpp @@ -113,7 +113,7 @@ void ProcessorGraph::createDefaultNodes() addConnection(AUDIO_NODE_ID, midiChannelIndex, RESAMPLING_NODE_ID, midiChannelIndex); - std::cout << "Default nodes created." << std::endl; + //std::cout << "Default nodes created." << std::endl; } @@ -137,6 +137,8 @@ void* ProcessorGraph::createNewProcessor(String& description, int id)//, processor->setNodeId(id); // identifier within processor graph std::cout << " Adding node to graph with ID number " << id << std::endl; + std::cout << std::endl; + std::cout << std::endl; processor->setUIComponent(getUIComponent()); // give access to important pointers diff --git a/Source/Processors/RecordNode.cpp b/Source/Processors/RecordNode.cpp index 924f04eee..fcf0a299b 100755 --- a/Source/Processors/RecordNode.cpp +++ b/Source/Processors/RecordNode.cpp @@ -128,13 +128,13 @@ void RecordNode::resetConnections() void RecordNode::filenameComponentChanged(FilenameComponent* fnc) { - std::cout << "Got a new file" << std::endl; + //std::cout << "Got a new file" << std::endl; dataDirectory = fnc->getCurrentFile(); - std::cout << "File name: " << dataDirectory.getFullPathName(); - if (dataDirectory.isDirectory()) - std::cout << " is a directory." << std::endl; - else - std::cout << " is NOT a directory." << std::endl; + // std::cout << "File name: " << dataDirectory.getFullPathName(); + // if (dataDirectory.isDirectory()) + // std::cout << " is a directory." << std::endl; + // else + // std::cout << " is NOT a directory." << std::endl; //createNewDirectory(); diff --git a/Source/Processors/Visualization/SpikeDisplayCanvas.cpp b/Source/Processors/Visualization/SpikeDisplayCanvas.cpp index 233dd4f61..1d2e9e840 100755 --- a/Source/Processors/Visualization/SpikeDisplayCanvas.cpp +++ b/Source/Processors/Visualization/SpikeDisplayCanvas.cpp @@ -79,7 +79,7 @@ void SpikeDisplayCanvas::endAnimation() void SpikeDisplayCanvas::update() { - std::cout << "Updating SpikeDisplayCanvas" << std::endl; + //std::cout << "Updating SpikeDisplayCanvas" << std::endl; int nPlots = processor->getNumElectrodes(); spikeDisplay->removePlots(); diff --git a/Source/UI/DataViewport.cpp b/Source/UI/DataViewport.cpp index 1e6425652..a0ec80c1c 100755 --- a/Source/UI/DataViewport.cpp +++ b/Source/UI/DataViewport.cpp @@ -74,7 +74,7 @@ int DataViewport::addTabToDataViewport(String name, Component* component, Generi editorArray.add(editor); - std::cout << "Adding tab with index " << tabIndex << std::endl; + // std::cout << "Adding tab with index " << tabIndex << std::endl; setCurrentTabIndex(tabArray.size()-1); diff --git a/Source/UI/EditorViewport.cpp b/Source/UI/EditorViewport.cpp index 4957e92fe..3534ae5db 100755 --- a/Source/UI/EditorViewport.cpp +++ b/Source/UI/EditorViewport.cpp @@ -245,7 +245,7 @@ void EditorViewport::itemDropped(const SourceDetails& dragSourceDetails) GenericEditor* activeEditor = (GenericEditor*) getProcessorGraph()->createNewProcessor(description, currentId);//, source, dest); - std::cout << "Active editor: " << activeEditor << std::endl; + //std::cout << "Active editor: " << activeEditor << std::endl; if (activeEditor != 0) { diff --git a/Source/UI/SignalChainManager.cpp b/Source/UI/SignalChainManager.cpp index e861afa90..546c0af27 100755 --- a/Source/UI/SignalChainManager.cpp +++ b/Source/UI/SignalChainManager.cpp @@ -168,13 +168,13 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, // Step 1: update the editor array if (action == ADD) { - std::cout << " Adding editor." << std::endl; + //std::cout << " Adding editor." << std::endl; editorArray.insert(insertionPoint, activeEditor); } else if (action == MOVE) { - std::cout << " Moving editors." << std::endl; + // std::cout << " Moving editors." << std::endl; if (insertionPoint < index) editorArray.move(index, insertionPoint); else if (insertionPoint > index) @@ -184,7 +184,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, else if (action == REMOVE) { - std::cout << " Removing editor." << std::endl; + // std::cout << " Removing editor." << std::endl; GenericProcessor* p = (GenericProcessor*) editorArray[index]->getProcessor(); @@ -209,7 +209,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, p->switchIO(0); if (p->getDestNode() != nullptr) { - std::cout << "Found an orphaned signal chain" << std::endl; + // std::cout << "Found an orphaned signal chain" << std::endl; p->getDestNode()->setSourceNode(nullptr); createNewTab(p->getDestNode()->getEditor()); } @@ -217,7 +217,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, p->switchIO(1); if (p->getDestNode() != nullptr) { - std::cout << "Found an orphaned signal chain" << std::endl; + // std::cout << "Found an orphaned signal chain" << std::endl; p->getDestNode()->setSourceNode(nullptr); createNewTab(p->getDestNode()->getEditor()); } @@ -238,7 +238,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, merger = (p2->isMerger() && p2->stillHasSource()); if (merger) { - std::cout << "We've got a merger!" << std::endl; + // std::cout << "We've got a merger!" << std::endl; //p2->switchIO(0); p2->setMergerSourceNode(p->getSourceNode()); MergerEditor* me = (MergerEditor*) editorArray[0]; @@ -266,7 +266,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, else { - std::cout << "Tab number " << t << std::endl; + // std::cout << "Tab number " << t << std::endl; removeTab(t); @@ -288,14 +288,14 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, else //no change { - std::cout << "Activating editor" << std::endl; + // std::cout << "Activating editor" << std::endl; } // Step 2: update connections if (action != ACTIVATE && action != UPDATE && editorArray.size() > 0) { - std::cout << "Updating connections." << std::endl; + // std::cout << "Updating connections." << std::endl; GenericProcessor* source = 0; GenericProcessor* dest = (GenericProcessor*) editorArray[0]->getProcessor(); @@ -319,7 +319,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, if (action != ACTIVATE && action != UPDATE) { - std::cout << "Checking for new tabs." << std::endl; + // std::cout << "Checking for new tabs." << std::endl; for (int n = 0; n < editorArray.size(); n++) { @@ -333,7 +333,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, { if (!p->isMerger()) { - std::cout << p->getName() << " has no source node. Creating a new tab." << std::endl; + // std::cout << p->getName() << " has no source node. Creating a new tab." << std::endl; createNewTab(editorArray[n]); } } @@ -351,7 +351,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, if (p->isMerger()) { - std::cout << "It's a merger!" << std::endl; + // std::cout << "It's a merger!" << std::endl; //createNewTab(editorArray[n]); } } @@ -364,13 +364,13 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, } editorArray.clear(); - std::cout << "Cleared editor array." << std::endl; + // std::cout << "Cleared editor array." << std::endl; GenericEditor* editorToAdd = activeEditor; while (editorToAdd != 0) { - std::cout << "Inserting " << editorToAdd->getName() << " at point 0." << std::endl; + // std::cout << "Inserting " << editorToAdd->getName() << " at point 0." << std::endl; editorArray.insert(0,editorToAdd); GenericProcessor* currentProcessor = (GenericProcessor*) editorToAdd->getProcessor(); @@ -378,7 +378,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, if (source != nullptr) { - std::cout << "Source: " << source->getName() << std::endl; + // std::cout << "Source: " << source->getName() << std::endl; // need to switch the splitter somehow if (action == ACTIVATE || action == UPDATE) @@ -398,7 +398,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, if (editorToAdd->tabNumber() >= 0 && editorToAdd->tabNumber() < signalChainArray.size()) signalChainArray[editorToAdd->tabNumber()]->setToggleState(true, false); - std::cout << "No source found." << std::endl; + // std::cout << "No source found." << std::endl; editorToAdd = 0; } @@ -415,14 +415,14 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, if (dest != 0) { - std::cout << "Destination: " << dest->getName() << std::endl; + // std::cout << "Destination: " << dest->getName() << std::endl; editorToAdd = (GenericEditor*) dest->getEditor(); editorArray.add(editorToAdd); - std::cout << "Inserting " << editorToAdd->getName() << " at the end." << std::endl; + // std::cout << "Inserting " << editorToAdd->getName() << " at the end." << std::endl; if (dest->isMerger()) { - std::cout << "It's a merger!" << std::endl; + // std::cout << "It's a merger!" << std::endl; editorToAdd->switchIO(0); @@ -434,7 +434,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, } else { - std::cout << "No dest found." << std::endl; + // std::cout << "No dest found." << std::endl; editorToAdd = 0; } @@ -484,10 +484,10 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, } } - if (enable) - std::cout << "Enabling node." << std::endl; - else - std::cout << "Not enabling node." << std::endl; + // if (enable) + // std::cout << "Enabling node." << std::endl; + // else + // std::cout << "Not enabling node." << std::endl; editorArray[n+1]->setEnabledState(enable); @@ -508,7 +508,7 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, if (action != ACTIVATE) { - std::cout << "Updating settings." << std::endl; + // std::cout << "Updating settings." << std::endl; Array<GenericProcessor*> splitters; @@ -547,6 +547,6 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, } - std::cout << "Finished adding new editor." << std::endl << std::endl << std::endl; + // std::cout << "Finished adding new editor." << std::endl << std::endl << std::endl; } diff --git a/Source/UI/UIComponent.cpp b/Source/UI/UIComponent.cpp index d3e3b4ae2..bb8d55487 100755 --- a/Source/UI/UIComponent.cpp +++ b/Source/UI/UIComponent.cpp @@ -32,7 +32,10 @@ UIComponent::UIComponent(MainWindow* mainWindow_, ProcessorGraph* pgraph, AudioC processorGraph->setUIComponent(this); infoLabel = new InfoLabel(); + std::cout << "Created info label." << std::endl; + graphViewer = new GraphViewer(); + std::cout << "Created graph viewer." << std::endl; dataViewport = new DataViewport(); addChildComponent(dataViewport); @@ -68,12 +71,12 @@ UIComponent::UIComponent(MainWindow* mainWindow_, ProcessorGraph* pgraph, AudioC setBounds(0,0,500,400); - std::cout << "Component width = " << getWidth() << std::endl; - std::cout << "Component height = " << getHeight() << std::endl; + // std::cout << "Component width = " << getWidth() << std::endl; + // std::cout << "Component height = " << getHeight() << std::endl; - std::cout << "UI component data viewport: " << dataViewport << std::endl; + // std::cout << "UI component data viewport: " << dataViewport << std::endl; - std::cout << "Finished UI stuff." << std::endl << std::endl << std::endl; + // std::cout << "Finished UI stuff." << std::endl << std::endl << std::endl; processorGraph->setUIComponent(this); -- GitLab