diff --git a/Source/MainWindow.cpp b/Source/MainWindow.cpp index fe84eeedca53b95f7c2a8932c3b02ac15475911f..c7e5165502193386d4f98134af6eff2a98c4bc14 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 533f7ce66e07fa260f50ed35880b2340c3b9c5f2..93f65bc6a47392fb57581489e955780abb113b04 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 49136a8d15478a337bee6c56e3b33b0e71f4591a..671fd2381a238681e3472b856422df262e2ff1ee 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 bff623d80de9ea53deace4c2657bb121eabce1bc..b503bdf64ad3bbd9d68dd60f9f256f672bf36581 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 de724f5d18d64e5e3eb0f111f5a3d1dec1919133..0b4470e4094a4145101358194da8b8268daf7af2 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 7590062cb7719808188a1fcfcde965afc0d6c68e..5e41dc348916317a6c2ffcef16e07ab13cc060db 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 44c7346cd4f3586228828bf4b7cc1c03e0a3a9d4..4e1eb2e4d002c526940f43654e5e060eb9de6bec 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 462624f08fa07d0b6d1b6d935509b0ac58ae32e4..a6f03264e393f9b9db4b6d23b07a3e1a20ad971e 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 4b5a3a12264addb0a9e9f9fb77c401fe56c2462a..cac9272fcde90d0dd1b6588acfffb8cb02347aff 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 0da0f26e6fae08f31021af1df32c042eb9e6066c..f4eaed34529cb32219190090428ae8e0bc9eaac1 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 924f04eee415ac669851340ddc7755bfbda6980d..fcf0a299b1d21fe9c41275901636b73736c530c5 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 233dd4f612aaf1564974817b6148f68c2522b737..1d2e9e8402fbad16c3807f8364adcfc96729de0c 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 1e6425652b82a3c6c56bba7cd1c41c806ca08a4a..a0ec80c1ce7fb5d4cf2fdb0edca1b8e8608663ac 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 4957e92fe56b08a3ebbfacc3a1b0e338796c5923..3534ae5db3eb71caebc381e39c84db8977b5688b 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 e861afa903363ce311222c5be3fb40b249ced287..546c0af27cf32abbcba51ede67d3aae45f635662 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 d3e3b4ae210a97fdd8d171cc1f8cffefe2403566..bb8d55487fd6a9a9ebce79301ca542a09437ba90 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);