Skip to content
Snippets Groups Projects
Commit 207c411e authored by Adam Mokhtari's avatar Adam Mokhtari
Browse files

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

parents 4a4cb7ab 39bc9db5
No related branches found
No related tags found
No related merge requests found
Showing
with 1537 additions and 1034 deletions
......@@ -6,7 +6,7 @@
# 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"
......@@ -14,7 +14,7 @@ SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6010", MODE
# 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"
......
This diff is collapsed.
This diff is collapsed.
......@@ -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 @@ public:
*/
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,7 +107,22 @@ public:
{
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);
}
}
}
}
......@@ -115,7 +130,25 @@ public:
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 @@ public:
void process (AudioSampleBuffer &buffer, MidiBuffer &midiMessages, int& nSamples);
void setParameter (int parameterIndex, float newValue);
//AudioProcessorEditor* createEditor();
bool hasEditor() const {return false;}
private:
float threshold;
......
/*
------------------------------------------------------------------
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;
// }
//
//
// }
}
/*
------------------------------------------------------------------
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 @@ public:
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;
......
......@@ -369,7 +369,19 @@ String RecordNode::generateHeader(Channel* ch)
{
String header = "header.format = 'OPEN EPHYS DATA FORMAT v0.0'; \n";
header += "header.description = 'each record contains one 64-bit timestamp, one 16-bit sample count (N), and N 16-bit samples'; \n";
header += "header.header_bytes = ";
header += String(HEADER_SIZE);
header += ";\n";
if (ch->isEventChannel)
{
header += "header.description = 'each record contains one 64-bit timestamp, one 16-bit sample position, one uint8 event type, one uint8 processor ID, one uint8 event ID, and one uint8 event channel'; \n";
} else {
header += "header.description = 'each record contains one 64-bit timestamp, one 16-bit sample count (N), N 16-bit samples, and one 10-byte record marker (0 0 0 0 0 0 0 0 0 255)'; \n";
}
header += "header.date_created = '";
header += generateDateString();
......@@ -388,9 +400,9 @@ String RecordNode::generateHeader(Channel* ch)
header += "header.channelType = 'Continuous';\n";
header += "header.sampleRate = '";
header += "header.sampleRate = ";
header += String(ch->sampleRate);
header += "';\n";
header += ";\n";
}
header += "header.bitVolts = ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment