Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
81648f71
Commit
81648f71
authored
9 years ago
by
Aaron Cuevas Lopez
Browse files
Options
Downloads
Plain Diff
Merge branch 'sept-en-filereader_Adjustments' into development
parents
fe3f24e4
0da0e0ed
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/FileReader/FileSource.cpp
+44
-22
44 additions, 22 deletions
Source/Processors/FileReader/FileSource.cpp
Source/Processors/FileReader/FileSource.h
+27
-23
27 additions, 23 deletions
Source/Processors/FileReader/FileSource.h
with
71 additions
and
45 deletions
Source/Processors/FileReader/FileSource.cpp
+
44
−
22
View file @
81648f71
...
...
@@ -23,92 +23,113 @@
#include
"FileSource.h"
FileSource
::
FileSource
()
:
fileOpened
(
false
),
numRecords
(
0
),
activeRecord
(
-
1
)
FileSource
::
FileSource
()
:
fileOpened
(
false
)
,
numRecords
(
0
)
,
activeRecord
(
-
1
)
,
filename
(
""
)
{
}
FileSource
::~
FileSource
()
{
}
int
FileSource
::
getNumRecords
()
int
FileSource
::
getNumRecords
()
const
{
return
numRecords
;
}
String
FileSource
::
getRecordName
(
int
index
)
String
FileSource
::
getRecordName
(
int
index
)
const
{
return
infoArray
[
index
].
name
;
}
int
FileSource
::
getRecordNumChannels
(
int
index
)
int
FileSource
::
getRecordNumChannels
(
int
index
)
const
{
return
infoArray
[
index
].
channels
.
size
();
}
int
FileSource
::
getActiveNumChannels
()
int
FileSource
::
getActiveNumChannels
()
const
{
return
getRecordNumChannels
(
activeRecord
);
return
getRecordNumChannels
(
activeRecord
);
}
float
FileSource
::
getRecordSampleRate
(
int
index
)
float
FileSource
::
getRecordSampleRate
(
int
index
)
const
{
return
infoArray
[
index
].
sampleRate
;
}
float
FileSource
::
getActiveSampleRate
()
float
FileSource
::
getActiveSampleRate
()
const
{
return
getRecordSampleRate
(
activeRecord
);
return
getRecordSampleRate
(
activeRecord
);
}
int64
FileSource
::
getRecordNumSamples
(
int
index
)
int64
FileSource
::
getRecordNumSamples
(
int
index
)
const
{
return
infoArray
[
index
].
numSamples
;
}
int64
FileSource
::
getActiveNumSamples
()
int64
FileSource
::
getActiveNumSamples
()
const
{
return
getRecordNumSamples
(
activeRecord
);
return
getRecordNumSamples
(
activeRecord
);
}
int
FileSource
::
getActiveRecord
()
int
FileSource
::
getActiveRecord
()
const
{
return
activeRecord
;
}
RecordedChannelInfo
FileSource
::
getChannelInfo
(
int
recordIndex
,
int
channel
)
RecordedChannelInfo
FileSource
::
getChannelInfo
(
int
recordIndex
,
int
channel
)
const
{
return
infoArray
[
recordIndex
].
channels
[
channel
];
}
RecordedChannelInfo
FileSource
::
getChannelInfo
(
int
channel
)
RecordedChannelInfo
FileSource
::
getChannelInfo
(
int
channel
)
const
{
return
getChannelInfo
(
activeRecord
,
channel
);
return
getChannelInfo
(
activeRecord
,
channel
);
}
void
FileSource
::
setActiveRecord
(
int
index
)
void
FileSource
::
setActiveRecord
(
int
index
)
{
activeRecord
=
index
;
updateActiveRecord
();
}
bool
FileSource
::
fileIsOpened
()
bool
FileSource
::
isFileOpened
()
const
{
return
fileOpened
;
}
String
FileSource
::
getFileName
()
String
FileSource
::
getFileName
()
const
{
return
filename
;
}
bool
FileSource
::
OpenFile
(
File
file
)
bool
FileSource
::
OpenFile
(
File
file
)
{
if
(
Open
(
file
))
if
(
Open
(
file
))
{
fileOpened
=
true
;
fillRecordInfo
();
filename
=
file
.
getFullPathName
();
}
else
...
...
@@ -116,5 +137,6 @@ bool FileSource::OpenFile(File file)
fileOpened
=
false
;
filename
=
String
::
empty
;
}
return
fileOpened
;
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Source/Processors/FileReader/FileSource.h
+
27
−
23
View file @
81648f71
...
...
@@ -27,42 +27,46 @@
#include
"../../../JuceLibraryCode/JuceHeader.h"
#include
"../PluginManager/OpenEphysPlugin.h"
struct
RecordedChannelInfo
{
String
name
;
float
bitVolts
;
};
class
PLUGIN_API
FileSource
{
public:
FileSource
();
virtual
~
FileSource
();
int
getNumRecords
();
String
getRecordName
(
int
index
);
int
getNumRecords
()
const
;
int
getActiveRecord
()
const
;
String
getRecordName
(
int
index
)
const
;
int
getActiveRecord
();
void
setActiveRecord
(
int
index
);
float
getRecordSampleRate
(
int
index
)
const
;
int
getRecordNumChannels
(
int
index
)
const
;
int64
getRecordNumSamples
(
int
index
)
const
;
float
get
Record
SampleRate
(
int
index
)
;
int
get
Record
NumChannels
(
int
index
)
;
int64
get
Record
NumSamples
(
int
index
)
;
float
get
Active
SampleRate
(
)
const
;
int
get
Active
NumChannels
(
)
const
;
int64
get
Active
NumSamples
(
)
const
;
float
getActiveSampleRate
();
int
getActiveNumChannels
();
int64
getActiveNumSamples
();
RecordedChannelInfo
getChannelInfo
(
int
recordIndex
,
int
channel
)
const
;
RecordedChannelInfo
getChannelInfo
(
int
channel
)
const
;
RecordedChannelInfo
getChannelInfo
(
int
recordIndex
,
int
channel
);
RecordedChannelInfo
getChannelInfo
(
int
channel
);
void
setActiveRecord
(
int
index
);
bool
OpenFile
(
File
file
);
bool
fileIsOpened
();
String
getFileName
();
bool
OpenFile
(
File
file
);
bool
isFileOpened
()
const
;
String
getFileName
()
const
;
virtual
int
readData
(
int16
*
buffer
,
int
nSamples
)
=
0
;
virtual
void
processChannelData
(
int16
*
inBuffer
,
float
*
outBuffer
,
int
channel
,
int64
numSamples
)
=
0
;
virtual
void
seekTo
(
int64
sample
)
=
0
;
virtual
int
readData
(
int16
*
buffer
,
int
nSamples
)
=
0
;
virtual
void
processChannelData
(
int16
*
inBuffer
,
float
*
outBuffer
,
int
channel
,
int64
numSamples
)
=
0
;
virtual
void
seekTo
(
int64
sample
)
=
0
;
protected:
struct
RecordInfo
...
...
@@ -79,14 +83,14 @@ protected:
int
activeRecord
;
String
filename
;
private
:
virtual
bool
Open
(
File
file
)
=
0
;
virtual
void
fillRecordInfo
()
=
0
;
virtual
void
updateActiveRecord
()
=
0
;
virtual
bool
Open
(
File
file
)
=
0
;
virtual
void
fillRecordInfo
()
=
0
;
virtual
void
updateActiveRecord
()
=
0
;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
FileSource
);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
FileSource
);
};
#endif // FILESOURCE_H_INCLUDED
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment