Skip to content

Commit

Permalink
updates to keep pace with changes to the proposal
Browse files Browse the repository at this point in the history
updated VVOSCQueryProtocol.framework to correspond with changes in the proposal :: colors are now represented as hex strings :: tightened up logic, fixed some issues around support for per-value attributes that are expressed as single values rather than arrays :: updated the various user-facing utilities to correspond with all these changes :: updated oscqueryhtml, but it's still lagging way behind the official version while testing is still in progress :: fixed a crash that would occur as a result of some bad string parsing
  • Loading branch information
mrRay committed Aug 13, 2018
1 parent 7616e82 commit d6f84b8
Show file tree
Hide file tree
Showing 32 changed files with 444 additions and 151 deletions.
6 changes: 3 additions & 3 deletions MIDIOSCQueryHelper/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.4.1.0</string>
<string>0.4.2.0</string>
<key>CFBundleVersion</key>
<string>0.4.1.0</string>
<string>0.4.2.0</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 Vidvox, LLC. All rights reserved.</string>
<string>Copyright © 2018 Vidvox, LLC. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down
6 changes: 3 additions & 3 deletions OSCQueryHelper/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@
</menu>
</menuItem>
</items>
<point key="canvasLocation" x="49" y="-318"/>
<point key="canvasLocation" x="30" y="-80"/>
</menu>
<window title="OSCQuery Helper" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
Expand Down Expand Up @@ -889,7 +889,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="m6n-mg-3TP">
<font key="font" metaFont="system"/>
<mutableString key="title">OSC Query Helper ("OQH" from now on) creates an OSC query server for other applications that support OSC (can receive OSC), but don't support the OSC query protocol. This allows clients that support the query protocol to browse and send data directly to the other app's OSC address space.
<string key="title">OSC Query Helper ("OQH" from now on) creates an OSC query server for other applications that support OSC (can receive OSC), but don't support the OSC query protocol. This allows clients that support the query protocol to browse and send data directly to the other app's OSC address space.

HOW TO USE IT:
1)- Tell OQH what file to use- this file will be used to populate the OSC query server with the description of another application's OSC address space. OQH will "watch" the file and if it is updated, the query server will automatically update itself, and then notify all connected clients that it has been updated. For more information about the supported file type(s), see "FILE TYPE".
Expand All @@ -899,7 +899,7 @@ If OQH is running, the OSC query server is running- you can check it with any OS

FILE TYPE:

