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
be2c006e
Commit
be2c006e
authored
7 years ago
by
Aaron Cuevas Lopez
Browse files
Options
Downloads
Patches
Plain Diff
Add simple type conversion methods
parent
c82fd9d5
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/Events/Events.cpp
+36
-0
36 additions, 0 deletions
Source/Processors/Events/Events.cpp
Source/Processors/Events/Events.h
+6
-0
6 additions, 0 deletions
Source/Processors/Events/Events.h
with
42 additions
and
0 deletions
Source/Processors/Events/Events.cpp
+
36
−
0
View file @
be2c006e
...
...
@@ -300,6 +300,42 @@ bool Event::createChecks(const EventChannel* channelInfo, EventChannel::EventCha
return
true
;
}
MetaDataDescriptor
::
MetaDataTypes
Event
::
getEquivalentMetaDataType
(
const
Event
&
ev
)
{
switch
(
ev
.
getEventType
())
{
case
EventChannel
::
TEXT
:
return
MetaDataDescriptor
::
CHAR
;
case
EventChannel
::
INT8_ARRAY
:
return
MetaDataDescriptor
::
INT8
;
case
EventChannel
::
UINT8_ARRAY
:
return
MetaDataDescriptor
::
UINT8
;
case
EventChannel
::
INT16_ARRAY
:
return
MetaDataDescriptor
::
INT16
;
case
EventChannel
::
UINT16_ARRAY
:
return
MetaDataDescriptor
::
UINT16
;
case
EventChannel
::
INT32_ARRAY
:
return
MetaDataDescriptor
::
INT32
;
case
EventChannel
::
UINT32_ARRAY
:
return
MetaDataDescriptor
::
UINT32
;
case
EventChannel
::
INT64_ARRAY
:
return
MetaDataDescriptor
::
INT64
;
case
EventChannel
::
UINT64_ARRAY
:
return
MetaDataDescriptor
::
UINT64
;
case
EventChannel
::
FLOAT_ARRAY
:
return
MetaDataDescriptor
::
FLOAT
;
case
EventChannel
::
DOUBLE_ARRAY
:
return
MetaDataDescriptor
::
DOUBLE
;
default:
return
MetaDataDescriptor
::
UINT8
;
}
}
MetaDataDescriptor
::
MetaDataTypes
Event
::
getEquivalentMetaDataType
()
const
{
return
getEquivalentMetaDataType
(
*
this
);
}
//TTLEvent
TTLEvent
::
TTLEvent
(
const
EventChannel
*
channelInfo
,
int64
timestamp
,
uint16
channel
,
const
void
*
eventData
)
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/Events/Events.h
+
6
−
0
View file @
be2c006e
...
...
@@ -143,6 +143,12 @@ public:
static
EventChannel
::
EventChannelTypes
getEventType
(
const
MidiMessage
&
msg
);
static
EventPtr
deserializeFromMessage
(
const
MidiMessage
&
msg
,
const
EventChannel
*
channelInfo
);
/** Handy method to get an equivalente metadata value type for the main event data*/
static
MetaDataDescriptor
::
MetaDataTypes
getEquivalentMetaDataType
(
const
Event
&
ev
);
/** Handy method to get an equivalente metadata value type for the main event data*/
MetaDataDescriptor
::
MetaDataTypes
getEquivalentMetaDataType
()
const
;
protected:
Event
(
const
EventChannel
*
channelInfo
,
int64
timestamp
,
uint16
channel
);
Event
()
=
delete
;
...
...
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