Permalink
Browse files

Merge branch 'master' of https://github.com/open-ephys/GUI

  • Loading branch information...
2 parents 4a4cb7a + 39bc9db commit 207c411e21290baebe307f6bdbcc97310b644629 @akmokhtari akmokhtari committed Dec 16, 2012
@@ -6,15 +6,15 @@
# For FedoraCore 5 and similar:
# Change permissions for Opal Kelly FPGAs
-SUBSYSTEM=="usb_device", SYSFS{idVendor}=="151f", MODE="0666"
+SUBSYSTEM=="usb_device", SYSFS{idVendor}=="151f", MODE:="0666"
# Change permissions for the Intan Development Board:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6010", MODE:="0666"
# For FedoraCore 7 and similar:
# Change permissions for Opal Kelly FPGAs
-SUBSYSTEM=="usb", ATTRS{idVendor}=="151f", MODE="0666"
+SUBSYSTEM=="usb", ATTRS{idVendor}=="151f", MODE:="0666"
# Change permissions for the Intan Development Board:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE:="0666"
Oops, something went wrong.
Oops, something went wrong.
@@ -10,8 +10,8 @@
*/
-#ifndef __APPHEADERFILE_DFAE8F6C__
-#define __APPHEADERFILE_DFAE8F6C__
+#ifndef __APPHEADERFILE_F0B475A7__
+#define __APPHEADERFILE_F0B475A7__
#include "AppConfig.h"
#include "juce_amalgamated.h"
@@ -24,4 +24,4 @@ namespace ProjectInfo
const int versionNumber = 0x0;
}
-#endif // __APPHEADERFILE_DFAE8F6C__
+#endif // __APPHEADERFILE_F0B475A7__
@@ -20,7 +20,7 @@ ifeq ($(CONFIG),Debug)
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "/usr/include" -I "/usr/include/freetype2"
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0
CXXFLAGS += $(CFLAGS)
- LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -L"/usr/X11R6/lib/" -L"../../../../JuceLibraryCode/bin" -lfreetype -lpthread -lrt -lX11 -lGL -lGLU -lXinerama -lasound
+ LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -L"/usr/X11R6/lib/" -L"../../../../JuceLibraryCode/bin" -lfreetype -lpthread -lrt -lX11 -lGL -lGLU -lXinerama -lasound -lXext
LDDEPS :=
RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "/usr/include" -I "/usr/include/freetype2"
TARGET := Jucer
@@ -145,10 +145,17 @@ class JUCE_API SystemStats
*/
static int getPageSize();
+ /** Returns an environment variable.
+ If the named value isn't set, this will return the defaultValue string instead.
+ */
+ static String getEnvironmentVariable (const String& name, const String& defaultValue);
+
//==============================================================================
// not-for-public-use platform-specific method gets called at startup to initialise things.
static void initialiseStats();
+
+
private:
struct CPUFlags
{
@@ -557,6 +557,14 @@ const String juce_getOutputFromCommand (const String& command)
return result;
}
+//=============================================================================
+String SystemStats::getEnvironmentVariable (const String& name, const String& defaultValue)
+{
+ if (const char* s = ::getenv (name.toUTF8()))
+ return String::fromUTF8 (s);
+
+ return defaultValue;
+}
//==============================================================================
class InterProcessLock::Pimpl
@@ -107,15 +107,48 @@ class LinuxFontFileIterator
{
forEachXmlChildElementWithTagName (*fontsInfo, e, "dir")
{
- fontDirs.add (e->getAllSubText().trim());
+ String fontPath (e->getAllSubText().trim());
+
+ if (fontPath.isNotEmpty())
+ {
+ if (e->getStringAttribute ("prefix") == "xdg")
+ {
+ String xdgDataHome = (SystemStats::getEnvironmentVariable ("XDG_DATA_HOME", String::empty));
+
+ if (xdgDataHome.trimStart().isEmpty())
+ xdgDataHome = "~/.local/share";
+
+ fontPath = File (xdgDataHome).getChildFile (fontPath).getFullPathName();
+ }
+
+ fontDirs.add (fontPath);
+ }
}
}
}
if (fontDirs.size() == 0)
fontDirs.add ("/usr/X11R6/lib/X11/fonts");
- fontDirs.removeEmptyStrings (true);
+ fontDirs.removeDuplicates (false);
+
+ // if (fontDirs.size() == 0)
+ // {
+ // const ScopedPointer<XmlElement> fontsInfo (XmlDocument::parse (File ("/etc/fonts/fonts.conf")));
+
+ // if (fontsInfo != 0)
+ // {
+ // forEachXmlChildElementWithTagName (*fontsInfo, e, "dir")
+ // {
+ // fontDirs.add (e->getAllSubText().trim());
+ // }
+ // }
+ // }
+
+ // if (fontDirs.size() == 0)
+ // fontDirs.add ("/usr/X11R6/lib/X11/fonts");
+
+ // fontDirs.removeEmptyStrings (true);
}
bool next()
@@ -357,5 +357,19 @@ const String SystemStats::getFullUserName()
return getLogonName();
}
+String SystemStats::getEnvironmentVariable (const String& name, const String& defaultValue)
+{
+ DWORD len = GetEnvironmentVariableW (name.toWideCharPointer(), 0, 0);
+ if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
+ return String (defaultValue);
+
+ HeapBlock<WCHAR> buffer (len);
+ len = GetEnvironmentVariableW (name.toWideCharPointer(), buffer, len);
+
+ return String (CharPointer_wchar_t (buffer),
+ CharPointer_wchar_t (buffer + len));
+}
+
+
#endif
@@ -41,16 +41,6 @@ EventDetector::~EventDetector()
}
-// AudioProcessorEditor* EventDetector::createEditor()
-// {
-// editor = new EventDetectorEditor(this);
-// //setEditor(filterEditor);
-
-// std::cout << "Creating editor." << std::endl;
-
-// return editor;
-// }
-
void EventDetector::setParameter (int parameterIndex, float newValue)
@@ -35,7 +35,7 @@
Searches for threshold crossings and sends out TTL events.
- @see GenericProcessor, EventDetectorEditor
+ @see GenericProcessor
*/
@@ -50,10 +50,6 @@ class EventDetector : public GenericProcessor
void process (AudioSampleBuffer &buffer, MidiBuffer &midiMessages, int& nSamples);
void setParameter (int parameterIndex, float newValue);
- //AudioProcessorEditor* createEditor();
-
- bool hasEditor() const {return false;}
-
private:
float threshold;
@@ -0,0 +1,81 @@
+/*
+ ------------------------------------------------------------------
+
+ This file is part of the Open Ephys GUI
+ Copyright (C) 2012 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 <stdio.h>
+#include "ExampleProcessor.h"
+
+ExampleProcessor::ExampleProcessor()
+ : GenericProcessor("Example Processor") //, threshold(200.0), state(true)
+
+{
+
+ //parameters.add(Parameter("thresh", 0.0, 500.0, 200.0, 0));
+
+}
+
+ExampleProcessor::~ExampleProcessor()
+{
+
+}
+
+
+
+void ExampleProcessor::setParameter (int parameterIndex, float newValue)
+{
+
+ //Parameter& p = parameters.getReference(parameterIndex);
+ //p.setValue(newValue, 0);
+
+ //threshold = newValue;
+
+ //std::cout << float(p[0]) << std::endl;
+
+}
+
+void ExampleProcessor::process(AudioSampleBuffer &buffer,
+ MidiBuffer &events,
+ int& nSamples)
+{
+
+ // for (int i = 0; i < nSamples; i++)
+ // {
+ //
+ // if ((*buffer.getSampleData(0, i) < -threshold) && !state)
+ // {
+ //
+ // // generate midi event
+ // addEvent(events, TTL, i);
+ //
+ // state = true;
+ //
+ // } else if ((*buffer.getSampleData(0, i) > -threshold + bufferZone) && state)
+ // {
+ // state = false;
+ // }
+ //
+ //
+ // }
+
+
+}
@@ -0,0 +1,93 @@
+/*
+ ------------------------------------------------------------------
+
+ This file is part of the Open Ephys GUI
+ Copyright (C) 2012 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 __EXAMPLEPROCESSOR_H_91811542__
+#define __EXAMPLEPROCESSOR_H_91811542__
+
+#ifdef _WIN32
+#include <Windows.h>
+#endif
+
+#include "../../JuceLibraryCode/JuceHeader.h"
+#include "GenericProcessor.h"
+
+/**
+
+ This is a description of the processor's function.
+
+ @see GenericProcessor
+
+*/
+
+class ExampleProcessor : public GenericProcessor
+
+{
+public:
+
+ /** The class constructor, used to initialize any members. */
+ ExampleProcessor();
+
+ /** The class destructor, used to deallocate memory */
+ ~ExampleProcessor();
+
+ /** Determines whether the processor is treated as a source.
+ Re-implemented from GenericProcessor.h */
+ bool isSource() {return false;}
+
+ /** Determines whether the processor is treated as a sink.
+ Re-implemented from GenericProcessor.h */
+ bool isSink() {return false;}
+
+ /** Defines the functionality of the processor.
+
+ The process method is called every time a new data buffer is available.
+
+ Processors can either use this method to add new data, manipulate existing
+ data, or send data to an external target (such as a display or other hardware).
+
+ Continuous signals arrive in the "buffer" variable, event data (such as TTLs
+ and spikes) is contained in the "events" variable, and "nSamples" holds the
+ number of continous samples in the current buffer (which may differ from the
+ size of the buffer).
+ */
+ void process (AudioSampleBuffer &buffer, MidiBuffer &events, int& nSamples);
+
+ /** Any variables used by the "process" function _must_ be modified only through
+ this method while data acquisition is active. If they are modified in any
+ other way, the application will crash. */
+ void setParameter (int parameterIndex, float newValue);
+
+private:
+
+ // private members and methods go here
+ //
+ // e.g.:
+ //
+ // float threshold;
+ // bool state;
+
+ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ExampleProcessor);
+
+};
+
+#endif // __EXAMPLEPROCESSOR_H_91811542__
@@ -77,7 +77,7 @@ class GenericProcessor : public AudioProcessor,
virtual void setParameter (int parameterIndex, float newValue);
virtual AudioProcessorEditor* createEditor();
- bool hasEditor() const {return true;}
+ bool hasEditor() const {return false;}
void reset() {}
void setCurrentProgramStateInformation(const void* data, int sizeInBytes) {}
@@ -123,7 +123,7 @@ void PhaseDetector::process(AudioSampleBuffer &buffer,
numPeakIntervals++;
// entering falling phase (just reached peak)
- if (canBeTriggered)
+ if (true)
addEvent(events, TTL, i, 1, 3);
peakIntervals[numPeakIntervals % NUM_INTERVALS] = nSamplesSinceLastPeak;
Oops, something went wrong.

0 comments on commit 207c411

Please sign in to comment.