Skip to content

Commit c0f9914

Browse files
Bill FarmerBill Farmer
authored andcommitted
Remove Xcode, add Makefile - Scope
1 parent a10bca9 commit c0f9914

File tree

8 files changed

+114
-256
lines changed

8 files changed

+114
-256
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<key>CFBundleDevelopmentRegion</key>
66
<string>English</string>
77
<key>CFBundleExecutable</key>
8-
<string>${EXECUTABLE_NAME}</string>
8+
<string>Scope</string>
99
<key>CFBundleGetInfoString</key>
1010
<string>Copyright 2010 Bill Farmer</string>
1111
<key>CFBundleIconFile</key>

Scope/mac/Makefile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
RM=rm
2+
MD=mkdir
3+
CP=cp
4+
5+
GCC=gcc
6+
CFLAGS=-framework Carbon -framework Audiounit -framework CoreAudio \
7+
-framework Accelerate -m32 -Wno-deprecated-declarations \
8+
-mmacosx-version-min=10.6
9+
10+
APPNAME=Scope
11+
12+
APPBUNDLE=$(APPNAME).app
13+
APPBUNDLECONTENTS=$(APPBUNDLE)/Contents
14+
APPBUNDLEMACOS=$(APPBUNDLECONTENTS)/MacOS
15+
APPBUNDLERESOURCES=$(APPBUNDLECONTENTS)/Resources
16+
APPBUNDLEICON=$(APPBUNDLECONTENTS)/Resources
17+
18+
appbundle: $(APPNAME) $(APPNAME).icns
19+
$(RM) -rf $(APPBUNDLE)
20+
$(MD) $(APPBUNDLE)
21+
$(MD) $(APPBUNDLECONTENTS)
22+
$(MD) $(APPBUNDLEMACOS)
23+
$(MD) $(APPBUNDLERESOURCES)
24+
$(CP) Info.plist $(APPBUNDLECONTENTS)/
25+
$(CP) PkgInfo $(APPBUNDLECONTENTS)/
26+
$(CP) $(APPNAME).icns $(APPBUNDLEICON)/
27+
$(CP) -r images $(APPBUNDLERESOURCES)/
28+
$(CP) $(APPNAME) $(APPBUNDLEMACOS)/
29+
30+
$(APPNAME): $(APPNAME).c
31+
$(GCC) $(APPNAME).c -o $(APPNAME) $(CFLAGS)
32+
33+
$(APPNAME).icns: $(APPNAME).png
34+
$(RM) -rf $(APPNAME).iconset
35+
$(MD) $(APPNAME).iconset
36+
sips -z 16 16 $(APPNAME).png --out $(APPNAME).iconset/icon_16x16.png
37+
sips -z 32 32 $(APPNAME).png --out $(APPNAME).iconset/icon_16x16@2x.png
38+
sips -z 32 32 $(APPNAME).png --out $(APPNAME).iconset/icon_32x32.png
39+
sips -z 64 64 $(APPNAME).png --out $(APPNAME).iconset/icon_32x32@2x.png
40+
sips -z 128 128 $(APPNAME).png --out $(APPNAME).iconset/icon_128x128.png
41+
sips -z 256 256 $(APPNAME).png --out $(APPNAME).iconset/icon_128x128@2x.png
42+
sips -z 256 256 $(APPNAME).png --out $(APPNAME).iconset/icon_256x256.png
43+
sips -z 512 512 $(APPNAME).png --out $(APPNAME).iconset/icon_256x256@2x.png
44+
sips -z 512 512 $(APPNAME).png --out $(APPNAME).iconset/icon_512x512.png
45+
$(CP) $(APPNAME).png $(APPNAME).iconset/icon_512x512@2x.png
46+
iconutil -c icns -o $(APPNAME).icns $(APPNAME).iconset
47+
$(RM) -r $(APPNAME).iconset

Scope/mac/PkgInfo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
APPLSCOP

Scope/mac/Scope.c

100644100755
Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ int main(int argc, char *argv[])
292292

293293
// Set menu title
294294

295-
CFStringRef apple =
296-
CFStringCreateWithPascalString(kCFAllocatorDefault,
297-
"\p\024",
298-
kCFStringEncodingMacRoman);
295+
CFStringRef apple = CFSTR("\024");
296+
// CFStringCreateWithPascalString(kCFAllocatorDefault,
297+
// "\p\024",
298+
// kCFStringEncodingMacRoman);
299299

300300
SetMenuTitleWithCFString(menu, apple);
301-
CFRelease(apple);
301+
// CFRelease(apple);
302302

303303
// Create an about item
304304

@@ -1506,20 +1506,27 @@ OSStatus ScopeDrawEventHandler(EventHandlerCallRef next,
15061506
}
15071507
}
15081508