- JSON files can be imported- a sample file demonstrating a wide variety of OSC types is already installed on your machine in "~/Documents/OSCQuery Helper/SampleDocument.json". The JSON files that you import should have a structure similar to the desired output of the OSC query server- for more information, consult the OSC query protocol, defined here (https://github.com/mrRay/OSCQueryProposal). You can include an optional HOST_INFO object in the root level of the JSON file's object if you want to hard-code the connection details of the target app or device (port and, if desired, an IP address other than localhost) as detailed in the query protocol. If you don't include this information, you can just use the UI in the app to specify the target.</mutableString>
- JSON files can be imported- a sample file demonstrating a wide variety of OSC types is already installed on your machine in "~/Documents/OSCQuery Helper/SampleDocument.json". The JSON files that you import should have a structure similar to the desired output of the OSC query server- for more information, consult the OSC query protocol, defined here (https://github.com/mrRay/OSCQueryProposal). You can include an optional HOST_INFO object in the root level of the JSON file's object if you want to hard-code the connection details of the target app or device (port and, if desired, an IP address other than localhost) as detailed in the query protocol. If you don't include this information, you can just use the UI in the app to specify the target.</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
Expand Down
4 changes: 2 additions & 2 deletions OSCQueryHelper/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.4.1.0</string>
<string>0.4.2.0</string>
<key>CFBundleVersion</key>
<string>0.4.1.0</string>
<string>0.4.2.0</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
19 changes: 19 additions & 0 deletions OSCQueryHelper/SampleDocument.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,25 @@
"dollars"
]
},
"my_int_as_toggle" : {
"TYPE" : "i",
"DESCRIPTION" : "integer that functions as a toggle",
"RANGE" : [
{
"MAX" : 1,
"MIN" : 0
}
],
"TAGS" : [
"integer input", "toggle"
],
"CLIPMODE" : [
"none"
],
"UNIT" : [
"wonderTwinPowers"
]
},
"my_longlong" : {
"TYPE" : "h",
"DESCRIPTION" : "64-bit int node",
Expand Down
53 changes: 45 additions & 8 deletions VVOSCQueryBrowser/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="Voe-Tx-rLC" customClass="VVOSCQueryBrowserAppDelegate">
<connections>
<outlet property="helpWindow" destination="rCv-63-EuZ" id="Wwr-RK-73u"/>
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
</connections>
</customObject>
Expand Down Expand Up @@ -678,7 +679,7 @@
<items>
<menuItem title="OSCQueryBrowser Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
<action selector="showHelp:" target="Voe-Tx-rLC" id="ACI-gP-lsw"/>
</connections>
</menuItem>
</items>
Expand All @@ -696,10 +697,10 @@
<rect key="frame" x="0.0" y="0.0" width="769" height="605"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="Gfq-d6-TL6">
<rect key="frame" x="18" y="568" width="50" height="17"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="Gfq-d6-TL6">
<rect key="frame" x="18" y="568" width="261" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Servers" id="ZiY-a9-New">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Servers:" id="ZiY-a9-New">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -717,10 +718,10 @@
<action selector="urlFieldUsed:" target="nFM-4p-b9o" id="SEP-Bt-H5A"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="CS4-zo-bte">
<rect key="frame" x="283" y="568" width="179" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Server's OSC Address Space" id="wJz-f9-6Gd">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="CS4-zo-bte">
<rect key="frame" x="283" y="568" width="468" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Server's OSC Address Space:" id="wJz-f9-6Gd">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -1335,5 +1336,41 @@
<point key="canvasLocation" x="634" y="181"/>
</customView>
<customObject id="B9p-Kb-KZi" customClass="SUUpdater"/>
<window title="Help Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="rCv-63-EuZ">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="699" height="227"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
<view key="contentView" misplaced="YES" id="NQV-OE-Yh3">
<rect key="frame" x="0.0" y="0.0" width="699" height="227"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button verticalHuggingPriority="750" id="xTQ-hK-s9Q">
<rect key="frame" x="312" y="13" width="75" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Close" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="VXh-aQ-MMW">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="closeHelp:" target="Voe-Tx-rLC" id="4dN-wf-Beo"/>
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" misplaced="YES" id="5l5-Lq-Jz8">
<rect key="frame" x="18" y="122" width="663" height="85"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="TnR-Fu-ULU">
<font key="font" metaFont="system"/>
<string key="title">OSCQuery Browser lists the OSCQuery servers it detects, and allows you to browse their address spaces and send data to them.

It does not support bidirectional streaming- the UI items in this app will only update if you manually refresh the view (by selecting a server or entering a path to display).</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<point key="canvasLocation" x="41.5" y="604.5"/>
</window>
</objects>
</document>
4 changes: 2 additions & 2 deletions VVOSCQueryBrowser/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.4.1.0</string>
<string>0.4.2.0</string>
<key>CFBundleVersion</key>
<string>0.4.1.0</string>
<string>0.4.2.0</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
7 changes: 7 additions & 0 deletions VVOSCQueryBrowser/NSStringAdditions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <Cocoa/Cocoa.h>

@interface NSString (NSStringAdditions)

- (NSColor *) rgbaColorFrom8BPCHexContents;

@end
61 changes: 61 additions & 0 deletions VVOSCQueryBrowser/NSStringAdditions.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#import "NSArrayAdditions.h"
#import "NSStringAdditions.h"

@implementation NSString (NSStringAdditions)

- (NSColor *) rgbaColorFrom8BPCHexContents {
const char *cStr = [self UTF8String];
size_t strLen = [self length];
uint32_t parsedInt = 0;
int maxChannelIndex = 3;
uint8_t parsedVals[4] = { 255, 255, 255, 255 };

/*
// this is what the following should equate to, logically
if (strLen == <RGB instead of RGBA, which is technically malformed>) {
parsedVals[0] = (parsedInt >> 16) & 0xFF
parsedVals[1] = (parsedInt >> 8) & 0xFF
parsedVals[2] = (parsedInt >> 0) & 0xFF
}
else {
parsedVals[0] = (parsedInt >> 24) & 0xFF
parsedVals[1] = (parsedInt >> 16) & 0xFF
parsedVals[2] = (parsedInt >> 8) & 0xFF
parsedVals[3] = (parsedInt >> 0) & 0xFF
}
*/

if (*cStr == '#') {
if (strLen==9 || strLen==7) {
parsedInt = strtol(cStr+1, NULL, 16);
if (strLen == 7)
maxChannelIndex = 2;
}
else
return nil;
}
else if (cStr[0]=='0' && (cStr[1]=='x' || cStr[1]=='X')) {
if (strLen==10 || strLen==8) {
parsedInt = strtol(cStr+2, NULL, 16);
if (strLen == 8)
maxChannelIndex = 2;
}
else
return nil;
}
else
return nil;

for (int valIndex=0; valIndex<=maxChannelIndex; ++valIndex) {
int bitShiftAmount = (maxChannelIndex - valIndex) * 8; // 8 bits per channel
parsedVals[valIndex] = (parsedInt >> bitShiftAmount) & 0xFF;
}
NSColor *returnMe = [NSColor
colorWithDeviceRed:((double)parsedVals[0])/255.
green:((double)parsedVals[1])/255.
blue:((double)parsedVals[2])/255.
alpha:((double)parsedVals[3])/255.];
return returnMe;
}

@end
Loading

0 comments on commit d6f84b8

Please sign in to comment.