Skip to content
Snippets Groups Projects
Commit a37ed466 authored by jsiegle's avatar jsiegle
Browse files

Added Channel class

parent 770c5ee0
Branches
Tags
No related merge requests found
/*
------------------------------------------------------------------
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 "Channel.h"
Channel::Channel(GenericProcessor* p, int n) :
processor(p), num(n),
isEventChannel(false), isEnabled(true), isRecording(false), isMonitored(false),
sampleRate(44100.0f), bitVolts(1.0f)
{
createDefaultName();
}
String Channel::getName()
{
return name;
}
void Channel::reset()
{
createDefaultName();
sampleRate = 44100.0f;
bitVolts = 1.0f;
}
void Channel::createDefaultName()
{
name = String("Channel ");
name += n;
}
\ No newline at end of file
/*
------------------------------------------------------------------
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 __CHANNEL_H_DABDFE3F__
#define __CHANNEL_H_DABDFE3F__
#ifdef WIN32
#include <Windows.h>
#endif
#include "../../JuceLibraryCode/JuceHeader.h"
#include "GenericProcessor.h"
#include <stdio.h>
/**
Holds metadata about a given channel within a processor.
@see GenericProcessor, RecordNode, AudioNode
*/
class Channel
{
public:
Channel(GenericProcessor* p, int n);
String getName();
void reset();
// channel number:
int num;
// boolean values:
bool isEventChannel;
bool isRecording;
bool isMonitored;
bool isEnabled;
// pointer to parent processor:
GenericProcessor* processor;
// crucial information:
float sampleRate;
float bitVolts;
private:
String name;
void createDefaultName();
};
#endif // __CHANNEL_H_DABDFE3F__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment