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
bb569d57
Commit
bb569d57
authored
10 years ago
by
Aaron Cuevas Lopez
Browse files
Options
Downloads
Patches
Plain Diff
Automatically add timestamps in filter nodes that send events if not done manually
parent
941d8f4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/GenericProcessor/GenericProcessor.cpp
+11
-1
11 additions, 1 deletion
Source/Processors/GenericProcessor/GenericProcessor.cpp
Source/Processors/GenericProcessor/GenericProcessor.h
+2
-0
2 additions, 0 deletions
Source/Processors/GenericProcessor/GenericProcessor.h
with
13 additions
and
1 deletion
Source/Processors/GenericProcessor/GenericProcessor.cpp
+
11
−
1
View file @
bb569d57
...
...
@@ -30,7 +30,7 @@ GenericProcessor::GenericProcessor(const String& name_) : AccessClass(),
sourceNode
(
0
),
destNode
(
0
),
isEnabled
(
true
),
wasConnected
(
false
),
nextAvailableChannel
(
0
),
saveOrder
(
-
1
),
loadOrder
(
-
1
),
currentChannel
(
-
1
),
editor
(
0
),
parametersAsXml
(
nullptr
),
sendSampleCount
(
true
),
name
(
name_
),
paramsWereLoaded
(
false
),
needsToSendTimestampMessage
(
false
)
paramsWereLoaded
(
false
),
needsToSendTimestampMessage
(
false
)
,
timestampSet
(
false
)
{
settings
.
numInputs
=
settings
.
numOutputs
=
settings
.
sampleRate
=
0
;
...
...
@@ -601,6 +601,7 @@ void GenericProcessor::setTimestamp(MidiBuffer& events, int64 timestamp)
{
//std::cout << "Setting timestamp to " << timestamp << std:;endl;
timestampSet
=
true
;
uint8
data
[
8
];
memcpy
(
data
,
&
timestamp
,
8
);
...
...
@@ -760,6 +761,13 @@ void GenericProcessor::addEvent(MidiBuffer& eventBuffer,
uint8
*
eventData
,
bool
isTimestamp
)
{
/*If the processor doesn't generates timestamps, but needs to add events to the buffer anyway
add the timestamp of the first input channel so the event is properly timestamped. We avoid this step for
source modules that must always provide a timestamp, even if they don't generate it*/
if
(
!
isTimestamp
&&
!
timestampSet
&&
!
isSource
()
&&
!
generatesTimestamps
())
setTimestamp
(
eventBuffer
,
getTimestamp
(
0
));
uint8
*
data
=
new
uint8
[
6
+
numBytes
];
data
[
0
]
=
type
;
// event type
...
...
@@ -797,6 +805,8 @@ void GenericProcessor::processBlock(AudioSampleBuffer& buffer, MidiBuffer& event
processEventBuffer
(
eventBuffer
);
// extract buffer sizes and timestamps,
// set flag on all TTL events to zero
timestampSet
=
false
;
process
(
buffer
,
eventBuffer
);
}
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/GenericProcessor/GenericProcessor.h
+
2
−
0
View file @
bb569d57
...
...
@@ -658,6 +658,8 @@ private:
bool
paramsWereLoaded
;
bool
needsToSendTimestampMessage
;
bool
timestampSet
;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
GenericProcessor
);
};
...
...
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