Skip to content

Commit cf87631

Browse files
author
dsward2
committed
Fix number formatting in CustomTextController text field for sample rate, channels, and buffer sizes to remove commas.
1 parent b960f8f commit cf87631

4 files changed

Lines changed: 104 additions & 95 deletions

File tree

LocalRadio/LocalRadio-Source/Base.lproj/MainMenu.xib

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
33
<dependencies>
4-
<deployment identifier="macosx"/>
54
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
65
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
76
</dependencies>
@@ -1235,7 +1234,7 @@ Gw
12351234
<font key="font" metaFont="system"/>
12361235
<tabViewItems>
12371236
<tabViewItem label="LocalRadio" identifier="" id="8Qy-d0-fpa">
1238-
<view key="view" id="bIe-XZ-nnh">
1237+
<view key="view" ambiguous="YES" id="bIe-XZ-nnh">
12391238
<rect key="frame" x="10" y="33" width="450" height="550"/>
12401239
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
12411240
<subviews>
@@ -1271,7 +1270,7 @@ Gw
12711270
</view>
12721271
</tabViewItem>
12731272
<tabViewItem label="Status" identifier="" id="GvX-g5-9UV">
1274-
<view key="view" ambiguous="YES" id="qnk-kF-EPU">
1273+
<view key="view" id="qnk-kF-EPU">
12751274
<rect key="frame" x="10" y="33" width="450" height="550"/>
12761275
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
12771276
<subviews>
@@ -1287,7 +1286,7 @@ Gw
12871286
<autoresizingMask key="autoresizingMask"/>
12881287
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" id="XFC-hX-hWd">
12891288
<rect key="frame" x="1" y="1" width="432" height="275"/>
1290-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1289+
<autoresizingMask key="autoresizingMask"/>
12911290
<subviews>
12921291
<textView ambiguous="YES" editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="panel" allowsNonContiguousLayout="YES" id="ydX-HH-DPt">
12931292
<rect key="frame" x="0.0" y="0.0" width="432" height="275"/>
@@ -1588,7 +1587,7 @@ Gw
15881587
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
15891588
<buttonCell key="cell" type="push" title="Update" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="1do-GF-fAa">
15901589
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
1591-
<font key="font" metaFont="miniSystem"/>
1590+
<font key="font" metaFont="label" size="9"/>
15921591
</buttonCell>
15931592
<connections>
15941593
<action selector="updateCurrentTasksText:" target="Voe-Tx-rLC" id="9So-Bh-vgM"/>
@@ -1837,7 +1836,7 @@ Gw
18371836
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18381837
<clipView key="contentView" id="aFL-0Q-zBm">
18391838
<rect key="frame" x="1" y="0.0" width="165" height="145"/>
1840-
<autoresizingMask key="autoresizingMask"/>
1839+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18411840
<subviews>
18421841
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="TBE-l0-bdo" viewBased="YES" id="hbf-Oj-gly">
18431842
<rect key="frame" x="0.0" y="0.0" width="165" height="122"/>
@@ -1930,6 +1929,7 @@ Gw
19301929
<rect key="frame" x="32" y="177" width="96" height="19"/>
19311930
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
19321931
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="1qy-0R-rOj">
1932+
<numberFormatter key="formatter" formatterBehavior="custom10_4" allowsFloats="NO" usesGroupingSeparator="NO" formatWidth="-1" groupingSize="0" minimumIntegerDigits="1" maximumIntegerDigits="42" id="KPL-04-Bxp"/>
19331933
<font key="font" metaFont="message" size="11"/>
19341934
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
19351935
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -1953,6 +1953,7 @@ Gw
19531953
<rect key="frame" x="32" y="136" width="96" height="19"/>
19541954
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
19551955
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="vgO-rv-nYP">
1956+
<numberFormatter key="formatter" formatterBehavior="custom10_4" allowsFloats="NO" usesGroupingSeparator="NO" formatWidth="-1" groupingSize="0" minimumIntegerDigits="1" maximumIntegerDigits="42" id="oNB-Mi-RHD"/>
19561957
<font key="font" metaFont="message" size="11"/>
19571958
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
19581959
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -1967,6 +1968,7 @@ Gw
19671968
<rect key="frame" x="30" y="94" width="76" height="19"/>
19681969
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
19691970
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="Y9y-44-ljn">
1971+
<numberFormatter key="formatter" formatterBehavior="custom10_4" allowsFloats="NO" usesGroupingSeparator="NO" formatWidth="-1" groupingSize="0" minimumIntegerDigits="1" maximumIntegerDigits="42" id="qTQ-UZ-BOD"/>
19701972
<font key="font" metaFont="message" size="11"/>
19711973
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
19721974
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -2008,6 +2010,7 @@ Gw
20082010
<rect key="frame" x="30" y="53" width="76" height="19"/>
20092011
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
20102012
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="Xcx-Ut-mw9">
2013+
<numberFormatter key="formatter" formatterBehavior="custom10_4" allowsFloats="NO" usesGroupingSeparator="NO" formatWidth="-1" groupingSize="0" minimumIntegerDigits="1" maximumIntegerDigits="42" id="OkU-Sv-XFW"/>
20112014
<font key="font" metaFont="message" size="11"/>
20122015
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
20132016
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -2052,6 +2055,7 @@ Gw
20522055
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
20532056
<string key="toolTip">Third stage buffer for optional direct output to Core Audio device using Apple's AudioQueue, typically 256 for single channel wide-band FM.</string>
20542057
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="gOH-9w-Xh6">
2058+
<numberFormatter key="formatter" formatterBehavior="custom10_4" allowsFloats="NO" usesGroupingSeparator="NO" formatWidth="-1" groupingSize="0" minimumIntegerDigits="1" maximumIntegerDigits="42" id="OO1-Oq-jAP"/>
20552059
<font key="font" metaFont="message" size="11"/>
20562060
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
20572061
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -2097,7 +2101,7 @@ Gw
20972101
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
20982102
<clipView key="contentView" id="QV0-ek-CJh">
20992103
<rect key="frame" x="1" y="0.0" width="164" height="363"/>
2100-
<autoresizingMask key="autoresizingMask"/>
2104+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21012105
<subviews>
21022106
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="CB4-k0-f8U" viewBased="YES" id="Go3-wO-jgJ">
21032107
<rect key="frame" x="0.0" y="0.0" width="164" height="340"/>
@@ -2203,7 +2207,7 @@ Gw
22032207
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
22042208
<clipView key="contentView" id="caH-Rk-BaD">
22052209
<rect key="frame" x="1" y="0.0" width="165" height="363"/>
2206-
<autoresizingMask key="autoresizingMask"/>
2210+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
22072211
<subviews>
22082212
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="spe-AD-2de" viewBased="YES" id="2yw-Em-uZv">
22092213
<rect key="frame" x="0.0" y="0.0" width="165" height="340"/>
@@ -2305,7 +2309,7 @@ Gw
23052309
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23062310
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" copiesOnScroll="NO" id="qZz-7e-yFC">
23072311
<rect key="frame" x="0.0" y="0.0" width="166" height="340"/>
2308-
<autoresizingMask key="autoresizingMask"/>
2312+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23092313
<subviews>
23102314
<textView ambiguous="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="1tw-0p-xoZ">
23112315
<rect key="frame" x="0.0" y="0.0" width="166" height="340"/>

LocalRadio/LocalRadio-Source/CustomTaskController.m

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,35 +691,40 @@ - (void)updateSampleRateAndChannels
691691
NSDictionary * itemDictionary = [self.allCustomTasksArray objectAtIndex:selectedNameIndex];
692692
if (itemDictionary != NULL)
693693
{
694-
NSString * sampleRateString = [itemDictionary objectForKey:@"sample_rate"];
694+
NSNumber * sampleRateNumber = [itemDictionary objectForKey:@"sample_rate"];
695+
NSString * sampleRateString = [NSString stringWithFormat:@"%ld", sampleRateNumber.integerValue];
695696
if (sampleRateString == NULL)
696697
{
697698
sampleRateString = @"";
698699
}
699700
self.sampleRateTextField.stringValue = sampleRateString;
700701

701-
NSString * channelsString = [itemDictionary objectForKey:@"channels"];
702+
NSNumber * channelsNumber = [itemDictionary objectForKey:@"channels"];
703+
NSString * channelsString = [NSString stringWithFormat:@"%ld", channelsNumber.integerValue];
702704
if (channelsString == NULL)
703705
{
704706
channelsString = @"";
705707
}
706708
self.channelsTextField.stringValue = channelsString;
707709

708-
NSString * inputBufferSizeString = [itemDictionary objectForKey:@"input_buffer_size"];
710+
NSNumber * inputBufferSizeNumber = [itemDictionary objectForKey:@"input_buffer_size"];
711+
NSString * inputBufferSizeString = [NSString stringWithFormat:@"%ld", inputBufferSizeNumber.integerValue];
709712
if (inputBufferSizeString == NULL)
710713
{
711714
inputBufferSizeString = @"256";
712715
}
713716
self.inputBufferSizeTextField.stringValue = inputBufferSizeString;
714717

715-
NSString * audioConverterBufferSizeString = [itemDictionary objectForKey:@"audioconverter_buffer_size"];
718+
NSNumber * audioConverterBufferSizeNumber = [itemDictionary objectForKey:@"audioconverter_buffer_size"];
719+
NSString * audioConverterBufferSizeString = [NSString stringWithFormat:@"%ld", audioConverterBufferSizeNumber.integerValue];
716720
if (audioConverterBufferSizeString == NULL)
717721
{
718722
audioConverterBufferSizeString = @"256";
719723
}
720724
self.audioConverterBufferSizeTextField.stringValue = audioConverterBufferSizeString;
721725

722-
NSString * audioQueueBufferSizeString = [itemDictionary objectForKey:@"audioqueue_buffer_size"];
726+
NSNumber * audioQueueBufferSizeNumber = [itemDictionary objectForKey:@"audioqueue_buffer_size"];
727+
NSString * audioQueueBufferSizeString = [NSString stringWithFormat:@"%ld", audioQueueBufferSizeNumber.integerValue];
723728
if (audioQueueBufferSizeString == NULL)
724729
{
725730
audioQueueBufferSizeString = @"256";

0 commit comments

Comments
 (0)