Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
balandinodidonato committed Dec 18, 2016
2 parents 682c0f5 + 486cee3 commit 6e8d780
Show file tree
Hide file tree
Showing 12 changed files with 430 additions and 303 deletions.
4 changes: 2 additions & 2 deletions Myo Mapper/Builds/MacOSX/Info-App.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.4.6</string>
<string>2.4.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.4.6.40</string>
<string>2.4.8.45</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.music</string>
<key>NSHighResolutionCapable</key>
Expand Down
36 changes: 24 additions & 12 deletions Myo Mapper/Builds/MacOSX/Myo Mapper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
18E0E1561A01AC4378FAD286 /* juce_gui_extra.mm in Sources */ = {isa = PBXBuildFile; fileRef = A28EB745B9121A093788F896 /* juce_gui_extra.mm */; };
238D62E99C4B1F9F7F8DC6D5 /* OSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 88D50F8C8E8383496FF731E4 /* OSC.cpp */; };
3249BC9D9EFFE689218A472F /* Pose.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0E27C8574274A61319FA848 /* Pose.cpp */; };
325A018A1DDCD98800D9F8AE /* myo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD34A39CF97F291536646032 /* myo.framework */; };
325A018B1DDCD98800D9F8AE /* myo.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AD34A39CF97F291536646032 /* myo.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
326B3ED71E0577C200BCA600 /* myo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 326B3ED61E0577C200BCA600 /* myo.framework */; };
326B3ED81E0577CA00BCA600 /* myo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 326B3ED61E0577C200BCA600 /* myo.framework */; };
326B3ED91E0577CA00BCA600 /* myo.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 326B3ED61E0577C200BCA600 /* myo.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
406A3622585F79E74E579FA2 /* MyoManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0CCC5FFD5FD927C3D6D22C4B /* MyoManager.cpp */; };
5136B5F30EC112831726206C /* juce_graphics.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED8A349155C638AEFB06F17B /* juce_graphics.mm */; };
5352F012067A453DFCBA07D5 /* HelpWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 486A12096CEF9BE7F47C4474 /* HelpWindow.cpp */; };
Expand All @@ -28,7 +29,6 @@
8BE90999B651C89ABD452AA9 /* rescale.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0DEB113DDC0F0649AD7C4B56 /* rescale.cpp */; };
8C8F9A92519A4EA918581B03 /* RecentFilesMenuTemplate.nib in Resources */ = {isa = PBXBuildFile; fileRef = 362301F4D9F3494F257A83B1 /* RecentFilesMenuTemplate.nib */; };
99CAD7971DB8C87B79AB2B0C /* Main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C18CFCFFAE8241D1D539735E /* Main.cpp */; };
9CABDB780A220E97B1899E38 /* myo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD34A39CF97F291536646032 /* myo.framework */; };
C116BA0C6679EE33707BA158 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4CC130375FB18D502CFB639 /* IOKit.framework */; };
CB3A60C7119CAF06A1B62734 /* waveformLength.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94BC431FB71546F3DFF91339 /* waveformLength.cpp */; };
CD67E05843BCD8A57E4CE15A /* orientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A151D0A214E6BEBDD3EBC26B /* orientation.cpp */; };
Expand All @@ -43,13 +43,13 @@
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
325A018C1DDCD98800D9F8AE /* Embed Frameworks */ = {
326B3EDA1E0577CA00BCA600 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
325A018B1DDCD98800D9F8AE /* myo.framework in Embed Frameworks */,
326B3ED91E0577CA00BCA600 /* myo.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -232,6 +232,7 @@
314B9E35ED00249A48753215 /* juce_Variant.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Variant.cpp; path = ../../../../../../Applications/JUCE/modules/juce_core/containers/juce_Variant.cpp; sourceTree = SOURCE_ROOT; };
31A047921A4BD9E654BF22CF /* juce_ToolbarButton.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ToolbarButton.cpp; path = ../../../../../../Applications/JUCE/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp; sourceTree = SOURCE_ROOT; };
32005EDEED5D849ABF40C508 /* deflate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = deflate.h; path = ../../../../../../Applications/JUCE/modules/juce_core/zip/zlib/deflate.h; sourceTree = SOURCE_ROOT; };
326B3ED61E0577C200BCA600 /* myo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = myo.framework; path = ../../../../../../Library/Frameworks/myo.framework; sourceTree = "<group>"; };
32BD217586A1E7C1D6CDD414 /* juce_ThreadWithProgressWindow.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ThreadWithProgressWindow.cpp; path = ../../../../../../Applications/JUCE/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.cpp; sourceTree = SOURCE_ROOT; };
32C319A4B2A972663B08BD3A /* juce_Label.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Label.cpp; path = ../../../../../../Applications/JUCE/modules/juce_gui_basics/widgets/juce_Label.cpp; sourceTree = SOURCE_ROOT; };
32E5EBB7E2DF022318278446 /* pngstruct.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = pngstruct.h; path = ../../../../../../Applications/JUCE/modules/juce_graphics/image_formats/pnglib/pngstruct.h; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -655,7 +656,6 @@
AC97C4A1B7B401D54B563BFB /* juce_RelativeParallelogram.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_RelativeParallelogram.cpp; path = ../../../../../../Applications/JUCE/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.cpp; sourceTree = SOURCE_ROOT; };
ACA0303F0139437A747732DF /* juce_PropertySet.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_PropertySet.cpp; path = ../../../../../../Applications/JUCE/modules/juce_core/containers/juce_PropertySet.cpp; sourceTree = SOURCE_ROOT; };
ACA1CD1DAA0F98DFD1C66C4C /* juce_AppleRemote.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_AppleRemote.h; path = ../../../../../../Applications/JUCE/modules/juce_gui_extra/misc/juce_AppleRemote.h; sourceTree = SOURCE_ROOT; };
AD34A39CF97F291536646032 /* myo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = myo.framework; path = System/Library/Frameworks/myo.framework; sourceTree = SDKROOT; };
AD5A53BDEBAE721043D392D4 /* juce_InterProcessLock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_InterProcessLock.h; path = ../../../../../../Applications/JUCE/modules/juce_core/threads/juce_InterProcessLock.h; sourceTree = SOURCE_ROOT; };
AE58FA424F830A62C81EA74F /* juce_PropertyComponent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_PropertyComponent.cpp; path = ../../../../../../Applications/JUCE/modules/juce_gui_basics/properties/juce_PropertyComponent.cpp; sourceTree = SOURCE_ROOT; };
AE84F24D4DDF69BAD8BC2225 /* juce_TooltipClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_TooltipClient.h; path = ../../../../../../Applications/JUCE/modules/juce_gui_basics/mouse/juce_TooltipClient.h; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -923,10 +923,10 @@
D6B1435E336D3D5A66FCF16B /* Carbon.framework in Frameworks */,
EA6B6B9A2254D93F7BE9742B /* Cocoa.framework in Frameworks */,
C116BA0C6679EE33707BA158 /* IOKit.framework in Frameworks */,
9CABDB780A220E97B1899E38 /* myo.framework in Frameworks */,
00C21076546BD3C41BE3490C /* OpenGL.framework in Frameworks */,
808C19E032283899C075FEFF /* QuartzCore.framework in Frameworks */,
325A018A1DDCD98800D9F8AE /* myo.framework in Frameworks */,
326B3ED71E0577C200BCA600 /* myo.framework in Frameworks */,
326B3ED81E0577CA00BCA600 /* myo.framework in Frameworks */,
6507943995181A90AF2AB700 /* WebKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -2054,10 +2054,10 @@
A8B8923DE26E7730A43A9AFD /* Frameworks */ = {
isa = PBXGroup;
children = (
326B3ED61E0577C200BCA600 /* myo.framework */,
175332EA85B1F4026F148E47 /* Carbon.framework */,
64200BD72BE5B8158B73877B /* Cocoa.framework */,
C4CC130375FB18D502CFB639 /* IOKit.framework */,
AD34A39CF97F291536646032 /* myo.framework */,
A6961D66C3C9A60E52FE8322 /* OpenGL.framework */,
EEF39C81C7C79A4A39C8C86A /* QuartzCore.framework */,
B45BCCAF5D0552B62F8ADC0C /* WebKit.framework */,
Expand Down Expand Up @@ -2448,7 +2448,7 @@
04585E7B6D39EA4D1DA7CF92 /* Sources */,
EDA380A82341BC06E239D3AD /* Frameworks */,
128EAE48529CD020F3D877A3 /* Post-build script */,
325A018C1DDCD98800D9F8AE /* Embed Frameworks */,
326B3EDA1E0577CA00BCA600 /* Embed Frameworks */,
);
buildRules = (
);
Expand All @@ -2468,6 +2468,8 @@
LastUpgradeCheck = 0440;
TargetAttributes = {
16D9E24D9D1B08C0B67EDE4A = {
DevelopmentTeam = KU4CB2894M;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.InAppPurchase = {
enabled = 0;
Expand Down Expand Up @@ -2558,10 +2560,15 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_LINK_OBJC_RUNTIME = NO;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/build/$(CONFIGURATION)";
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = "~/Library/Frameworks/";
DEVELOPMENT_TEAM = KU4CB2894M;
FRAMEWORK_SEARCH_PATHS = (
"~/Library/Frameworks/",
"$(LOCAL_LIBRARY_DIR)/Frameworks",
);
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand Down Expand Up @@ -2592,10 +2599,15 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_LINK_OBJC_RUNTIME = NO;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/build/$(CONFIGURATION)";
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "~/Library/Frameworks/";
DEVELOPMENT_TEAM = KU4CB2894M;
FRAMEWORK_SEARCH_PATHS = (
"~/Library/Frameworks/",
"$(LOCAL_LIBRARY_DIR)/Frameworks",
);
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand Down
23 changes: 19 additions & 4 deletions Myo Mapper/Source/MainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,17 @@ void MainComponent::paint(juce::Graphics &g)
menuBar.setBounds(0, 0, getWidth(), 20);
settingsPannel.setBounds(10, menuBar.getBottom()+10, getRight()-20, getHeight()*0.19-10);
#endif

if(settingsPannel.getShowOrientation()==1)
orientation.setBounds(settingsPannel.getX(), settingsPannel.getBottom()+5, settingsPannel.getWidth(), ((getHeight()*0.63)-15));
else orientation.setBounds(0, 0, 0, 0);

if(settingsPannel.getShowPose()==1 && settingsPannel.getShowOrientation()==1)
pose.setBounds(orientation.getX(), orientation.getBottom()+10, settingsPannel.getWidth()*settingsPannel.getShowPose(), (getHeight()*0.12));
else if(settingsPannel.getShowPose()==1 && settingsPannel.getShowOrientation()==0)
pose.setBounds(settingsPannel.getX(), settingsPannel.getBottom()+5, settingsPannel.getWidth(), (getHeight()*0.12));
else pose.setBounds(0, 0, 0, 0);

orientation.setBounds(settingsPannel.getX(), settingsPannel.getBottom()+5, settingsPannel.getWidth()*settingsPannel.getShowOrientation(), ((getHeight()*0.63)-15)*settingsPannel.getShowOrientation());
pose.setBounds(orientation.getX(), orientation.getBottom()+10, settingsPannel.getWidth()*settingsPannel.getShowPose(), (getHeight()*0.12)*settingsPannel.getShowPose());
}

void MainComponent::resized()
Expand All @@ -90,8 +98,15 @@ void MainComponent::resized()
settingsPannel.setBounds(10, menuBar.getBottom()+10, getRight()-20, getHeight()*0.19-10);
#endif

orientation.setBounds(settingsPannel.getX(), settingsPannel.getBottom()+5, settingsPannel.getWidth()*settingsPannel.getShowOrientation(), ((getHeight()*0.63)-15)*settingsPannel.getShowOrientation());
pose.setBounds(orientation.getX(), orientation.getBottom()+10, settingsPannel.getWidth()*settingsPannel.getShowPose(), (getHeight()*0.12)*settingsPannel.getShowPose());
if(settingsPannel.getShowOrientation()==1)
orientation.setBounds(settingsPannel.getX(), settingsPannel.getBottom()+5, settingsPannel.getWidth(), ((getHeight()*0.63)-15));
else orientation.setBounds(0, 0, 0, 0);

if(settingsPannel.getShowPose()==1 && settingsPannel.getShowOrientation()==1)
pose.setBounds(orientation.getX(), orientation.getBottom()+10, settingsPannel.getWidth()*settingsPannel.getShowPose(), (getHeight()*0.12));
else if(settingsPannel.getShowPose()==1 && settingsPannel.getShowOrientation()==0)
pose.setBounds(settingsPannel.getX(), settingsPannel.getBottom()+5, settingsPannel.getWidth(), (getHeight()*0.12));
else pose.setBounds(0, 0, 0, 0);
}

int i = 0;
Expand Down
3 changes: 2 additions & 1 deletion Myo Mapper/Source/MainComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ class MainComponent : public Component,

void AboutMyoMapperDialogWindow();
void HelpDialogWindow();
Settings settingsPannel;


private:

void timerCallback() override;
void comboBoxChanged (ComboBox* comboBoxThatHasChanged) override;

Settings settingsPannel;
MyoManager myoManager;
Pose pose;
OSC osc;
Expand Down
4 changes: 2 additions & 2 deletions Myo Mapper/Source/MyoListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ void MyoListener::onAccelerometerData(myo::Myo* myo, uint64_t timestamp, const m
if(myoID == -1) return;

myoData[myoID].acceleration.x = accel.x();
myoData[myoID].acceleration.y = accel.x();
myoData[myoID].acceleration.z = accel.x();
myoData[myoID].acceleration.y = accel.y();
myoData[myoID].acceleration.z = accel.z();

myoData[myoID].accelerationScaled.x = (accel.x()+16)*0.03125;
myoData[myoID].accelerationScaled.y = (accel.y()+16)*0.03125;
Expand Down
11 changes: 6 additions & 5 deletions Myo Mapper/Source/orientation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ void Orientation::paint(juce::Graphics &g)
g.setColour(Colours::grey);
g.drawRoundedRectangle(0, 0, getWidth(), getHeight(), 5, 5);
g.setColour(Colours::black);
g.setFont(getHeight()*0.07);
g.setFont(getHeight()*0.06);
g.drawText("Orientation", getLocalBounds(),
Justification::centredTop, true); // draw some placeholder text
}

void Orientation::resized()
{
rescaleYaw.setBounds(10, getHeight()*0.1, getRight()-30, getHeight()*0.28);
rescaleYaw.setBounds(10, getHeight()*0.07, getRight()-30, getHeight()*0.29);
rescalePitch.setBounds(rescaleYaw.getX(), rescaleYaw.getBottom()+7, rescaleYaw.getWidth(), rescaleYaw.getHeight());
rescaleRoll.setBounds(rescaleYaw.getX(), rescalePitch.getBottom()+7, rescaleYaw.getWidth(), rescaleYaw.getHeight());
}
Expand Down Expand Up @@ -69,12 +69,13 @@ float Orientation::getRoll()
return rescaleRoll.getValue();
}

// Recal functions from OSC data in input
void Orientation::map(int myoData, int Action, float Value, bool ReverseStatus)
{
switch (myoData) {
case 0:
switch (Action) {
case 1: rescaleYaw.setCentre(); break;
case 1: rescaleYaw.setCalibrate(); break;
case 2: rescaleYaw.setMin(Value); break;
case 3: rescaleYaw.setMax(Value); break;
case 4: rescaleYaw.setReverse(ReverseStatus); break;
Expand All @@ -84,7 +85,7 @@ void Orientation::map(int myoData, int Action, float Value, bool ReverseStatus)
break;
case 1:
switch (Action) {
case 1: rescalePitch.setCentre(); break;
case 1: rescalePitch.setCalibrate(); break;
case 2: rescalePitch.setMin(Value); break;
case 3: rescalePitch.setMax(Value); break;
case 4: rescalePitch.setReverse(ReverseStatus); break;
Expand All @@ -94,7 +95,7 @@ void Orientation::map(int myoData, int Action, float Value, bool ReverseStatus)
break;
case 2:
switch (Action) {
case 1: rescaleRoll.setCentre(); break;
case 1: rescaleRoll.setCalibrate(); break;
case 2: rescaleRoll.setMin(Value); break;
case 3: rescaleRoll.setMax(Value); break;
case 4: rescaleRoll.setReverse(ReverseStatus); break;
Expand Down
Loading

0 comments on commit 6e8d780

Please sign in to comment.