From 5773f14bc6a6e022145baacad9a5a0d024d8f401 Mon Sep 17 00:00:00 2001 From: jsiegle <joshs@alleninstitute.org> Date: Tue, 23 Sep 2014 11:54:16 -0700 Subject: [PATCH] Turn MessageCenter into a processor --- Builds/Linux/Makefile | 18 ++- .../open-ephys.xcodeproj/project.pbxproj | 24 +-- Builds/VisualStudio2012/open-ephys.vcxproj | 8 +- .../open-ephys.vcxproj.filters | 18 ++- Source/AccessClass.h | 6 +- .../Editors/MessageCenterEditor.cpp | 147 ++++++++++++++++++ .../Processors/Editors/MessageCenterEditor.h | 97 ++++++++++++ Source/Processors/GenericProcessor.h | 3 +- Source/Processors/MessageCenter.cpp | 91 +++++++++++ Source/{UI => Processors}/MessageCenter.h | 36 +++-- Source/Processors/ProcessorGraph.cpp | 34 +++- Source/Processors/ProcessorGraph.h | 9 +- Source/UI/ControlPanel.cpp | 6 +- Source/UI/MessageCenter.cpp | 72 --------- Source/UI/UIComponent.cpp | 20 +-- Source/UI/UIComponent.h | 10 +- open-ephys.jucer | 11 +- 17 files changed, 465 insertions(+), 145 deletions(-) create mode 100644 Source/Processors/Editors/MessageCenterEditor.cpp create mode 100644 Source/Processors/Editors/MessageCenterEditor.h create mode 100644 Source/Processors/MessageCenter.cpp rename Source/{UI => Processors}/MessageCenter.h (58%) mode change 100755 => 100644 delete mode 100755 Source/UI/MessageCenter.cpp diff --git a/Builds/Linux/Makefile b/Builds/Linux/Makefile index 62ff8476e..c3ff82645 100644 --- a/Builds/Linux/Makefile +++ b/Builds/Linux/Makefile @@ -71,6 +71,7 @@ OBJECTS := \ $(OBJDIR)/RootFinder_239a995f.o \ $(OBJDIR)/State_22979684.o \ $(OBJDIR)/AudioComponent_521bd9c9.o \ + $(OBJDIR)/MessageCenter_23198f37.o \ $(OBJDIR)/SpikeSortBoxes_e42a3d04.o \ $(OBJDIR)/SpikeSorter_b8ed216c.o \ $(OBJDIR)/HDF5FileFormat_5dfd9ead.o \ @@ -106,6 +107,7 @@ OBJECTS := \ $(OBJDIR)/SpikeDetector_300d85e7.o \ $(OBJDIR)/AudioNode_94606ff3.o \ $(OBJDIR)/EventNode_95c842b7.o \ + $(OBJDIR)/MessageCenterEditor_49ca0c3b.o \ $(OBJDIR)/EcubeEditor_50eace99.o \ $(OBJDIR)/SpikeSorterEditor_30c3d470.o \ $(OBJDIR)/LfpTriggeredAverageEditor_101d75b.o \ @@ -164,7 +166,6 @@ OBJECTS := \ $(OBJDIR)/CustomLookAndFeel_53a8fcdb.o \ $(OBJDIR)/InfoLabel_a2051bf4.o \ $(OBJDIR)/DataViewport_2cf95d2c.o \ - $(OBJDIR)/MessageCenter_748a1cca.o \ $(OBJDIR)/ControlPanel_a895ede3.o \ $(OBJDIR)/UIComponent_d667ba37.o \ $(OBJDIR)/MainWindow_499ac812.o \ @@ -302,6 +303,11 @@ $(OBJDIR)/AudioComponent_521bd9c9.o: ../../Source/Audio/AudioComponent.cpp @echo "Compiling AudioComponent.cpp" @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/MessageCenter_23198f37.o: ../../Source/Processors/MessageCenter.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling MessageCenter.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/SpikeSortBoxes_e42a3d04.o: ../../Source/Processors/SpikeSortBoxes.cpp -@mkdir -p $(OBJDIR) @echo "Compiling SpikeSortBoxes.cpp" @@ -477,6 +483,11 @@ $(OBJDIR)/EventNode_95c842b7.o: ../../Source/Processors/EventNode.cpp @echo "Compiling EventNode.cpp" @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/MessageCenterEditor_49ca0c3b.o: ../../Source/Processors/Editors/MessageCenterEditor.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling MessageCenterEditor.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/EcubeEditor_50eace99.o: ../../Source/Processors/Editors/EcubeEditor.cpp -@mkdir -p $(OBJDIR) @echo "Compiling EcubeEditor.cpp" @@ -767,11 +778,6 @@ $(OBJDIR)/DataViewport_2cf95d2c.o: ../../Source/UI/DataViewport.cpp @echo "Compiling DataViewport.cpp" @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/MessageCenter_748a1cca.o: ../../Source/UI/MessageCenter.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling MessageCenter.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/ControlPanel_a895ede3.o: ../../Source/UI/ControlPanel.cpp -@mkdir -p $(OBJDIR) @echo "Compiling ControlPanel.cpp" diff --git a/Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj b/Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj index 1e1c0c581..fd401988c 100644 --- a/Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj @@ -41,6 +41,7 @@ AE06672D2CBF8F64465B2126 = {isa = PBXBuildFile; fileRef = 3F69480D6145C77992FA59BA; }; 69630D3ECA4D6014EE3734CD = {isa = PBXBuildFile; fileRef = C1CB526B75E406851FA918C6; }; 0AE243437B40602D35435C32 = {isa = PBXBuildFile; fileRef = B04D87ED6AA4897B6CD3CCF6; }; + E2AFA25339B1AD30AB988CFF = {isa = PBXBuildFile; fileRef = 134B78C7A8968E9FE4ED3522; }; A33C92B3D445EBC6C35E7ABA = {isa = PBXBuildFile; fileRef = 813CB9DFF788D612A0750FBF; }; 51CE31A091584E6CD064C72B = {isa = PBXBuildFile; fileRef = E08826E22402792833879355; }; 5B382D77C53D97FE3E35DE40 = {isa = PBXBuildFile; fileRef = BD8DA51AC4A1B20D6366A217; }; @@ -76,6 +77,7 @@ ED8CB527B27C67E9E4DA027C = {isa = PBXBuildFile; fileRef = BC3B7E4E25505D9044BFACC7; }; DE758AF46844DF951655966C = {isa = PBXBuildFile; fileRef = B27F558F42AC78F0E564B5AF; }; 80E5365461A5A7A32C48C563 = {isa = PBXBuildFile; fileRef = F94DD42C7BBF81C101D3F605; }; + 9F6BC1AC41473A25DA596C2D = {isa = PBXBuildFile; fileRef = AF93B61FB8DC1BCE6A98FB47; }; A005D7947A9FA8D2E73982C8 = {isa = PBXBuildFile; fileRef = B477BCF5AD76FBA478E4FA30; }; 96E000FFBED6B85F9DEB5494 = {isa = PBXBuildFile; fileRef = B8BDB9ED4D4E0D1882F94EE5; }; DD77A0AB68C932F294B753C2 = {isa = PBXBuildFile; fileRef = 7B7819A5759B54D91E334447; }; @@ -134,7 +136,6 @@ 9A80E3D1D1758A31D2169497 = {isa = PBXBuildFile; fileRef = 3774BBCA6CB133D9A854CF71; }; F4397EAE00E0B9F96C8B6C07 = {isa = PBXBuildFile; fileRef = 17E13CCDA0C82F92EAB05BE6; }; 09673DA3B4D6EA61DEFC0C46 = {isa = PBXBuildFile; fileRef = 47A3942AC30A3212C01F1CAF; }; - 591CED1277A8C945EF60841C = {isa = PBXBuildFile; fileRef = 7BD2C39F13FDE202141C4B41; }; 58D3FF3B1F462634167BDFB5 = {isa = PBXBuildFile; fileRef = 610E487E060C42B52FD5AAC9; }; 3162B66BC8118715AAA527D7 = {isa = PBXBuildFile; fileRef = D2A3B4CDD296B4CEC6902FD7; }; 004E78BC139419671A9EA137 = {isa = PBXBuildFile; fileRef = E08E877C3A6283CF5C803957; }; @@ -238,6 +239,7 @@ 12B5DDCB6E5ECD93A4C55BB5 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LfpDisplayCanvas.h; path = ../../Source/Processors/Visualization/LfpDisplayCanvas.h; sourceTree = "SOURCE_ROOT"; }; 1307DAE32BA702565A67D127 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MidiFile.cpp"; path = "../../JuceLibraryCode/modules/juce_audio_basics/midi/juce_MidiFile.cpp"; sourceTree = "SOURCE_ROOT"; }; 13212C01A5E138553FAFBE9C = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_Drawable.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_Drawable.cpp"; sourceTree = "SOURCE_ROOT"; }; + 134B78C7A8968E9FE4ED3522 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = MessageCenter.cpp; path = ../../Source/Processors/MessageCenter.cpp; sourceTree = "SOURCE_ROOT"; }; 13D9868B08E941F6827E157C = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ResizableWindow.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/windows/juce_ResizableWindow.h"; sourceTree = "SOURCE_ROOT"; }; 13D9DC48F19699485F9888A4 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_PathIterator.h"; path = "../../JuceLibraryCode/modules/juce_graphics/geometry/juce_PathIterator.h"; sourceTree = "SOURCE_ROOT"; }; 1463D2DAB3A1D8CEE825056A = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_AudioCDReader.h"; path = "../../JuceLibraryCode/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.h"; sourceTree = "SOURCE_ROOT"; }; @@ -277,6 +279,7 @@ 1989E86F8DFDE34887AC0326 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Bessel.cpp; path = ../../Source/Dsp/Bessel.cpp; sourceTree = "SOURCE_ROOT"; }; 19A8A8E1BF043B390E02C429 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_Messaging.cpp"; path = "../../JuceLibraryCode/modules/juce_events/native/juce_linux_Messaging.cpp"; sourceTree = "SOURCE_ROOT"; }; 19AB6653E818B409554C5606 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ScopedValueSetter.h"; path = "../../JuceLibraryCode/modules/juce_core/containers/juce_ScopedValueSetter.h"; sourceTree = "SOURCE_ROOT"; }; + 1A15A7A308BC26E433DC1AA0 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MessageCenter.h; path = ../../Source/Processors/MessageCenter.h; sourceTree = "SOURCE_ROOT"; }; 1A22BB28E65B6D6636CCEBF1 = {isa = PBXFileReference; lastKnownFileType = image.png; name = "RadioButtons_selected_over-02.png"; path = "../../Resources/Images/Icons/RadioButtons_selected_over-02.png"; sourceTree = "SOURCE_ROOT"; }; 1A5E3078685AC97ADC098693 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_JSON.cpp"; path = "../../JuceLibraryCode/modules/juce_core/javascript/juce_JSON.cpp"; sourceTree = "SOURCE_ROOT"; }; 1AD76E8111A738A8F3717060 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ArduinoOutputEditor.cpp; path = ../../Source/Processors/Editors/ArduinoOutputEditor.cpp; sourceTree = "SOURCE_ROOT"; }; @@ -713,7 +716,6 @@ 7B674BB1DA11A4E58EA71624 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_EdgeTable.cpp"; path = "../../JuceLibraryCode/modules/juce_graphics/geometry/juce_EdgeTable.cpp"; sourceTree = "SOURCE_ROOT"; }; 7B7819A5759B54D91E334447 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LfpTriggeredAverageEditor.cpp; path = ../../Source/Processors/Editors/LfpTriggeredAverageEditor.cpp; sourceTree = "SOURCE_ROOT"; }; 7BCE1C09508E1B9CFC79C185 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_CaretComponent.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp"; sourceTree = "SOURCE_ROOT"; }; - 7BD2C39F13FDE202141C4B41 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = MessageCenter.cpp; path = ../../Source/UI/MessageCenter.cpp; sourceTree = "SOURCE_ROOT"; }; 7BE7EBBCC4DCF760A1AA697E = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_DirectoryContentsList.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h"; sourceTree = "SOURCE_ROOT"; }; 7C0F2759385C66CAC3EC362D = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_win32_ActiveXComponent.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp"; sourceTree = "SOURCE_ROOT"; }; 7C15112E5F287ACDD74480F5 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_QuickTimeMovieComponent.h"; path = "../../JuceLibraryCode/modules/juce_video/playback/juce_QuickTimeMovieComponent.h"; sourceTree = "SOURCE_ROOT"; }; @@ -866,7 +868,6 @@ 9B178E9015CF469CFD41BC79 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_BufferedInputStream.cpp"; path = "../../JuceLibraryCode/modules/juce_core/streams/juce_BufferedInputStream.cpp"; sourceTree = "SOURCE_ROOT"; }; 9B4EA34E8F90B7CC77694B7E = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_DialogWindow.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/windows/juce_DialogWindow.h"; sourceTree = "SOURCE_ROOT"; }; 9B5D838CB6224E82C9B36AA3 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_android_Misc.cpp"; path = "../../JuceLibraryCode/modules/juce_core/native/juce_android_Misc.cpp"; sourceTree = "SOURCE_ROOT"; }; - 9B9EDDFA0AE4991BC7FC7263 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MessageCenter.h; path = ../../Source/UI/MessageCenter.h; sourceTree = "SOURCE_ROOT"; }; 9BC055494F9FEE3F90630541 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Channel.cpp; path = ../../Source/Processors/Channel.cpp; sourceTree = "SOURCE_ROOT"; }; 9BE34B4DECBF4EBFD27C9792 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_AudioIODeviceType.cpp"; path = "../../JuceLibraryCode/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp"; sourceTree = "SOURCE_ROOT"; }; 9C21DBFB38865E5AFE367C6F = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; @@ -962,6 +963,7 @@ AF7106E30ED950436CCEC712 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_freetype_Fonts.cpp"; path = "../../JuceLibraryCode/modules/juce_graphics/native/juce_freetype_Fonts.cpp"; sourceTree = "SOURCE_ROOT"; }; AF8ADA74003E96998A5E4404 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_Typeface.cpp"; path = "../../JuceLibraryCode/modules/juce_graphics/fonts/juce_Typeface.cpp"; sourceTree = "SOURCE_ROOT"; }; AF8B1228A9FDFA27E5F19011 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_StringRef.h"; path = "../../JuceLibraryCode/modules/juce_core/text/juce_StringRef.h"; sourceTree = "SOURCE_ROOT"; }; + AF93B61FB8DC1BCE6A98FB47 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = MessageCenterEditor.cpp; path = ../../Source/Processors/Editors/MessageCenterEditor.cpp; sourceTree = "SOURCE_ROOT"; }; AFB684CE06F9256324EE0B4C = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_FillType.cpp"; path = "../../JuceLibraryCode/modules/juce_graphics/colour/juce_FillType.cpp"; sourceTree = "SOURCE_ROOT"; }; AFBAE04615D379A18B133090 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = EcubeThread.cpp; path = ../../Source/Processors/DataThreads/EcubeThread.cpp; sourceTree = "SOURCE_ROOT"; }; AFE835E175F7159E1E7C6CC7 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_CharacterFunctions.cpp"; path = "../../JuceLibraryCode/modules/juce_core/text/juce_CharacterFunctions.cpp"; sourceTree = "SOURCE_ROOT"; }; @@ -1258,13 +1260,14 @@ EAB637B566FEBBDADA654262 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_VSTMidiEventList.h"; path = "../../JuceLibraryCode/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h"; sourceTree = "SOURCE_ROOT"; }; EAB6A66678B122C578B16445 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_HighResolutionTimer.h"; path = "../../JuceLibraryCode/modules/juce_core/threads/juce_HighResolutionTimer.h"; sourceTree = "SOURCE_ROOT"; }; EAC262A83CD2BEA14542AE89 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_StringPool.h"; path = "../../JuceLibraryCode/modules/juce_core/text/juce_StringPool.h"; sourceTree = "SOURCE_ROOT"; }; - EAC7A64301F0BF2C5E33A1F9 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_InterprocessConnectionServer.cpp"; path = "../../JuceLibraryCode/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp"; sourceTree = "SOURCE_ROOT"; }; + EAEA49B9394D802B79CA8164 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_StringPairArray.h"; path = "../../JuceLibraryCode/modules/juce_core/text/juce_StringPairArray.h"; sourceTree = "SOURCE_ROOT"; }; EC780F52ABBD7317A5CE2F33 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ChebyshevI.h; path = ../../Source/Dsp/ChebyshevI.h; sourceTree = "SOURCE_ROOT"; }; ECA6FDB1366BE7EC30F1539B = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SourceNode.cpp; path = ../../Source/Processors/SourceNode.cpp; sourceTree = "SOURCE_ROOT"; }; + F09FD6D9CA4997216ADBF54F = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataBuffer.h; path = ../../Source/Processors/DataThreads/DataBuffer.h; sourceTree = "SOURCE_ROOT"; }; F5A00ACFA3D76168F22F1205 = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 99E1BC08B886CFDD2CCFD462 = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "open-ephys.app"; sourceTree = "BUILT_PRODUCTS_DIR"; }; E8964C0BE264A55753BC6B7B = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_Midi.cpp"; path = "../../JuceLibraryCode/modules/juce_audio_devices/native/juce_linux_Midi.cpp"; sourceTree = "SOURCE_ROOT"; }; - EAEA49B9394D802B79CA8164 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_StringPairArray.h"; path = "../../JuceLibraryCode/modules/juce_core/text/juce_StringPairArray.h"; sourceTree = "SOURCE_ROOT"; }; + EAC7A64301F0BF2C5E33A1F9 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_InterprocessConnectionServer.cpp"; path = "../../JuceLibraryCode/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp"; sourceTree = "SOURCE_ROOT"; }; EB5F9A50EB53A57D6AE303C2 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_QuickTimeMovieComponent.mm"; path = "../../JuceLibraryCode/modules/juce_video/native/juce_mac_QuickTimeMovieComponent.mm"; sourceTree = "SOURCE_ROOT"; }; EBD8622EAEF10558809888B7 = {isa = PBXFileReference; lastKnownFileType = image.png; name = "RadioButtons_selected_over-01.png"; path = "../../Resources/Images/Icons/RadioButtons_selected_over-01.png"; sourceTree = "SOURCE_ROOT"; }; EC95A2CF4B33EA37DA5FC1AC = {isa = PBXFileReference; lastKnownFileType = file.ttf; name = nordic.ttf; path = ../../Resources/Fonts/nordic.ttf; sourceTree = "SOURCE_ROOT"; }; @@ -1288,7 +1291,6 @@ EF7B66764093D950724EFE70 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_OpenGLShaderProgram.h"; path = "../../JuceLibraryCode/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.h"; sourceTree = "SOURCE_ROOT"; }; EF8488936B3D3E9178C9099C = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PulsePalOutput.h; path = ../../Source/Processors/PulsePalOutput.h; sourceTree = "SOURCE_ROOT"; }; EFC21F3CD0EB87D67E044E06 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_MenuBarComponent.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/menus/juce_MenuBarComponent.h"; sourceTree = "SOURCE_ROOT"; }; - F09FD6D9CA4997216ADBF54F = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataBuffer.h; path = ../../Source/Processors/DataThreads/DataBuffer.h; sourceTree = "SOURCE_ROOT"; }; F0CA3600E09054D7DB3B0067 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SmoothedFilter.h; path = ../../Source/Dsp/SmoothedFilter.h; sourceTree = "SOURCE_ROOT"; }; F0D9A28C206D7A8BA7089D29 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_KeyMappingEditorComponent.h"; path = "../../JuceLibraryCode/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.h"; sourceTree = "SOURCE_ROOT"; }; F0F3834D46EA8FC8ADB206DB = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_AbstractFifo.cpp"; path = "../../JuceLibraryCode/modules/juce_core/containers/juce_AbstractFifo.cpp"; sourceTree = "SOURCE_ROOT"; }; @@ -1335,6 +1337,7 @@ FB7E91937D3BBE00F64F0B72 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Colours.h"; path = "../../JuceLibraryCode/modules/juce_graphics/colour/juce_Colours.h"; sourceTree = "SOURCE_ROOT"; }; FC080F7DF94ABCB7EA09224A = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_Colour.cpp"; path = "../../JuceLibraryCode/modules/juce_graphics/colour/juce_Colour.cpp"; sourceTree = "SOURCE_ROOT"; }; FC20BDD5357D39AC43DFC255 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_LADSPAPluginFormat.cpp"; path = "../../JuceLibraryCode/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp"; sourceTree = "SOURCE_ROOT"; }; + FC2BA910CAA5B8B6F48518E1 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MessageCenterEditor.h; path = ../../Source/Processors/Editors/MessageCenterEditor.h; sourceTree = "SOURCE_ROOT"; }; FC85D30C66E7A4E4A6CA29AE = {isa = PBXFileReference; lastKnownFileType = file.otf; name = "cpmono_bold.otf"; path = "../../Resources/Fonts/cpmono_bold.otf"; sourceTree = "SOURCE_ROOT"; }; FC887C6CD74FE33F8BA784A6 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MergerEditor.h; path = ../../Source/Processors/Editors/MergerEditor.h; sourceTree = "SOURCE_ROOT"; }; FD3A6BD3A8898E137DF257B9 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RelativeParallelogram.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.cpp"; sourceTree = "SOURCE_ROOT"; }; @@ -1495,6 +1498,8 @@ 4A94E809624F99387E600399, 12B5DDCB6E5ECD93A4C55BB5, ); name = Visualization; sourceTree = "<group>"; }; 9F16043BF599BCE0C02A00A5 = {isa = PBXGroup; children = ( + AF93B61FB8DC1BCE6A98FB47, + FC2BA910CAA5B8B6F48518E1, B477BCF5AD76FBA478E4FA30, B86153418B2ECB863398897F, B8BDB9ED4D4E0D1882F94EE5, @@ -1581,6 +1586,8 @@ 92602D7166325C7232B85EDD, 0287B009511521BEAAE8A52C, ); name = DataThreads; sourceTree = "<group>"; }; 83A3E005DDFCC55F277EEDA5 = {isa = PBXGroup; children = ( + 134B78C7A8968E9FE4ED3522, + 1A15A7A308BC26E433DC1AA0, 813CB9DFF788D612A0750FBF, 77D3770CCBB3EED01A854329, E08826E22402792833879355, @@ -1669,8 +1676,6 @@ D2696B30CBEAD7CE72510AFA, 47A3942AC30A3212C01F1CAF, 7D9374931D760ADC65DCBFC6, - 7BD2C39F13FDE202141C4B41, - 9B9EDDFA0AE4991BC7FC7263, 610E487E060C42B52FD5AAC9, 0FE8ACC50ED8E7FFC9E6B9B4, D2A3B4CDD296B4CEC6902FD7, @@ -2890,6 +2895,7 @@ AE06672D2CBF8F64465B2126, 69630D3ECA4D6014EE3734CD, 0AE243437B40602D35435C32, + E2AFA25339B1AD30AB988CFF, A33C92B3D445EBC6C35E7ABA, 51CE31A091584E6CD064C72B, 5B382D77C53D97FE3E35DE40, @@ -2925,6 +2931,7 @@ ED8CB527B27C67E9E4DA027C, DE758AF46844DF951655966C, 80E5365461A5A7A32C48C563, + 9F6BC1AC41473A25DA596C2D, A005D7947A9FA8D2E73982C8, 96E000FFBED6B85F9DEB5494, DD77A0AB68C932F294B753C2, @@ -2983,7 +2990,6 @@ 9A80E3D1D1758A31D2169497, F4397EAE00E0B9F96C8B6C07, 09673DA3B4D6EA61DEFC0C46, - 591CED1277A8C945EF60841C, 58D3FF3B1F462634167BDFB5, 3162B66BC8118715AAA527D7, 004E78BC139419671A9EA137, diff --git a/Builds/VisualStudio2012/open-ephys.vcxproj b/Builds/VisualStudio2012/open-ephys.vcxproj index 9cb8ddb36..e7b58dd5f 100644 --- a/Builds/VisualStudio2012/open-ephys.vcxproj +++ b/Builds/VisualStudio2012/open-ephys.vcxproj @@ -98,7 +98,7 @@ <ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName> <WarningLevel>Level4</WarningLevel> <SuppressStartupBanner>true</SuppressStartupBanner> - <MultiProcessorCompilation>false</MultiProcessorCompilation> + <MultiProcessorCompilation>true</MultiProcessorCompilation> </ClCompile> <ResourceCompile> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -283,6 +283,7 @@ <ClCompile Include="..\..\Source\Dsp\RootFinder.cpp"/> <ClCompile Include="..\..\Source\Dsp\State.cpp"/> <ClCompile Include="..\..\Source\Audio\AudioComponent.cpp"/> + <ClCompile Include="..\..\Source\Processors\MessageCenter.cpp"/> <ClCompile Include="..\..\Source\Processors\SpikeSortBoxes.cpp"/> <ClCompile Include="..\..\Source\Processors\SpikeSorter.cpp"/> <ClCompile Include="..\..\Source\Processors\HDF5FileFormat.cpp"/> @@ -318,6 +319,7 @@ <ClCompile Include="..\..\Source\Processors\SpikeDetector.cpp"/> <ClCompile Include="..\..\Source\Processors\AudioNode.cpp"/> <ClCompile Include="..\..\Source\Processors\EventNode.cpp"/> + <ClCompile Include="..\..\Source\Processors\Editors\MessageCenterEditor.cpp"/> <ClCompile Include="..\..\Source\Processors\Editors\EcubeEditor.cpp"/> <ClCompile Include="..\..\Source\Processors\Editors\SpikeSorterEditor.cpp"/> <ClCompile Include="..\..\Source\Processors\Editors\LfpTriggeredAverageEditor.cpp"/> @@ -376,7 +378,6 @@ <ClCompile Include="..\..\Source\UI\CustomLookAndFeel.cpp"/> <ClCompile Include="..\..\Source\UI\InfoLabel.cpp"/> <ClCompile Include="..\..\Source\UI\DataViewport.cpp"/> - <ClCompile Include="..\..\Source\UI\MessageCenter.cpp"/> <ClCompile Include="..\..\Source\UI\ControlPanel.cpp"/> <ClCompile Include="..\..\Source\UI\UIComponent.cpp"/> <ClCompile Include="..\..\Source\MainWindow.cpp"/> @@ -1531,6 +1532,7 @@ <ClInclude Include="..\..\Source\Dsp\Types.h"/> <ClInclude Include="..\..\Source\Dsp\Utilities.h"/> <ClInclude Include="..\..\Source\Audio\AudioComponent.h"/> + <ClInclude Include="..\..\Source\Processors\MessageCenter.h"/> <ClInclude Include="..\..\Source\Processors\SpikeSortBoxes.h"/> <ClInclude Include="..\..\Source\Processors\SpikeSorter.h"/> <ClInclude Include="..\..\Source\Processors\HDF5FileFormat.h"/> @@ -1568,6 +1570,7 @@ <ClInclude Include="..\..\Source\Processors\SpikeDetector.h"/> <ClInclude Include="..\..\Source\Processors\AudioNode.h"/> <ClInclude Include="..\..\Source\Processors\EventNode.h"/> + <ClInclude Include="..\..\Source\Processors\Editors\MessageCenterEditor.h"/> <ClInclude Include="..\..\Source\Processors\Editors\EcubeEditor.h"/> <ClInclude Include="..\..\Source\Processors\Editors\SpikeSorterEditor.h"/> <ClInclude Include="..\..\Source\Processors\Editors\LfpTriggeredAverageEditor.h"/> @@ -1626,7 +1629,6 @@ <ClInclude Include="..\..\Source\UI\CustomLookAndFeel.h"/> <ClInclude Include="..\..\Source\UI\InfoLabel.h"/> <ClInclude Include="..\..\Source\UI\DataViewport.h"/> - <ClInclude Include="..\..\Source\UI\MessageCenter.h"/> <ClInclude Include="..\..\Source\UI\ControlPanel.h"/> <ClInclude Include="..\..\Source\UI\UIComponent.h"/> <ClInclude Include="..\..\Source\MainWindow.h"/> diff --git a/Builds/VisualStudio2012/open-ephys.vcxproj.filters b/Builds/VisualStudio2012/open-ephys.vcxproj.filters index 458bd3a84..b03913695 100644 --- a/Builds/VisualStudio2012/open-ephys.vcxproj.filters +++ b/Builds/VisualStudio2012/open-ephys.vcxproj.filters @@ -415,6 +415,9 @@ <ClCompile Include="..\..\Source\Audio\AudioComponent.cpp"> <Filter>open-ephys\Source\Audio</Filter> </ClCompile> + <ClCompile Include="..\..\Source\Processors\MessageCenter.cpp"> + <Filter>open-ephys\Source\Processors</Filter> + </ClCompile> <ClCompile Include="..\..\Source\Processors\SpikeSortBoxes.cpp"> <Filter>open-ephys\Source\Processors</Filter> </ClCompile> @@ -520,6 +523,9 @@ <ClCompile Include="..\..\Source\Processors\EventNode.cpp"> <Filter>open-ephys\Source\Processors</Filter> </ClCompile> + <ClCompile Include="..\..\Source\Processors\Editors\MessageCenterEditor.cpp"> + <Filter>open-ephys\Source\Processors\Editors</Filter> + </ClCompile> <ClCompile Include="..\..\Source\Processors\Editors\EcubeEditor.cpp"> <Filter>open-ephys\Source\Processors\Editors</Filter> </ClCompile> @@ -694,9 +700,6 @@ <ClCompile Include="..\..\Source\UI\DataViewport.cpp"> <Filter>open-ephys\Source\UI</Filter> </ClCompile> - <ClCompile Include="..\..\Source\UI\MessageCenter.cpp"> - <Filter>open-ephys\Source\UI</Filter> - </ClCompile> <ClCompile Include="..\..\Source\UI\ControlPanel.cpp"> <Filter>open-ephys\Source\UI</Filter> </ClCompile> @@ -2016,6 +2019,9 @@ <ClInclude Include="..\..\Source\Audio\AudioComponent.h"> <Filter>open-ephys\Source\Audio</Filter> </ClInclude> + <ClInclude Include="..\..\Source\Processors\MessageCenter.h"> + <Filter>open-ephys\Source\Processors</Filter> + </ClInclude> <ClInclude Include="..\..\Source\Processors\SpikeSortBoxes.h"> <Filter>open-ephys\Source\Processors</Filter> </ClInclude> @@ -2127,6 +2133,9 @@ <ClInclude Include="..\..\Source\Processors\EventNode.h"> <Filter>open-ephys\Source\Processors</Filter> </ClInclude> + <ClInclude Include="..\..\Source\Processors\Editors\MessageCenterEditor.h"> + <Filter>open-ephys\Source\Processors\Editors</Filter> + </ClInclude> <ClInclude Include="..\..\Source\Processors\Editors\EcubeEditor.h"> <Filter>open-ephys\Source\Processors\Editors</Filter> </ClInclude> @@ -2301,9 +2310,6 @@ <ClInclude Include="..\..\Source\UI\DataViewport.h"> <Filter>open-ephys\Source\UI</Filter> </ClInclude> - <ClInclude Include="..\..\Source\UI\MessageCenter.h"> - <Filter>open-ephys\Source\UI</Filter> - </ClInclude> <ClInclude Include="..\..\Source\UI\ControlPanel.h"> <Filter>open-ephys\Source\UI</Filter> </ClInclude> diff --git a/Source/AccessClass.h b/Source/AccessClass.h index 303150e1a..efc2c1e29 100644 --- a/Source/AccessClass.h +++ b/Source/AccessClass.h @@ -31,7 +31,7 @@ class EditorViewport; class ProcessorList; class DataViewport; class ProcessorGraph; -class MessageCenter; +class MessageCenterEditor; class ControlPanel; class AudioComponent; class GraphViewer; @@ -102,7 +102,7 @@ public: } /** Returns a pointer to the application's MessageCenter. */ - MessageCenter* getMessageCenter() + MessageCenterEditor* getMessageCenter() { return mc; } @@ -133,7 +133,7 @@ private: DataViewport* dv; ProcessorGraph* pg; ControlPanel* cp; - MessageCenter* mc; + MessageCenterEditor* mc; AudioComponent* ac; GraphViewer* gv; diff --git a/Source/Processors/Editors/MessageCenterEditor.cpp b/Source/Processors/Editors/MessageCenterEditor.cpp new file mode 100644 index 000000000..df82482ad --- /dev/null +++ b/Source/Processors/Editors/MessageCenterEditor.cpp @@ -0,0 +1,147 @@ +/* + ------------------------------------------------------------------ + + This file is part of the Open Ephys GUI + Copyright (C) 2013 Open Ephys + + ------------------------------------------------------------------ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +*/ + +#include "MessageCenterEditor.h" + +MessageCenterEditor::MessageCenterEditor(MessageCenter* owner) : + AudioProcessorEditor(owner), + messageCenter(owner), + incomingBackground(Colours::grey.withAlpha(0.5f)), + outgoingBackground(Colours::grey.withAlpha(0.5f)) +{ + + incomingMessageDisplayArea = new Label("Message Display Area","No new messages."); + outgoingMessageDisplayArea = new Label("Message Display Area","Type a new message here."); + outgoingMessageDisplayArea->setEditable(true); + + addAndMakeVisible(incomingMessageDisplayArea); + addAndMakeVisible(outgoingMessageDisplayArea); + + sendMessageButton = new UtilityButton("Save", Font("Small Text", 0, Font::plain)); + sendMessageButton->addListener(this); + sendMessageButton->setTooltip("Send a message to be saved by the record node"); + addAndMakeVisible(sendMessageButton); + +} + +MessageCenterEditor::~MessageCenterEditor() +{ + +} + + +void MessageCenterEditor::buttonClicked(Button* button) +{ + messageCenter->setParameter(1,1); +} + +void MessageCenterEditor::labelTextChanged(Label* label) +{ + +} + +void MessageCenterEditor::timerCallback() +{ + +} + +bool MessageCenterEditor::keyPressed(const KeyPress& key) +{ + +} + +String MessageCenterEditor::getLabelString() +{ + return outgoingMessageDisplayArea->getText(); +} + + +void MessageCenterEditor::enable() +{ + //sendMessageButton->setVisible(true); +} + +void MessageCenterEditor::disable() +{ + //sendMessageButton->setVisible(false); +} + +void MessageCenterEditor::messageReceived(bool state) +{ + if (!state) + { + incomingMessageDisplayArea->setText("FAIL.", dontSendNotification); + } else { + incomingMessageDisplayArea->setText("SUCCESS!", dontSendNotification); + } +} + +void MessageCenterEditor::paint(Graphics& g) +{ + + g.setColour(Colour(58,58,58)); + + g.fillRect(0, 0, getWidth(), getHeight()); + + g.setColour(incomingBackground); + + g.fillRect(5, 5, getWidth()/2-5, getHeight()-10); + + g.setColour(outgoingBackground); + + g.fillRect(getWidth()/2+5, 5, getWidth()/2-60, getHeight()-10); + +} + +void MessageCenterEditor::resized() +{ + if (incomingMessageDisplayArea != 0) + incomingMessageDisplayArea->setBounds(5,0,getWidth()/2-5,getHeight()); + + if (outgoingMessageDisplayArea != 0) + outgoingMessageDisplayArea->setBounds(getWidth()/2+5,0,getWidth()/2-60, getHeight()); + + if (sendMessageButton != 0) + sendMessageButton->setBounds(getWidth()-50, 5, 45, getHeight()-10); +} + +void MessageCenterEditor::actionListenerCallback(const String& message) +{ + + incomingMessageDisplayArea->setText(message, dontSendNotification); + + incomingBackground = Colours::orange; + + repaint(); + +} + +void MessageCenterEditor::saveStateToXml(XmlElement* xml) +{ + +} + +void MessageCenterEditor::loadStateFromXml(XmlElement* xml) +{ + +} diff --git a/Source/Processors/Editors/MessageCenterEditor.h b/Source/Processors/Editors/MessageCenterEditor.h new file mode 100644 index 000000000..23991dd78 --- /dev/null +++ b/Source/Processors/Editors/MessageCenterEditor.h @@ -0,0 +1,97 @@ +/* + ------------------------------------------------------------------ + + This file is part of the Open Ephys GUI + Copyright (C) 2014 Open Ephys + + ------------------------------------------------------------------ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +*/ + +#ifndef MESSAGECENTEREDITOR_H_INCLUDED +#define MESSAGECENTEREDITOR_H_INCLUDED + +#include "../../../JuceLibraryCode/JuceHeader.h" +#include "../MessageCenter.h" +#include <stdio.h> + +/** + Holds the interface for adding events to the message queue + + @see MessageCenter + +*/ + +class MessageCenterEditor : public AudioProcessorEditor, + public Button::Listener, + public Label::Listener, + public AccessClass, + public Timer, + public ActionListener + +{ +public: + MessageCenterEditor(MessageCenter* owner); + ~MessageCenterEditor(); + + void paint(Graphics& g); + + bool keyPressed(const KeyPress& key); + + void resized(); + + void enable(); + void disable(); + + void messageReceived(bool state); + + void saveStateToXml(XmlElement* xml); + void loadStateFromXml(XmlElement* xml); + + String getLabelString(); + +private: + + void buttonClicked(Button* button); + void labelTextChanged(Label* slider); + void timerCallback(); + + bool isEnabled; + + /** Called when a new message is received. */ + void actionListenerCallback(const String& message); + + /** A JUCE label used to display message text. */ + ScopedPointer<Label> incomingMessageDisplayArea; + + /** A JUCE label used to display message text. */ + ScopedPointer<Label> outgoingMessageDisplayArea; + + /** A JUCE button used to send messages. */ + ScopedPointer<Button> sendMessageButton; + + MessageCenter* messageCenter; + + Colour incomingBackground; + Colour outgoingBackground; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MessageCenterEditor); + +}; + + + +#endif // MESSAGECENTEREDITOR_H_INCLUDED diff --git a/Source/Processors/GenericProcessor.h b/Source/Processors/GenericProcessor.h index 17878e5e2..b94e6380f 100755 --- a/Source/Processors/GenericProcessor.h +++ b/Source/Processors/GenericProcessor.h @@ -502,7 +502,8 @@ public: CONTINUOUS = 6, NETWORK = 7, EYE_POSITION = 8, - SERIAL = 9 + SERIAL = 9, + MESSAGE = 10 }; enum eventChannelTypes diff --git a/Source/Processors/MessageCenter.cpp b/Source/Processors/MessageCenter.cpp new file mode 100644 index 000000000..e1779abde --- /dev/null +++ b/Source/Processors/MessageCenter.cpp @@ -0,0 +1,91 @@ +/* + ------------------------------------------------------------------ + + This file is part of the Open Ephys GUI + Copyright (C) 2013 Open Ephys + + ------------------------------------------------------------------ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +*/ + +#include "MessageCenter.h" +#include "Editors/MessageCenterEditor.h" + +//--------------------------------------------------------------------- + +MessageCenter::MessageCenter() : + GenericProcessor("Message Center"), newEventAvailable(false), isRecording(false) +{ + + setPlayConfigDetails(0, // number of inputs + 0, // number of outputs + 44100.0, // sampleRate + 128); // blockSize + +} + +MessageCenter::~MessageCenter() +{ + +} + +AudioProcessorEditor* MessageCenter::createEditor() +{ + + messageCenterEditor = new MessageCenterEditor(this); + + return messageCenterEditor; + +} + +void MessageCenter::setParameter(int parameterIndex, float newValue) +{ + if (isRecording) + { + newEventAvailable = true; + messageCenterEditor->messageReceived(true); + } + else + { + messageCenterEditor->messageReceived(false); + } + +} + +void MessageCenter::process(AudioSampleBuffer& buffer, MidiBuffer& eventBuffer, int& nSamples) +{ + + if (newEventAvailable) + { + int numBytes = 0; + + String eventString = messageCenterEditor->getLabelString(); + + CharPointer_UTF8 data = eventString.toUTF8(); + + addEvent(eventBuffer, + MESSAGE, + 0, + 0, + 0, + data.length(), + (uint8*) data.getAddress()); + + newEventAvailable = false; + } + + +} diff --git a/Source/UI/MessageCenter.h b/Source/Processors/MessageCenter.h old mode 100755 new mode 100644 similarity index 58% rename from Source/UI/MessageCenter.h rename to Source/Processors/MessageCenter.h index e47d4d2d2..e31ddd80a --- a/Source/UI/MessageCenter.h +++ b/Source/Processors/MessageCenter.h @@ -26,6 +26,11 @@ #include "../../JuceLibraryCode/JuceHeader.h" +#include <stdio.h> + +#include "GenericProcessor.h" + +class MessageCenterEditor; /** @@ -37,30 +42,35 @@ */ -class MessageCenter : public Component, - public ActionListener +class MessageCenter : public GenericProcessor { public: MessageCenter(); ~MessageCenter(); - /** Draws the message center.*/ - void paint(Graphics& g); + /** Handle incoming data and decide which files and events to write to disk. */ + void process(AudioSampleBuffer& buffer, MidiBuffer& eventBuffer, int& nSamples); -private: + /** Called when new events arrive. */ + void setParameter(int parameterIndex, float newValue); + + /** Creates the MessageCenterEditor (located in the UI component). */ + AudioProcessorEditor* createEditor(); - /** A JUCE label used to display message text. */ - ScopedPointer<Label> messageDisplayArea; + /** A pointer to the Message Center editor. */ + ScopedPointer<MessageCenterEditor> messageCenterEditor; + + void startRecording() {isRecording = true;} + void stopRecording() {isRecording = false;} + +private: - /** Called when the boundaries of the MessageCenter are changed. */ - void resized(); + bool newEventAvailable; - /** Called when a new message is received. */ - void actionListenerCallback(const String& message); + bool isRecording; - /** The background color (changes to yellow when a new message arrives). */ - Colour messageBackground; + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MessageCenter); }; diff --git a/Source/Processors/ProcessorGraph.cpp b/Source/Processors/ProcessorGraph.cpp index 332429f77..199c3d1c4 100644 --- a/Source/Processors/ProcessorGraph.cpp +++ b/Source/Processors/ProcessorGraph.cpp @@ -48,6 +48,7 @@ #include "FPGAOutput.h" #include "PulsePalOutput.h" #include "SerialInput.h" +#include "MessageCenter.h" #include "Utilities/RecordControl.h" #include "Utilities/Splitter.h" #include "Utilities/Merger.h" @@ -64,8 +65,6 @@ ProcessorGraph::ProcessorGraph() : currentNodeId(100) 44100.0, // sampleRate 1024); // blockSize - createDefaultNodes(); - } ProcessorGraph::~ProcessorGraph() @@ -89,15 +88,20 @@ void ProcessorGraph::createDefaultNodes() AudioNode* an = new AudioNode(); an->setNodeId(AUDIO_NODE_ID); - // add audio resampling node -- resamples continuous signals to 44.1kHz AudioResamplingNode* arn = new AudioResamplingNode(); arn->setNodeId(RESAMPLING_NODE_ID); + // add message center + MessageCenter* msgCenter = new MessageCenter(); + msgCenter->setNodeId(MESSAGE_CENTER_ID); + addNode(on, OUTPUT_NODE_ID); addNode(recn, RECORD_NODE_ID); addNode(an, AUDIO_NODE_ID); addNode(arn, RESAMPLING_NODE_ID); + addNode(msgCenter, MESSAGE_CENTER_ID); + } void ProcessorGraph::updatePointers() @@ -105,6 +109,7 @@ void ProcessorGraph::updatePointers() getAudioNode()->setUIComponent(getUIComponent()); getAudioNode()->updateBufferSize(); getRecordNode()->setUIComponent(getUIComponent()); + getMessageCenter()->setUIComponent(getUIComponent()); } void* ProcessorGraph::createNewProcessor(String& description, int id)//, @@ -175,7 +180,8 @@ void ProcessorGraph::refreshColors() if (nodeId != OUTPUT_NODE_ID && nodeId != AUDIO_NODE_ID && nodeId != RECORD_NODE_ID && - nodeId != RESAMPLING_NODE_ID) + nodeId != RESAMPLING_NODE_ID && + nodeId != MESSAGE_CENTER_ID) { GenericProcessor* p =(GenericProcessor*) node->getProcessor(); GenericEditor* e = (GenericEditor*) p->getEditor(); @@ -198,7 +204,8 @@ void ProcessorGraph::restoreParameters() if (nodeId != OUTPUT_NODE_ID && nodeId != AUDIO_NODE_ID && nodeId != RECORD_NODE_ID && - nodeId != RESAMPLING_NODE_ID) + nodeId != RESAMPLING_NODE_ID && + nodeId != MESSAGE_CENTER_ID) { GenericProcessor* p =(GenericProcessor*) node->getProcessor(); p->loadFromXml(); @@ -221,7 +228,8 @@ Array<GenericProcessor*> ProcessorGraph::getListOfProcessors() if (nodeId != OUTPUT_NODE_ID && nodeId != AUDIO_NODE_ID && nodeId != RECORD_NODE_ID && - nodeId != RESAMPLING_NODE_ID) + nodeId != RESAMPLING_NODE_ID && + nodeId != MESSAGE_CENTER_ID) { GenericProcessor* p =(GenericProcessor*) node->getProcessor(); a.add(p); @@ -269,6 +277,9 @@ void ProcessorGraph::clearConnections() addConnection(AUDIO_NODE_ID, midiChannelIndex, RESAMPLING_NODE_ID, midiChannelIndex); + + addConnection(MESSAGE_CENTER_ID, midiChannelIndex, + RECORD_NODE_ID, midiChannelIndex); } @@ -740,7 +751,7 @@ bool ProcessorGraph::disableProcessors() for (int i = 0; i < getNumNodes(); i++) { Node* node = getNode(i); - if (node->nodeId != OUTPUT_NODE_ID) + if (node->nodeId != OUTPUT_NODE_ID && node->nodeId != MESSAGE_CENTER_ID) { GenericProcessor* p = (GenericProcessor*) node->getProcessor(); std::cout << "Disabling " << p->getName() << std::endl; @@ -806,3 +817,12 @@ RecordNode* ProcessorGraph::getRecordNode() return (RecordNode*) node->getProcessor(); } + + +MessageCenter* ProcessorGraph::getMessageCenter() +{ + + Node* node = getNodeForId(MESSAGE_CENTER_ID); + return (MessageCenter*) node->getProcessor(); + +} diff --git a/Source/Processors/ProcessorGraph.h b/Source/Processors/ProcessorGraph.h index 48919679b..69dca8444 100644 --- a/Source/Processors/ProcessorGraph.h +++ b/Source/Processors/ProcessorGraph.h @@ -31,6 +31,7 @@ class GenericProcessor; class RecordNode; class AudioNode; +class MessageCenter; class SignalChainTabButton; /** @@ -69,6 +70,7 @@ public: RecordNode* getRecordNode(); AudioNode* getAudioNode(); + MessageCenter* getMessageCenter(); void updateConnections(Array<SignalChainTabButton*, CriticalSection>); @@ -85,6 +87,8 @@ public: void refreshColors(); + void createDefaultNodes(); + private: int currentNodeId; @@ -94,11 +98,10 @@ private: RECORD_NODE_ID = 900, AUDIO_NODE_ID = 901, OUTPUT_NODE_ID = 902, - RESAMPLING_NODE_ID = 903 + RESAMPLING_NODE_ID = 903, + MESSAGE_CENTER_ID = 904 }; - void createDefaultNodes(); - void clearConnections(); void connectProcessors(GenericProcessor* source, GenericProcessor* dest); diff --git a/Source/UI/ControlPanel.cpp b/Source/UI/ControlPanel.cpp index 9bc02ccec..8d168a432 100755 --- a/Source/UI/ControlPanel.cpp +++ b/Source/UI/ControlPanel.cpp @@ -404,8 +404,8 @@ ControlPanel::ControlPanel(ProcessorGraph* graph_, AudioComponent* audio_) recordSelector = new ComboBox(); recordSelector->addListener(this); - recordSelector->addItem("Open Ephys", 1); - recordSelector->addItem("Kwik", 2); + recordSelector->addItem("Open Ephys",1); + recordSelector->addItem("Kwik",2); addChildComponent(recordSelector); newDirectoryButton = new UtilityButton("+", Font("Small Text", 15, Font::plain)); @@ -524,7 +524,7 @@ void ControlPanel::paint(Graphics& g) g.setColour(backgroundColour); g.fillRect(0,0,getWidth(),getHeight()); - if (:) + if (open) { createPaths(); g.setColour(Colours::black); diff --git a/Source/UI/MessageCenter.cpp b/Source/UI/MessageCenter.cpp deleted file mode 100755 index 5954d7375..000000000 --- a/Source/UI/MessageCenter.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - ------------------------------------------------------------------ - - This file is part of the Open Ephys GUI - Copyright (C) 2013 Open Ephys - - ------------------------------------------------------------------ - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -*/ - -#include "MessageCenter.h" - -//--------------------------------------------------------------------- - -MessageCenter::MessageCenter() : - messageBackground(Colours::grey.withAlpha(0.5f)) -{ - - messageDisplayArea = new Label("Message Display Area","No new messages."); - - addAndMakeVisible(messageDisplayArea); - -} - -MessageCenter::~MessageCenter() -{ - -} - -void MessageCenter::paint(Graphics& g) -{ - - g.setColour(Colour(58,58,58)); - - g.fillRect(0, 0, getWidth(), getHeight()); - - g.setColour(messageBackground); - - g.fillRect(5, 5, getWidth()-10, getHeight()-10); - -} - -void MessageCenter::resized() -{ - if (messageDisplayArea != 0) - messageDisplayArea->setBounds(5,0,getWidth(),getHeight()); - -} - -void MessageCenter::actionListenerCallback(const String& message) -{ - - messageDisplayArea->setText(message, dontSendNotification); - - messageBackground = Colours::orange; - - repaint(); - -} \ No newline at end of file diff --git a/Source/UI/UIComponent.cpp b/Source/UI/UIComponent.cpp index 5a8e90380..7fcdfb738 100755 --- a/Source/UI/UIComponent.cpp +++ b/Source/UI/UIComponent.cpp @@ -29,7 +29,11 @@ UIComponent::UIComponent(MainWindow* mainWindow_, ProcessorGraph* pgraph, AudioC { - processorGraph->setUIComponent(this); + processorGraph->createDefaultNodes(); + + messageCenterEditor = (MessageCenterEditor*) processorGraph->getMessageCenter()->createEditor(); + addActionListener(messageCenterEditor); + addAndMakeVisible(messageCenterEditor); infoLabel = new InfoLabel(); std::cout << "Created info label." << std::endl; @@ -66,16 +70,12 @@ UIComponent::UIComponent(MainWindow* mainWindow_, ProcessorGraph* pgraph, AudioC processorList->setBounds(0,0,195,processorList->getTotalHeight()); std::cout << "Created filter list." << std::endl; - messageCenter = new MessageCenter(); - addActionListener(messageCenter); - addAndMakeVisible(messageCenter); - std::cout << "Created message center." << std::endl; setBounds(0,0,500,400); - processorGraph->setUIComponent(this); + processorGraph->setUIComponent(this); // update pointers processorList->setUIComponent(this); editorViewport->setUIComponent(this); dataViewport->setUIComponent(this); @@ -227,11 +227,11 @@ void UIComponent::resized() - if (messageCenter != 0) + if (messageCenterEditor != 0) { - messageCenter->setBounds(6,h-35,w-241,30); + messageCenterEditor->setBounds(6,h-35,w-241,30); if (h < 200) - messageCenter->setBounds(6,h-35+200-h,w-241,30); + messageCenterEditor->setBounds(6,h-35+200-h,w-241,30); // else // messageCenter->setVisible(true); } @@ -242,7 +242,7 @@ void UIComponent::resized() dataViewport->setVisible(false); editorViewport->setVisible(false); processorList->setVisible(false); - messageCenter->setVisible(false); + messageCenterEditor->setVisible(false); controlPanel->setVisible(false); editorViewportButton->setVisible(false); } diff --git a/Source/UI/UIComponent.h b/Source/UI/UIComponent.h index 66caa4d1e..60e329dc0 100755 --- a/Source/UI/UIComponent.h +++ b/Source/UI/UIComponent.h @@ -30,7 +30,7 @@ #include "ProcessorList.h" #include "EditorViewport.h" #include "DataViewport.h" -#include "MessageCenter.h" +#include "../Processors/Editors/MessageCenterEditor.h" #include "GraphViewer.h" #include "../Processors/ProcessorGraph.h" #include "../Audio/AudioComponent.h" @@ -104,10 +104,10 @@ public: return controlPanel; } - /** Returns a pointer to the MessageCenter. */ - MessageCenter* getMessageCenter() + /** Returns a pointer to the MessageCenterEditor. */ + MessageCenterEditor* getMessageCenter() { - return messageCenter; + return messageCenterEditor; } /** Returns a pointer to the UIComponent. */ @@ -171,7 +171,7 @@ private: ScopedPointer<EditorViewportButton> editorViewportButton; ScopedPointer<ProcessorList> processorList; ScopedPointer<ControlPanel> controlPanel; - ScopedPointer<MessageCenter> messageCenter; + MessageCenterEditor* messageCenterEditor; // owned by ProcessorGraph ScopedPointer<InfoLabel> infoLabel; ScopedPointer<GraphViewer> graphViewer; diff --git a/open-ephys.jucer b/open-ephys.jucer index 979466626..4ef175436 100644 --- a/open-ephys.jucer +++ b/open-ephys.jucer @@ -284,6 +284,9 @@ file="Source/Audio/AudioComponent.h"/> </GROUP> <GROUP id="yQmqZWk" name="Processors"> + <FILE id="nmfwUk" name="MessageCenter.cpp" compile="1" resource="0" + file="Source/Processors/MessageCenter.cpp"/> + <FILE id="VwMPDq" name="MessageCenter.h" compile="0" resource="0" file="Source/Processors/MessageCenter.h"/> <FILE id="jee5nL" name="SpikeSortBoxes.cpp" compile="1" resource="0" file="Source/Processors/SpikeSortBoxes.cpp"/> <FILE id="PEC3sP" name="SpikeSortBoxes.h" compile="0" resource="0" @@ -399,6 +402,10 @@ <FILE id="hGnGAjh" name="EventNode.cpp" compile="1" resource="0" file="Source/Processors/EventNode.cpp"/> <FILE id="dUtRN6" name="EventNode.h" compile="0" resource="0" file="Source/Processors/EventNode.h"/> <GROUP id="AqvwO6w" name="Editors"> + <FILE id="nqzTN6" name="MessageCenterEditor.cpp" compile="1" resource="0" + file="Source/Processors/Editors/MessageCenterEditor.cpp"/> + <FILE id="VwMdbB" name="MessageCenterEditor.h" compile="0" resource="0" + file="Source/Processors/Editors/MessageCenterEditor.h"/> <FILE id="K24HnQ" name="EcubeEditor.cpp" compile="1" resource="0" file="Source/Processors/Editors/EcubeEditor.cpp"/> <FILE id="lLjRJj" name="EcubeEditor.h" compile="0" resource="0" file="Source/Processors/Editors/EcubeEditor.h"/> <FILE id="Fs9xVR" name="SpikeSorterEditor.cpp" compile="1" resource="0" @@ -611,10 +618,6 @@ <FILE id="bWElQSS" name="DataViewport.cpp" compile="1" resource="0" file="Source/UI/DataViewport.cpp"/> <FILE id="mMoQ3ls" name="DataViewport.h" compile="0" resource="0" file="Source/UI/DataViewport.h"/> - <FILE id="rRa3X6v" name="MessageCenter.cpp" compile="1" resource="0" - file="Source/UI/MessageCenter.cpp"/> - <FILE id="Gwnvgdy" name="MessageCenter.h" compile="0" resource="0" - file="Source/UI/MessageCenter.h"/> <FILE id="we1JIPz" name="ControlPanel.cpp" compile="1" resource="0" file="Source/UI/ControlPanel.cpp"/> <FILE id="rCft9Ec" name="ControlPanel.h" compile="0" resource="0" file="Source/UI/ControlPanel.h"/> -- GitLab