1509-
// Select font
1510-
1511-
CGContextSelectFont(bitmap, "Arial Bold", kTextSize,
1512-
kCGEncodingMacRoman);
1513-
1514-
CGContextSetTextMatrix(bitmap, CGAffineTransformMakeScale(1, -1));
1515-
CGContextSetRGBFillColor(bitmap, 0, 1, 0, 1);
1516-
15171509
// Draw cursor
15181510

15191511
if (scope.index > 0)
15201512
{
15211513
static char s[16];
15221514

1515+
// Select font
1516+
1517+
CGContextSelectFont(bitmap, "Arial Bold", kTextSize,
1518+
kCGEncodingMacRoman);
1519+
1520+
CGContextSetTextMatrix(bitmap, CGAffineTransformMakeScale(1, -1));
1521+
1522+
// Yellow text
1523+
1524+
CGContextSetRGBFillColor(bitmap, 1, 1, 0, 1);
1525+
1526+
// Yellow trace
1527+
1528+
CGContextSetRGBStrokeColor(bitmap, 1, 1, 0, 1);
1529+
15231530
CGContextBeginPath(bitmap);
15241531
CGContextMoveToPoint(bitmap, scope.index, -height / 2);
15251532
CGContextAddLineToPoint(bitmap, scope.index, height / 2);
@@ -1559,6 +1566,40 @@ OSStatus ScopeDrawEventHandler(EventHandlerCallRef next,
15591566
return noErr;
15601567
}
15611568

1569+
// Pane draw event handler
1570+
1571+
// OSStatus PaneDrawEventHandler(EventHandlerCallRef next,
1572+
// EventRef event, void *data)
1573+
// {
1574+
// CGContextRef context;
1575+
// HIViewRef view;
1576+
// HIRect bounds;
1577+
1578+
// // Get context
1579+
1580+
// GetEventParameter(event, kEventParamCGContextRef,
1581+
// typeCGContextRef, NULL,
1582+
// sizeof(context), NULL,
1583+
// &context);
1584+
// // Get view
1585+
1586+
// GetEventParameter(event, kEventParamDirectObject,
1587+
// typeControlRef, NULL,
1588+
// sizeof(view), NULL,
1589+
// &view);
1590+
// // Get bounds
1591+
1592+
// HIViewGetBounds(view, &bounds);
1593+
// CGContextSetGrayFillColor(context, 1, 0.9);
1594+
// CGContextFillRect(context, bounds);
1595+
1596+
// CGContextSetGrayStrokeColor(context, 0.8, 0.9);
1597+
// CGContextSetLineWidth(context, 3);
1598+
// CGContextStrokeRect(context, bounds);
1599+
1600+
// return noErr;
1601+
// }
1602+
15621603
// Command event handler
15631604

15641605
OSStatus CommandEventHandler(EventHandlerCallRef next, EventRef event,

Scope/mac/Scope.icns

166 KB
Binary file not shown.

Scope/mac/Scope.png

97.8 KB
Loading

Scope/mac/Scope.rtf

100644100755
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
2-
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;}
1+
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210
2+
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
33
{\colortbl;\red255\green255\blue255;}
44
\paperw11900\paperh16840\vieww12000\viewh15840\viewkind0
55
\deftab720
66
\pard\pardeftab720\qc
77

88
\f0\b\fs24 \cf0 Audio Oscilloscope\
9-
\pard\pardeftab720\ql\qnatural
9+
\pard\pardeftab720
1010
11-
\f1\b0 \cf0 \
11+
\b0 \cf0 \
1212
Audio oscilloscope. Timebase from 0.1 ms to 0.5 sec. Input level control, single shot, sync polarity control, storage mode and cursor.\
1313
\
1414

15-
\f0\b Using
16-
\f1\b0 \
15+
\b Using
16+
\b0 \
1717
\
1818
Use the toolbar buttons to access functionality. From left to right: Input level control, bright line turns off sync, single shot, trigger, sync polarity, timebase menu, storage mode, display clear, shift left, shift right, shift to start, shift to end, reset. Clicking on the scope display turns on the cursor line, which may be shifted left and right using the left and right arrow keys. The cursor line shows the time from the start of the trace in current timebase units, and the nominal trace value at that point. There is no calibration because of the various level controls in the audio system. The shift to start and reset toolbar buttons clear the cursor.\
1919
\
2020

21-
\f0\b Files
22-
\f1\b0 \
21+
\b Files
22+
\b0 \
2323
\
2424
Changes - Change log\
2525
COPYING - Licence file\
26+
Makefile - Makefile\
2627
Scope.c - Source file\
2728
Scope.app - Application\
2829
Scope.icns - Icon file\
2930
Scope.info - Info file\
3031
Scope.rtf - This file\
31-
Scope.xcodeproj - Xcode project file\
3232
images/ - Images for toolbar\
3333
\
3434

35-
\f0\b Building
36-
\f1\b0 \
35+
\b Building
36+
\b0 \
3737
\
3838
Use Xcode to build.\
3939
\

0 commit comments

Comments
 (0)