Skip to content

Commit d6f84b8

Browse files
committed
updates to keep pace with changes to the proposal
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
1 parent 7616e82 commit d6f84b8

File tree

32 files changed

+444
-151
lines changed

32 files changed

+444
-151
lines changed

MIDIOSCQueryHelper/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
<key>CFBundlePackageType</key>
3535
<string>APPL</string>
3636
<key>CFBundleShortVersionString</key>
37-
<string>0.4.1.0</string>
37+
<string>0.4.2.0</string>
3838
<key>CFBundleVersion</key>
39-
<string>0.4.1.0</string>
39+
<string>0.4.2.0</string>
4040
<key>LSMinimumSystemVersion</key>
4141
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
4242
<key>NSHumanReadableCopyright</key>
43-
<string>Copyright © 2017 Vidvox, LLC. All rights reserved.</string>
43+
<string>Copyright © 2018 Vidvox, LLC. All rights reserved.</string>
4444
<key>NSMainNibFile</key>
4545
<string>MainMenu</string>
4646
<key>NSPrincipalClass</key>

OSCQueryHelper/Base.lproj/MainMenu.xib

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@
697697
</menu>
698698
</menuItem>
699699
</items>
700-
<point key="canvasLocation" x="49" y="-318"/>
700+
<point key="canvasLocation" x="30" y="-80"/>
701701
</menu>
702702
<window title="OSCQuery Helper" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
703703
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
@@ -889,7 +889,7 @@
889889
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
890890
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="m6n-mg-3TP">
891891
<font key="font" metaFont="system"/>
892-
<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.
892+
<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.
893893

894894
HOW TO USE IT:
895895
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".
@@ -899,7 +899,7 @@ If OQH is running, the OSC query server is running- you can check it with any OS
899899

900900
FILE TYPE:
901901

902-
- 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>
902+
- 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>
903903
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
904904
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
905905
</textFieldCell>

OSCQueryHelper/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
<key>CFBundlePackageType</key>
3737
<string>APPL</string>
3838
<key>CFBundleShortVersionString</key>
39-
<string>0.4.1.0</string>
39+
<string>0.4.2.0</string>
4040
<key>CFBundleVersion</key>
41-
<string>0.4.1.0</string>
41+
<string>0.4.2.0</string>
4242
<key>LSMinimumSystemVersion</key>
4343
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
4444
<key>NSHumanReadableCopyright</key>

OSCQueryHelper/SampleDocument.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,25 @@
9090
"dollars"
9191
]
9292
},
93+
"my_int_as_toggle" : {
94+
"TYPE" : "i",
95+
"DESCRIPTION" : "integer that functions as a toggle",
96+
"RANGE" : [
97+
{
98+
"MAX" : 1,
99+
"MIN" : 0
100+
}
101+
],
102+
"TAGS" : [
103+
"integer input", "toggle"
104+
],
105+
"CLIPMODE" : [
106+
"none"
107+
],
108+
"UNIT" : [
109+
"wonderTwinPowers"
110+
]
111+
},
93112
"my_longlong" : {
94113
"TYPE" : "h",
95114
"DESCRIPTION" : "64-bit int node",

VVOSCQueryBrowser/Base.lproj/MainMenu.xib

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
1616
<customObject id="Voe-Tx-rLC" customClass="VVOSCQueryBrowserAppDelegate">
1717
<connections>
18+
<outlet property="helpWindow" destination="rCv-63-EuZ" id="Wwr-RK-73u"/>
1819
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
1920
</connections>
2021
</customObject>
@@ -678,7 +679,7 @@
678679
<items>
679680
<menuItem title="OSCQueryBrowser Help" keyEquivalent="?" id="FKE-Sm-Kum">
680681
<connections>
681-
<action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
682+
<action selector="showHelp:" target="Voe-Tx-rLC" id="ACI-gP-lsw"/>
682683
</connections>
683684
</menuItem>
684685
</items>
@@ -696,10 +697,10 @@
696697
<rect key="frame" x="0.0" y="0.0" width="769" height="605"/>
697698
<autoresizingMask key="autoresizingMask"/>
698699
<subviews>
699-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="Gfq-d6-TL6">
700-
<rect key="frame" x="18" y="568" width="50" height="17"/>
700+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="Gfq-d6-TL6">
701+
<rect key="frame" x="18" y="568" width="261" height="17"/>
701702
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
702-
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Servers" id="ZiY-a9-New">
703+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Servers:" id="ZiY-a9-New">
703704
<font key="font" metaFont="system"/>
704705
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
705706
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -717,10 +718,10 @@
717718
<action selector="urlFieldUsed:" target="nFM-4p-b9o" id="SEP-Bt-H5A"/>
718719
</connections>
719720
</textField>
720-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="CS4-zo-bte">
721-
<rect key="frame" x="283" y="568" width="179" height="17"/>
722-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
723-
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Server's OSC Address Space" id="wJz-f9-6Gd">
721+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="CS4-zo-bte">
722+
<rect key="frame" x="283" y="568" width="468" height="17"/>
723+
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
724+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Server's OSC Address Space:" id="wJz-f9-6Gd">
724725
<font key="font" metaFont="system"/>
725726
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
726727
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -1335,5 +1336,41 @@
13351336
<point key="canvasLocation" x="634" y="181"/>
13361337
</customView>
13371338
<customObject id="B9p-Kb-KZi" customClass="SUUpdater"/>
1339+
<window title="Help Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="rCv-63-EuZ">
1340+
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
1341+
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
1342+
<rect key="contentRect" x="196" y="240" width="699" height="227"/>
1343+
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
1344+
<view key="contentView" misplaced="YES" id="NQV-OE-Yh3">
1345+
<rect key="frame" x="0.0" y="0.0" width="699" height="227"/>
1346+
<autoresizingMask key="autoresizingMask"/>
1347+
<subviews>
1348+
<button verticalHuggingPriority="750" id="xTQ-hK-s9Q">
1349+
<rect key="frame" x="312" y="13" width="75" height="32"/>
1350+
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
1351+
<buttonCell key="cell" type="push" title="Close" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="VXh-aQ-MMW">
1352+
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
1353+
<font key="font" metaFont="system"/>
1354+
</buttonCell>
1355+
<connections>
1356+
<action selector="closeHelp:" target="Voe-Tx-rLC" id="4dN-wf-Beo"/>
1357+
</connections>
1358+
</button>
1359+
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" misplaced="YES" id="5l5-Lq-Jz8">
1360+
<rect key="frame" x="18" y="122" width="663" height="85"/>
1361+
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
1362+
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="TnR-Fu-ULU">
1363+
<font key="font" metaFont="system"/>
1364+
<string key="title">OSCQuery Browser lists the OSCQuery servers it detects, and allows you to browse their address spaces and send data to them.
1365+
1366+
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>
1367+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
1368+
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
1369+
</textFieldCell>
1370+
</textField>
1371+
</subviews>
1372+
</view>
1373+
<point key="canvasLocation" x="41.5" y="604.5"/>
1374+
</window>
13381375
</objects>
13391376
</document>

VVOSCQueryBrowser/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.4.1.0</string>
20+
<string>0.4.2.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>0.4.1.0</string>
22+
<string>0.4.2.0</string>
2323
<key>LSMinimumSystemVersion</key>
2424
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2525
<key>NSHumanReadableCopyright</key>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#import <Cocoa/Cocoa.h>
2+
3+
@interface NSString (NSStringAdditions)
4+
5+
- (NSColor *) rgbaColorFrom8BPCHexContents;
6+
7+
@end
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#import "NSArrayAdditions.h"
2+
#import "NSStringAdditions.h"
3+
4+
@implementation NSString (NSStringAdditions)
5+
6+
- (NSColor *) rgbaColorFrom8BPCHexContents {
7+
const char *cStr = [self UTF8String];
8+
size_t strLen = [self length];
9+
uint32_t parsedInt = 0;
10+
int maxChannelIndex = 3;
11+
uint8_t parsedVals[4] = { 255, 255, 255, 255 };
12+
13+
/*
14+
// this is what the following should equate to, logically
15+
if (strLen == <RGB instead of RGBA, which is technically malformed>) {
16+
parsedVals[0] = (parsedInt >> 16) & 0xFF
17+
parsedVals[1] = (parsedInt >> 8) & 0xFF
18+
parsedVals[2] = (parsedInt >> 0) & 0xFF
19+
}
20+
else {
21+
parsedVals[0] = (parsedInt >> 24) & 0xFF
22+
parsedVals[1] = (parsedInt >> 16) & 0xFF
23+
parsedVals[2] = (parsedInt >> 8) & 0xFF
24+
parsedVals[3] = (parsedInt >> 0) & 0xFF
25+
}
26+
*/
27+
28+
if (*cStr == '#') {
29+
if (strLen==9 || strLen==7) {
30+
parsedInt = strtol(cStr+1, NULL, 16);
31+
if (strLen == 7)
32+
maxChannelIndex = 2;
33+
}
34+
else
35+
return nil;
36+
}
37+
else if (cStr[0]=='0' && (cStr[1]=='x' || cStr[1]=='X')) {
38+
if (strLen==10 || strLen==8) {
39+
parsedInt = strtol(cStr+2, NULL, 16);
40+
if (strLen == 8)
41+
maxChannelIndex = 2;
42+
}
43+
else
44+
return nil;
45+
}
46+
else
47+
return nil;
48+
49+
for (int valIndex=0; valIndex<=maxChannelIndex; ++valIndex) {
50+
int bitShiftAmount = (maxChannelIndex - valIndex) * 8; // 8 bits per channel
51+
parsedVals[valIndex] = (parsedInt >> bitShiftAmount) & 0xFF;
52+
}
53+
NSColor *returnMe = [NSColor
54+
colorWithDeviceRed:((double)parsedVals[0])/255.
55+
green:((double)parsedVals[1])/255.
56+
blue:((double)parsedVals[2])/255.
57+
alpha:((double)parsedVals[3])/255.];
58+
return returnMe;
59+
}
60+
61+
@end

0 commit comments

Comments
 (0)