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
f280c775
Commit
f280c775
authored
12 years ago
by
Josh Siegle
Browse files
Options
Downloads
Patches
Plain Diff
RecordNode can now create new data directories
parent
e5e79fba
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/RecordNode.cpp
+40
-4
40 additions, 4 deletions
Source/Processors/RecordNode.cpp
Source/Processors/RecordNode.h
+3
-0
3 additions, 0 deletions
Source/Processors/RecordNode.h
with
43 additions
and
4 deletions
Source/Processors/RecordNode.cpp
+
40
−
4
View file @
f280c775
...
...
@@ -28,7 +28,7 @@ RecordNode::RecordNode()
:
GenericProcessor
(
"Record Node"
),
isRecording
(
false
),
isProcessing
(
false
)
{
//d
ataFolder =
"./Data"
;
newD
ataFolder
=
true
;
continuousDataBuffer
=
new
int16
[
10000
];
...
...
@@ -176,6 +176,42 @@ void RecordNode::setParameter (int parameterIndex, float newValue)
// continuousChannels[i].file = fopen(continuousChannels[i].filename.toUTF8(), "a");
// }
// }
if
(
newDataFolder
)
{
Time
calendar
=
Time
::
getCurrentTime
();
Array
<
int
>
t
;
t
.
add
(
calendar
.
getYear
()
-
2000
);
t
.
add
(
calendar
.
getMonth
()
+
1
);
// January = 0
t
.
add
(
calendar
.
getDayOfMonth
());
t
.
add
(
calendar
.
getHours
());
t
.
add
(
calendar
.
getMinutes
());
t
.
add
(
calendar
.
getSeconds
());
String
filename
=
""
;
for
(
int
n
=
0
;
n
<
t
.
size
();
n
++
)
{
if
(
t
[
n
]
<
10
)
filename
+=
"0"
;
filename
+=
t
[
n
];
if
(
n
==
2
)
filename
+=
"_"
;
else
if
(
n
<
5
)
filename
+=
"-"
;
}
rootFolder
=
File
(
dataDirectory
.
getFullPathName
()
+
File
::
separator
+
filename
);
if
(
!
rootFolder
.
exists
())
rootFolder
.
createDirectory
();
newDataFolder
=
false
;
}
}
else
if
(
parameterIndex
==
0
)
{
...
...
@@ -302,9 +338,9 @@ void RecordNode::process(AudioSampleBuffer &buffer,
if
(
continuousChannels
[
i
].
isRecording
)
{
// write buffer to disk!
writeContinuousBuffer
(
buffer
.
getSampleData
(
i
),
nSamples
,
i
);
//
writeContinuousBuffer(buffer.getSampleData(i),
//
nSamples,
//
i);
//std::cout << "Record channel " << i << std::endl;
}
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/RecordNode.h
+
3
−
0
View file @
f280c775
...
...
@@ -84,6 +84,9 @@ private:
//String dataFolder;
File
dataDirectory
;
File
rootFolder
;
bool
newDataFolder
;
int16
*
continuousDataBuffer
;
...
...
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