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
004457e6
Commit
004457e6
authored
8 years ago
by
Aaron Cuevas Lopez
Browse files
Options
Downloads
Patches
Plain Diff
Update Arduino output plugin
parent
87e093b5
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/Plugins/ArduinoOutput/ArduinoOutput.cpp
+7
-7
7 additions, 7 deletions
Source/Plugins/ArduinoOutput/ArduinoOutput.cpp
Source/Plugins/ArduinoOutput/ArduinoOutput.h
+2
-2
2 additions, 2 deletions
Source/Plugins/ArduinoOutput/ArduinoOutput.h
with
9 additions
and
9 deletions
Source/Plugins/ArduinoOutput/ArduinoOutput.cpp
+
7
−
7
View file @
004457e6
...
...
@@ -97,15 +97,15 @@ void ArduinoOutput::setDevice (String devName)
}
void
ArduinoOutput
::
handleEvent
(
in
t
e
vent
Type
,
MidiMessage
&
event
,
int
sampleNum
)
void
ArduinoOutput
::
handleEvent
(
cons
t
E
vent
Channel
*
eventInfo
,
const
MidiMessage
&
event
,
int
sampleNum
)
{
if
(
eventType
==
TTL
)
if
(
Event
::
getEventType
(
event
)
==
EventChannel
::
TTL
)
{
const
uint8
*
dataptr
=
event
.
getRawData
(
);
TTLEventPtr
ttl
=
TTLEvent
::
deserializeFromMessage
(
event
,
eventInfo
);
//int eventNodeId = *(dataptr+1);
const
int
eventId
=
*
(
dataptr
+
2
)
;
const
int
eventChannel
=
*
(
dataptr
+
3
);
const
int
eventId
=
ttl
->
getState
()
?
1
:
0
;
const
int
eventChannel
=
ttl
->
getChannel
(
);
// std::cout << "Received event from " << eventNodeId
// << " on channel " << eventChannel
...
...
@@ -197,7 +197,7 @@ bool ArduinoOutput::disable()
}
void
ArduinoOutput
::
process
(
AudioSampleBuffer
&
buffer
,
MidiBuffer
&
events
)
void
ArduinoOutput
::
process
(
AudioSampleBuffer
&
buffer
)
{
checkForEvents
(
events
);
checkForEvents
();
}
This diff is collapsed.
Click to expand it.
Source/Plugins/ArduinoOutput/ArduinoOutput.h
+
2
−
2
View file @
004457e6
...
...
@@ -46,14 +46,14 @@ public:
~
ArduinoOutput
();
/** Searches for events and triggers the Arduino output when appropriate. */
void
process
(
AudioSampleBuffer
&
buffer
,
MidiBuffer
&
events
)
override
;
void
process
(
AudioSampleBuffer
&
buffer
)
override
;
/** Currently unused. Future uses may include changing the TTL trigger channel
or the output channel of the Arduino. */
void
setParameter
(
int
parameterIndex
,
float
newValue
)
override
;
/** Convenient interface for responding to incoming events. */
void
handleEvent
(
in
t
e
vent
Type
,
MidiMessage
&
event
,
int
sampleNum
)
override
;
void
handleEvent
(
cons
t
E
vent
Channel
*
eventInfo
,
const
MidiMessage
&
event
,
int
sampleNum
)
override
;
/** Called immediately prior to the start of data acquisition. */
bool
enable
()
override
;
...
...
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