scopeapp-cvs Mailing List for MacCRO X (Page 6)
Status: Alpha
Brought to you by:
narge
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(8) |
Jul
(52) |
Aug
(3) |
Sep
|
Oct
(7) |
Nov
(1) |
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(10) |
Feb
(75) |
Mar
|
Apr
(17) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(11) |
Dec
|
From: <sco...@li...> - 2002-12-08 07:28:10
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv14816 Modified Files: Tag: scopeapp-gnustep ScopeView.m Log Message: Some bits are (c) by me, yay. Index: ScopeView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.m,v retrieving revision 1.11.2.3 retrieving revision 1.11.2.4 diff -C2 -d -r1.11.2.3 -r1.11.2.4 *** ScopeView.m 6 Dec 2002 15:05:12 -0000 1.11.2.3 --- ScopeView.m 8 Dec 2002 07:28:07 -0000 1.11.2.4 *************** *** 5,8 **** --- 5,9 ---- // Created by narge on Tue Nov 27 2001. // Copyright (c) 2001, 2002 Philip Derrin. + // Copyright (c) 2002 Rafal Kolanski. // // This file is part of MacCRO X. |
From: <sco...@li...> - 2002-12-08 07:26:25
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv14307 Modified Files: Tag: scopeapp-gnustep TraceView.m Log Message: New display method executable as main thread. The call is still commented out (gnustep bug?) Index: TraceView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/TraceView.m,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** TraceView.m 19 Oct 2002 06:39:31 -0000 1.5 --- TraceView.m 8 Dec 2002 07:26:21 -0000 1.5.2.1 *************** *** 49,52 **** --- 49,54 ---- - (void)displayThread: (id) unused; + - (void)display: (id)unused; + @end *************** *** 334,340 **** --- 336,351 ---- #else [self setNeedsDisplay: YES]; + + // FIXME update gnustep to make this work + //[self performSelectorOnMainThread:@selector(display:) withObject:nil waitUntilDone:YES]; + #endif [myDrawThreadState unlock]; } + } + + - (void)display: (id) unused + { + [self display]; } |
From: <sco...@li...> - 2002-12-07 07:46:24
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv7486 Modified Files: Tag: scopeapp-gnustep ScopeAppGlobals.h Log Message: Redefinition of "_" is not necessary on GNUstep. Already in NSBundle.h Index: ScopeAppGlobals.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeAppGlobals.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** ScopeAppGlobals.h 19 Oct 2002 06:39:31 -0000 1.2 --- ScopeAppGlobals.h 7 Dec 2002 07:46:07 -0000 1.2.2.1 *************** *** 4,8 **** * * Created by Philip Derrin on Fri Jul 19 2002. ! * Copyright (c) 2002 Philip Derrin. All rights reserved. * */ --- 4,8 ---- * * Created by Philip Derrin on Fri Jul 19 2002. ! * Copyright (c) 2002 Philip Derrin and Rafal Kolanski. All rights reserved. * */ *************** *** 12,16 **** --- 12,18 ---- // Strings labelled this way are easy to find using // a perl script, to auto-generate Localizable.strings + #ifdef __APPLE__ #define _(key) [[NSBundle mainBundle] localizedStringForKey:(key) value:key table:nil] + #endif // vim:syn=objc:nocin:si: |
From: <sco...@li...> - 2002-12-06 15:06:35
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv1029 Modified Files: Tag: scopeapp-gnustep ScopeController.m Log Message: Fixed problems with badly initialised and strangely sized tabs and TabViewItems. Index: ScopeController.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeController.m,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** ScopeController.m 29 Oct 2002 05:15:13 -0000 1.8.2.1 --- ScopeController.m 6 Dec 2002 15:06:32 -0000 1.8.2.2 *************** *** 78,82 **** [myXYPlotView retain]; [myControlPanel retain]; ! [myControlPanel orderWindow: NSWindowAbove relativeTo: [[self window] windowNumber]]; --- 78,82 ---- [myXYPlotView retain]; [myControlPanel retain]; ! [myControlPanel orderWindow: NSWindowAbove relativeTo: [[self window] windowNumber]]; *************** *** 89,93 **** [myModeTabs selectTabViewItem: myScopeTab]; [self tabView: myModeTabs didSelectTabViewItem: myScopeTab]; ! [myModeTabs setDelegate: self]; } --- 89,93 ---- [myModeTabs selectTabViewItem: myScopeTab]; [self tabView: myModeTabs didSelectTabViewItem: myScopeTab]; ! [myModeTabs setDelegate: self]; } *************** *** 120,124 **** // assert that the tab view that has been switched is the mode tabs if(tabView != myModeTabs) { return; } ! // stop the view which is currently drawing [myScopeView stopDrawing]; --- 120,124 ---- // assert that the tab view that has been switched is the mode tabs if(tabView != myModeTabs) { return; } ! // stop the view which is currently drawing [myScopeView stopDrawing]; *************** *** 154,158 **** NSRect rect = NSMakeRect(0, 0, 400, 400); unsigned int flags; ! // create the window flags = (NSTitledWindowMask | NSClosableWindowMask | --- 154,158 ---- NSRect rect = NSMakeRect(0, 0, 400, 400); unsigned int flags; ! // create the window flags = (NSTitledWindowMask | NSClosableWindowMask | *************** *** 209,227 **** // Create the mode tab view ! rect = NSMakeRect(-11, -7, 735, 372); myModeTabs = [[NSTabView alloc] initWithFrame: rect]; - [[myControlPanel contentView] addSubview: myModeTabs]; // add and populate the tabs myScopeTab = [[NSTabViewItem alloc] init]; [myScopeTab setLabel: _(@"Oscilloscope")]; [myScopeView createControls: [myScopeTab view]]; - [myModeTabs addTabViewItem: myScopeTab]; myXYPlotTab = [[NSTabViewItem alloc] init]; [myXYPlotTab setLabel: _(@"X/Y Plot")]; [myXYPlotView createControls: [myXYPlotTab view]]; [myModeTabs addTabViewItem: myXYPlotTab]; return self; } --- 209,238 ---- // Create the mode tab view ! rect = NSMakeRect(0, 0, 735, 372); myModeTabs = [[NSTabView alloc] initWithFrame: rect]; // add and populate the tabs myScopeTab = [[NSTabViewItem alloc] init]; [myScopeTab setLabel: _(@"Oscilloscope")]; + [myScopeTab setView:[[NSView alloc] init]]; [myScopeView createControls: [myScopeTab view]]; myXYPlotTab = [[NSTabViewItem alloc] init]; [myXYPlotTab setLabel: _(@"X/Y Plot")]; + [myXYPlotTab setView:[[NSView alloc] init]]; [myXYPlotView createControls: [myXYPlotTab view]]; + + [myModeTabs addTabViewItem: myScopeTab]; [myModeTabs addTabViewItem: myXYPlotTab]; + [myModeTabs selectTabViewItem: myScopeTab]; + [[myControlPanel contentView] addSubview: myModeTabs]; + + // FIXME the tabs still look screwed up until a selection is made + // by the user. probably a gnustep problem. + + rect = [[myScopeTab view] frame]; + NSLog(@"myScopeTab frame: %@", NSStringFromRect(rect)); + return self; } |
From: <sco...@li...> - 2002-12-06 15:05:16
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv561 Modified Files: Tag: scopeapp-gnustep ScopeView.m Log Message: Fixed the problem with badly initialized views in TabViewItems. Index: ScopeView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.m,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -C2 -d -r1.11.2.2 -r1.11.2.3 *** ScopeView.m 12 Nov 2002 23:33:42 -0000 1.11.2.2 --- ScopeView.m 6 Dec 2002 15:05:12 -0000 1.11.2.3 *************** *** 28,38 **** #import "ScopeAppGlobals.h" - //#ifdef __APPLE__ - //#import "GSVbox.h" - //#import "GSHbox.h" - //#endif - #import <AppKit/GSHbox.h> - #import <AppKit/GSVbox.h> - static double gTimeScales[10] = {0.001,0.002,0.005,0.01,0.02,0.05,0.1}; static double gVoltScales[7] = {0.01,0.02,0.05,0.1,0.2,0.5,1}; --- 28,31 ---- *************** *** 366,375 **** NSSlider* slider; NSTextField* text; - NSTextField* genericText; - NSTextField* genericSmallText; - NSTextFieldCell* genericTextCell; NSMatrix* matrix; - NSButtonCell* genericRadio; - NSButton* genericCheckbox; NSControl* previousControl; GSVbox* bigVbox; --- 359,363 ---- *************** *** 378,412 **** GSHbox* smallHbox; - /* first create our "generic" controls; these are - * duplicated with -[NSObject copy] to create - * real ones */ - genericText = [[NSTextField alloc] init]; - [genericText setSelectable: NO]; - [genericText setEditable: NO]; - - genericSmallText = [genericText copy]; - [genericSmallText setControlSize: NSSmallControlSize]; - [genericSmallText setFont: - [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; - - genericTextCell = [[NSTextFieldCell alloc] init]; - [genericTextCell setSelectable: NO]; - [genericTextCell setEditable: NO]; - [genericSmallText setControlSize: NSSmallControlSize]; - [genericTextCell setFont: - [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; - - genericRadio = [[NSButtonCell alloc] init]; - [genericRadio setButtonType: NSRadioButton]; - [genericRadio setControlSize: NSSmallControlSize]; - [genericRadio setFont: - [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; - - genericCheckbox = [[NSButton alloc] init]; - [genericCheckbox setButtonType: NSSwitchButton]; - [genericCheckbox setControlSize: NSSmallControlSize]; - [genericCheckbox setFont: - [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; - /* the "big" boxes are the top-level ones */ /* bigVbox is the highest-level box */ --- 366,369 ---- *************** *** 416,420 **** /* bigHbox is the current row in bigVbox */ bigHbox = [GSHbox new]; ! [bigHbox setHBorder: 20]; /* smallVbox is the current column in bigHbox */ --- 373,377 ---- /* bigHbox is the current row in bigVbox */ bigHbox = [GSHbox new]; ! //[bigHbox setHBorder: 20]; /* smallVbox is the current column in bigHbox */ *************** *** 422,437 **** /* Offset controls */ ! text = [genericText copy]; ! [text setTitle: _(@"Offsets")]; [smallVbox addView: text withMinYMargin: 12]; smallHbox = [GSHbox new]; ! text = [genericSmallText copy]; ! [text setTitle: _(@"A")]; [smallHbox addView: text]; ! text = [genericSmallText copy]; ! [text setTitle: _(@"B")]; [smallHbox addView: text]; --- 379,403 ---- /* Offset controls */ ! text = [[NSTextField alloc] init]; ! [text setSelectable: NO]; ! [text setEditable: NO]; ! [text setTitleWithMnemonic: _(@"Offsets")]; ! [text sizeToFit]; [smallVbox addView: text withMinYMargin: 12]; smallHbox = [GSHbox new]; ! text = [[NSTextField alloc] init]; ! [text setSelectable: NO]; ! [text setEditable: NO]; ! [text setTitleWithMnemonic: _(@"A")]; ! [text sizeToFit]; [smallHbox addView: text]; ! text = [[NSTextField alloc] init]; ! [text setSelectable: NO]; ! [text setEditable: NO]; ! [text setTitleWithMnemonic: _(@"B")]; ! [text sizeToFit]; [smallHbox addView: text]; *************** *** 443,453 **** [parentView addSubview: bigVbox]; ! ! [genericCheckbox release]; ! [genericRadio release]; ! [genericText release]; ! [genericTextCell release]; ! [genericSmallText release]; ! return self; } --- 409,413 ---- [parentView addSubview: bigVbox]; ! return self; } |
From: <sco...@li...> - 2002-12-06 15:04:27
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv32743 Modified Files: Tag: scopeapp-gnustep ScopeView.h Log Message: Fixed header so it doesn't break OSX. Index: ScopeView.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.h,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** ScopeView.h 19 Oct 2002 06:39:31 -0000 1.8 --- ScopeView.h 6 Dec 2002 15:04:23 -0000 1.8.2.1 *************** *** 28,31 **** --- 28,39 ---- #import "TraceView.h" + #ifdef __APPLE__ + #import "GSVbox.h" + #import "GSHbox.h" + #else + #import <AppKit/GSHbox.h> + #import <AppKit/GSVbox.h> + #endif + @interface ScopeView : TraceView { // **** Controls **** |
From: <sco...@li...> - 2002-12-05 15:17:12
|
Update of /cvsroot/scopeapp/scopeapp/MacCRO X.pbproj In directory sc8-pr-cvs1:/tmp/cvs-serv20947/MacCRO X.pbproj Modified Files: project.pbxproj Log Message: Update to include the new PortAudio source files, and remove the obsolete Quicktime and Core Audio code. |
From: <sco...@li...> - 2002-12-05 15:15:52
|
Update of /cvsroot/scopeapp/scopeapp In directory sc8-pr-cvs1:/tmp/cvs-serv20662 Modified Files: Readme.rtf Todo.rtf Log Message: Update to reflect current state of the code. Index: Readme.rtf =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/Readme.rtf,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Readme.rtf 19 Jun 2002 11:48:03 -0000 1.3 --- Readme.rtf 5 Dec 2002 15:15:48 -0000 1.4 *************** *** 1,3 **** ! {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Optima-Bold;\f1\fswiss\fcharset77 Optima-Regular;\f2\fmodern\fcharset77 Courier; } --- 1,3 ---- ! {\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Optima-Bold;\f1\fswiss\fcharset77 Optima-Regular;\f2\fmodern\fcharset77 Courier; } *************** *** 22,26 **** \f1\b0 \ \ ! There are many areas where the code is incomplete. The spectrum analyser and lissajous are not implemented at all, and the sound input code isn't very well tested. The oscilloscope is implemented but doesn't work properly yet. There is no ASIO sound input driver; however, new ones have been added for CoreAudio and a dummy (TestSampler) which outputs a sine wave.\ \ --- 22,30 ---- \f1\b0 \ \ ! There are many areas where the code is incomplete.The sound input code isn't very well tested. The display code is implemented but doesn't work properly yet. See\ ! \ ! The sound input code now uses PortAudio (www.portaudio.com), which uses CoreAudio on Mac OS X. I have included the relevant bits of portaudio in this source distribution, so you don't need to download it separately.\ ! \ ! The linux port is currently branched in cvs. This is not it. If you want to try it out, please check out from Sourceforge's cvs server using the tag "gnustep-branch".\ \ Index: Todo.rtf =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/Todo.rtf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Todo.rtf 29 Jul 2002 09:57:26 -0000 1.1 --- Todo.rtf 5 Dec 2002 15:15:48 -0000 1.2 *************** *** 1,3 **** ! {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Optima-Bold;\f1\fswiss\fcharset77 Optima-Regular;\f2\fmodern\fcharset77 Courier; } --- 1,3 ---- ! {\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Optima-Bold;\f1\fswiss\fcharset77 Optima-Regular;\f2\fmodern\fcharset77 Courier; } *************** *** 13,21 **** \f1\b0 \'a5 Debug the code that creates the trace window. In particular, position the window correctly.\ \'a5 Test & debug the oscilloscope and X/Y plot modes.\ - \'a5 Test & debug CoreAudioSampler and remove QuicktimeSampler once the Core Audio code works well.\ \'a5 Spectrum analyser.\ ! \'a5 Finish the control panel. This just involves turning the existing nib files into objective-C code.\ ! \'a5 Main menu in gnustep.\ \'a5 Fix the problem with display updates in gnustep.\ \ --- 13,20 ---- \f1\b0 \'a5 Debug the code that creates the trace window. In particular, position the window correctly.\ \'a5 Test & debug the oscilloscope and X/Y plot modes.\ \'a5 Spectrum analyser.\ ! \'a5 Finish the control panel.\ \'a5 Fix the problem with display updates in gnustep.\ + \'a5 About box, including GPL text.\ \ |
From: <sco...@li...> - 2002-12-05 15:15:01
|
Update of /cvsroot/scopeapp/scopeapp In directory sc8-pr-cvs1:/tmp/cvs-serv20112 Modified Files: License.rtf Log Message: Include PortAudio license. Index: License.rtf =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/License.rtf,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** License.rtf 5 Dec 2002 14:07:43 -0000 1.4 --- License.rtf 5 Dec 2002 15:14:55 -0000 1.5 *************** *** 1,12 **** {\rtf1\mac\ansicpg10000\cocoartf102 ! {\fonttbl\f0\fswiss\fcharset77 Optima-Bold;\f1\fswiss\fcharset77 Optima-Regular;\f2\fmodern\fcharset77 Courier; \f3\fswiss\fcharset77 Helvetica;\f4\fmodern\fcharset77 Courier-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\b\fs42 \cf0 \ul GNU GENERAL PUBLIC LICENSE\ulnone \ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1\b0\fs28 \cf0 \ Version 2, June 1991\ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural --- 1,18 ---- {\rtf1\mac\ansicpg10000\cocoartf102 ! {\fonttbl\f0\fswiss\fcharset77 Optima-Regular;\f1\fswiss\fcharset77 Optima-Bold;\f2\fmodern\fcharset77 Courier; \f3\fswiss\fcharset77 Helvetica;\f4\fmodern\fcharset77 Courier-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\fs28 \cf0 MacCRO X is released under the GNU General Public License (GPL). However, it includes some components of PortAudio (http://www.portaudio.com/), which is distributed under a slightly modified version of the Expat license. The texts of both licenses follow.\ ! \ ! The PortAudio license applies to the files stored in the src/portaudio subdirectory of the source distribution. All other files are covered by the GPL.\ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1\b\fs42 \cf0 \ul \ ! GNU GENERAL PUBLIC LICENSE\ulnone \ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f0\b0\fs28 \cf0 \ Version 2, June 1991\ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural *************** *** 24,31 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\b\fs42 \cf0 \ul Preamble\ulnone \ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1\b0\fs28 \cf0 \ The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.\ \ --- 30,37 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1\b\fs42 \cf0 \ul Preamble\ulnone \ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\b0\fs28 \cf0 \ The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.\ \ *************** *** 48,81 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\b\fs42 \cf0 \ul TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\ulnone \ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural \fs28 \cf0 \ 0. ! \f1\b0 This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".\ \ Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.\ ! \f0\b \ 1. ! \f1\b0 You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.\ \ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\ ! \f0\b \ 2. ! \f1\b0 You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\ \ \'a5 ! \f0\b a) ! \f1\b0 You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. \ \ \'a5 ! \f0\b b) ! \f1\b0 You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. \ \ \'a5 ! \f0\b c) ! \f1\b0 If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)\ \ These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. \ --- 54,87 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1\b\fs42 \cf0 \ul TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\ulnone \ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural \fs28 \cf0 \ 0. ! \f0\b0 This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".\ \ Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.\ ! \f1\b \ 1. ! \f0\b0 You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.\ \ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\ ! \f1\b \ 2. ! \f0\b0 You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\ \ \'a5 ! \f1\b a) ! \f0\b0 You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. \ \ \'a5 ! \f1\b b) ! \f0\b0 You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. \ \ \'a5 ! \f1\b c) ! \f0\b0 If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)\ \ These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. \ *************** *** 85,103 **** In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\ ! \f0\b \ 3. ! \f1\b0 You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:\ \ \'a5 ! \f0\b a) ! \f1\b0 Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, \ \ \'a5 ! \f0\b b) ! \f1\b0 Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, \ \ \'a5 ! \f0\b c) ! \f1\b0 Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)\ \ The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. \ --- 91,109 ---- In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\ ! \f1\b \ 3. ! \f0\b0 You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:\ \ \'a5 ! \f1\b a) ! \f0\b0 Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, \ \ \'a5 ! \f1\b b) ! \f0\b0 Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, \ \ \'a5 ! \f1\b c) ! \f0\b0 Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)\ \ The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. \ *************** *** 105,123 **** If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.\ ! \f0\b \ 4. ! \f1\b0 You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\ ! \f0\b \ 5. ! \f1\b0 You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.\ ! \f0\b \ 6. ! \f1\b0 Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.\ ! \f0\b \ 7. ! \f1\b0 If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.\ \ If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.\ --- 111,129 ---- If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.\ ! \f1\b \ 4. ! \f0\b0 You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\ ! \f1\b \ 5. ! \f0\b0 You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.\ ! \f1\b \ 6. ! \f0\b0 Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.\ ! \f1\b \ 7. ! \f0\b0 If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.\ \ If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.\ *************** *** 127,155 **** This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\ ! \f0\b \ 8. ! \f1\b0 If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.\ ! \f0\b \ 9. ! \f1\b0 The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\ \ Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.\ ! \f0\b \ 10. ! \f1\b0 If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\ ! \f0\b \ NO WARRANTY ! \f1\b0 \ ! \f0\b \ 11. ! \f1\b0 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\ ! \f0\b \ 12. ! \f1\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural --- 133,161 ---- This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\ ! \f1\b \ 8. ! \f0\b0 If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.\ ! \f1\b \ 9. ! \f0\b0 The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\ \ Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.\ ! \f1\b \ 10. ! \f0\b0 If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\ ! \f1\b \ NO WARRANTY ! \f0\b0 \ ! \f1\b \ 11. ! \f0\b0 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\ ! \f1\b \ 12. ! \f0\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural *************** *** 157,161 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\b\fs42 \cf0 END OF TERMS AND CONDITIONS\ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural --- 163,167 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1\b\fs42 \cf0 END OF TERMS AND CONDITIONS\ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural *************** *** 163,170 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\b\fs42 \cf0 \ul How to Apply These Terms to Your New Programs\ulnone \ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1\b0\fs28 \cf0 \ If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\ \ --- 169,176 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1\b\fs42 \cf0 \ul How to Apply These Terms to Your New Programs\ulnone \ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\b0\fs28 \cf0 \ If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\ \ *************** *** 199,203 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1 \cf0 \CocoaLigature1 \ Also add information on how to contact you by electronic and paper mail.\ \ --- 205,209 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0 \cf0 \CocoaLigature1 \ Also add information on how to contact you by electronic and paper mail.\ \ *************** *** 218,231 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1 \cf0 \CocoaLigature1 \ The hypothetical commands \f2 `show w' ! \f1 and \f2 `show c' ! \f1 should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than \f2 `show w' ! \f1 and \f2 `show c' ! \f1 ; they could even be mouse-clicks or menu items--whatever suits your program.\ \ You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:\ --- 224,237 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0 \cf0 \CocoaLigature1 \ The hypothetical commands \f2 `show w' ! \f0 and \f2 `show c' ! \f0 should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than \f2 `show w' ! \f0 and \f2 `show c' ! \f0 ; they could even be mouse-clicks or menu items--whatever suits your program.\ \ You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:\ *************** *** 246,251 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1 \cf0 \CocoaLigature1 \ This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. \ \ \ --- 252,274 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0 \cf0 \CocoaLigature1 \ This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. \ + \ + \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural + + \f1\b\fs42 \cf0 \ul PORTAUDIO LICENSE\ulnone \ + \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural + + \f0\b0\fs28 \cf0 \ + PortAudio Portable Real-Time Audio Library\ + Copyright (c) 1999-2000 Ross Bencina and Phil Burk \ + \ + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\ + \ + \'a5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\ + \'a5 Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version.\ + \ + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ON INFRINGEMENT.\ + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\ \ \ |
From: <sco...@li...> - 2002-12-05 15:09:50
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv16241 Modified Files: ScopeAppDelegate.m Log Message: Now uses the real sound input by default Index: ScopeAppDelegate.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeAppDelegate.m,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ScopeAppDelegate.m 29 Oct 2002 06:10:43 -0000 1.15 --- ScopeAppDelegate.m 5 Dec 2002 15:09:47 -0000 1.16 *************** *** 29,33 **** #import "ScopeController.h" #import "InputSampler.h" ! #import "TestSampler.h" @implementation ScopeAppDelegate --- 29,33 ---- #import "ScopeController.h" #import "InputSampler.h" ! #import "PortAudioSampler.h" @implementation ScopeAppDelegate *************** *** 39,43 **** // FIXME choose an appropriate InputSampler ! sampler = [[TestSampler alloc] init]; if(sampler) --- 39,43 ---- // FIXME choose an appropriate InputSampler ! sampler = [[PortAudioSampler alloc] init]; if(sampler) |
From: <sco...@li...> - 2002-12-05 15:08:13
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv14147 Modified Files: InputSampler.h ScopeView.h ScopeView.m TraceView.h TraceView.m TestSampler.m Log Message: InputHandler's processData method now requires interleaved audio data rather than one array per channel Index: InputSampler.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/InputSampler.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** InputSampler.h 19 Oct 2002 06:39:31 -0000 1.5 --- InputSampler.h 5 Dec 2002 15:08:10 -0000 1.6 *************** *** 35,42 **** // Process the given blocks of data from the given input sampler. ! // inData points to an array of pointers to arrays of Sample // Warning: this function must be thread-safe, as it may be called from // the sampler's thread. ! -(id) processData: (Sample**) inData length: (unsigned long) frameCount channels: (int) channelCount --- 35,42 ---- // Process the given blocks of data from the given input sampler. ! // inData points to an interleaved array of Samples. // Warning: this function must be thread-safe, as it may be called from // the sampler's thread. ! -(id) processData: (Sample*) inData length: (unsigned long) frameCount channels: (int) channelCount Index: ScopeView.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ScopeView.h 29 Oct 2002 05:50:11 -0000 1.9 --- ScopeView.h 5 Dec 2002 15:08:10 -0000 1.10 *************** *** 80,84 **** -(id) updateControls; ! - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos --- 80,84 ---- -(id) updateControls; ! - (id)doTriggerOnData: (Sample*) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos Index: ScopeView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.m,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ScopeView.m 29 Oct 2002 06:10:43 -0000 1.13 --- ScopeView.m 5 Dec 2002 15:08:10 -0000 1.14 *************** *** 65,77 **** }; - @interface ScopeView (ScopeViewInternal) - - - (id)doTriggerChannelOnData: (Sample*) inData - frameCount: (unsigned long) inFrameCount - atPosition: (unsigned long*) outTriggerPos - didTrigger: (BOOL*) outTriggered; - - @end - @implementation ScopeView --- 65,68 ---- *************** *** 352,356 **** } ! - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos --- 343,347 ---- } ! - (id)doTriggerOnData: (Sample*) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos *************** *** 360,374 **** return self; } - - @end - - @implementation ScopeView (ScopeViewInternal) - - /* - - (id)doTriggerChannelOnData: (Sample*) inData - frameCount: (unsigned long) inFrameCount - atPosition: (unsigned long*) outTriggerPos - didTrigger: (BOOL*) outTriggered; - */ @end --- 351,354 ---- Index: TraceView.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/TraceView.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TraceView.h 19 Oct 2002 06:39:31 -0000 1.3 --- TraceView.h 5 Dec 2002 15:08:10 -0000 1.4 *************** *** 67,71 **** -(id) updateDisplay: (int) trace; ! - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos --- 67,71 ---- -(id) updateDisplay: (int) trace; ! - (id)doTriggerOnData: (Sample*) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos Index: TraceView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/TraceView.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TraceView.m 29 Oct 2002 05:50:11 -0000 1.6 --- TraceView.m 5 Dec 2002 15:08:10 -0000 1.7 *************** *** 208,212 **** } ! -(id) processData: (Sample**) inData length: (unsigned long) frameCount channels: (int) channelCount --- 208,212 ---- } ! -(id) processData: (Sample*) inData length: (unsigned long) frameCount channels: (int) channelCount *************** *** 236,239 **** --- 236,242 ---- { unsigned long newCollectedSize; + unsigned long i; + Sample* source; + Sample* dest; if(!hasTriggered[curChannel]) *************** *** 251,258 **** { newCollectedSize = myDataWanted[curChannel]; } ! memcpy(myCollectedData[curChannel] + myDataCollected[curChannel], ! inData[curChannel] + theTriggerPoint[curChannel], ! (newCollectedSize - myDataCollected[curChannel]) ! * sizeof(Sample)); myDataCollected[curChannel] = newCollectedSize; --- 254,265 ---- { newCollectedSize = myDataWanted[curChannel]; } ! source = inData + curChannel; ! dest = myCollectedData[curChannel] + ! myDataCollected[curChannel]; ! for(i=myDataCollected[curChannel]; i < newCollectedSize; i++) ! { ! *(dest++) = *source; ! source += channelCount; ! } myDataCollected[curChannel] = newCollectedSize; *************** *** 269,273 **** } ! - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos --- 276,280 ---- } ! - (id)doTriggerOnData: (Sample*) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos Index: TestSampler.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/TestSampler.m,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestSampler.m 19 Oct 2002 06:39:31 -0000 1.7 --- TestSampler.m 5 Dec 2002 15:08:10 -0000 1.8 *************** *** 183,187 **** { int curChannel; ! Sample* theData[myChannelCount]; unsigned long curSample; float amplitude = (float)random() / (float)INT_MAX; --- 183,187 ---- { int curChannel; ! Sample* theData; unsigned long curSample; float amplitude = (float)random() / (float)INT_MAX; *************** *** 191,203 **** if(myOwner == nil) return self; ! for(curChannel = 0; curChannel < myChannelCount; curChannel++) ! { ! theData[curChannel] = malloc(myBlockSize * sizeof(Sample)); ! for(curSample = 0; curSample < myBlockSize; curSample++) ! { ! theData[curChannel][curSample] = sin((M_PI * 2) * ((float)curSample * myFrequency / mySampleRate)) * amplitude; - // theData[curChannel][curSample] = (float)((curSample * 65537) % 19) / 19.0; } } --- 191,202 ---- if(myOwner == nil) return self; ! theData = malloc(myBlockSize * myChannelCount * sizeof(Sample)); ! ! for(curChannel = 0; curChannel < myChannelCount; curChannel++) { ! for(curSample = 0; curSample < myBlockSize; curSample++) { ! theData[(curSample * myChannelCount) + curChannel] ! = sin((M_PI * 2) * ((float)curSample * myFrequency / mySampleRate)) * amplitude; } } *************** *** 207,214 **** fromSampler: self]; ! for(curChannel = 0; curChannel < myChannelCount; curChannel++) ! { ! free(theData[curChannel]); ! } return self; --- 206,210 ---- fromSampler: self]; ! free(theData); return self; |
From: <sco...@li...> - 2002-12-05 15:04:42
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv12347 Removed Files: QuicktimeSampler.m QuicktimeSampler.h CoreAudioSampler.m CoreAudioSampler.h Log Message: Remove obsolete Quicktime and CoreAudio samplers (replaced by PortAudioSampler) --- QuicktimeSampler.m DELETED --- --- QuicktimeSampler.h DELETED --- --- CoreAudioSampler.m DELETED --- --- CoreAudioSampler.h DELETED --- |
From: <sco...@li...> - 2002-12-05 15:03:41
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv11699 Added Files: PortAudioSampler.h PortAudioSampler.m Log Message: Add new InputSampler using the PortAudio library --- NEW FILE: PortAudioSampler.h --- // // PortAudioSampler.h // MacCRO X // // Created by Philip Derrin on Thu Dec 05 2002. // Copyright (c) 2002 Philip Derrin. // // This file is part of MacCRO X. // // MacCRO X is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // MacCRO X is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with MacCRO X; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // $Header: /cvsroot/scopeapp/scopeapp/src/PortAudioSampler.h,v 1.1 2002/12/05 15:03:37 narge Exp $ // #import <Foundation/Foundation.h> #import "InputSampler.h" #include "portaudio.h" @interface PortAudioSampler : NSObject <InputSampler> { // InputSampler data id <InputHandler, NSObject> myOwner; int myBlockSize; float mySampleRate; unsigned short myChannelCount; BOOL mySamplerRunning; // portaudio data PortAudioStream* myStream; } -(id) init; // init a sampler with a given owner object -(id) initWithOwner: (id <InputHandler>) owner; -(void) dealloc; // return YES if the sampler has an input settings dialog it can show -(BOOL) canShowInputSettings; // show the input settings dialog -(id) showInputSettings; // return YES if the sampler can show a dialog to choose between multiple // sources -(BOOL) canShowChooseSource; // show the "choose source" dialog -(id) showChooseSource; // start sampling sound data -(id) startSampling; // stop sampling sound data -(id) stopSampling; // set the object which handles captured data -(id) setOwner: (id <InputHandler>) owner; // request a specific block size -(id) requestBlockSize: (unsigned long)size; // get the actual block size -(unsigned long) blockSize; // return true if the sampler is currently sampling data -(BOOL) isSampling; // return the sample rate -(float) sampleRate; // return the number of channels in the input data -(char) channelCount; @end // vim:syn=objc:nocin:si: --- NEW FILE: PortAudioSampler.m --- // // PortAudioSampler.m // MacCRO X // // Created by Philip Derrin on Thu Dec 05 2002. // Copyright (c) 2002 Philip Derrin. // // This file is part of MacCRO X. // // MacCRO X is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // MacCRO X is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with MacCRO X; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // $Header: /cvsroot/scopeapp/scopeapp/src/PortAudioSampler.m,v 1.1 2002/12/05 15:03:38 narge Exp $ // #import "PortAudioSampler.h" #import <AppKit/AppKit.h> #include <limits.h> PortAudioCallback PASamplerCallback; static BOOL gPASamplerExists = NO; // Internal interfaces @interface PortAudioSampler (PASamplerInternal) -(int) processData: (in float*) inInputData frameCount: (unsigned long) count; -(id) initPortAudio; @end // public implementations @implementation PortAudioSampler -(id) init { return [self initWithOwner: nil]; } // init a sampler with a given owner object -(id) initWithOwner: (id <InputHandler, NSObject>) owner { if(gPASamplerExists) return nil; self = [super init]; if(self != nil) { myOwner = owner; if(myOwner) { [myOwner retain]; } mySamplerRunning = NO; myBlockSize = 512; if([self initPortAudio] == nil) { [self release]; return nil; } } return self; } -(void) dealloc { if(myStream != nil) { Pa_CloseStream(myStream); } Pa_Terminate(); if(myOwner != nil) { [myOwner release]; } [super dealloc]; } // return YES if the sampler has an input settings dialog it can show -(BOOL) canShowInputSettings { return NO; } // show the input settings dialog -(id) showInputSettings { // FIXME return self; } // return YES if the sampler can show a dialog to choose between multiple // sources -(BOOL) canShowChooseSource { return NO; } // show the "choose source" dialog -(id) showChooseSource { // FIXME return self; } // start sampling sound data -(id) startSampling { PaError status; mySamplerRunning = YES; status = Pa_StartStream(myStream); if (status) { NSLog(@"Pa_StartStream: returned %d (%s)", status, Pa_GetErrorText(status)); return nil; } return self; } // stop sampling sound data -(id) stopSampling { PaError status; mySamplerRunning = NO; status = Pa_StopStream(myStream); if (status) { NSLog(@"Pa_StopStream: returned %d (%s)", status, Pa_GetErrorText(status)); return nil; } return self; } // set the object which handles captured data -(id) setOwner: (id <InputHandler, NSObject>) owner { if(myOwner != nil) [myOwner release]; myOwner = owner; if(myOwner != nil) [myOwner retain]; return self; } // request a specific block size -(id) requestBlockSize: (unsigned long)size { myBlockSize = size; // WARNING: this will only take effect when the sampler restarts return self; } // get the actual block size -(unsigned long) blockSize { return myBlockSize; } // return true if the sampler is currently sampling data -(BOOL) isSampling { return mySamplerRunning; } // return the sample rate -(float) sampleRate { return mySampleRate; } // return the number of channels in the input data -(char) channelCount { return myChannelCount; } @end // internal implementations @implementation PortAudioSampler (PASamplerInternal) -(int) processData: (in float*) inInputData frameCount: (unsigned long) count { /* if the sampler should have stopped already, tell * portaudio to stop */ if(!mySamplerRunning) return 1; /* now pass the data to the owner */ [myOwner processData: inInputData length: count channels: myChannelCount rate: mySampleRate fromSampler: self]; return paNoError; } - (id) initPortAudio { PaError status; PaDeviceID inputDevice; const PaDeviceInfo* deviceInfo; /* Start portaudio */ status = Pa_Initialize(); if (status) { NSLog(@"Pa_StartStream: returned %d (%s)", status, Pa_GetErrorText(status)); return nil; } /* find the input device */ inputDevice = Pa_GetDefaultInputDeviceID(); if(inputDevice == paNoDevice) { NSLog(@"Pa_GetDefaultInputDeviceID: returned paNoDevice"); Pa_Terminate(); return nil; } /* get information about the device */ deviceInfo = Pa_GetDeviceInfo(inputDevice); if(!deviceInfo) { NSLog(@"Pa_GetDeviceInfo: returned NULL"); Pa_Terminate(); return nil; } /* now choose the highest possible sample rate */ mySampleRate = -1; if(deviceInfo->numSampleRates == -1) { /* there's a range; choose the maximum */ mySampleRate = deviceInfo->sampleRates[1]; } else { int i; for(i=0; i<deviceInfo->numSampleRates; i++) { if(deviceInfo->sampleRates[i] > mySampleRate) { mySampleRate = deviceInfo->sampleRates[i]; } } } /* find the number of input channels (currently no more than 2) */ myChannelCount = deviceInfo->maxInputChannels; if(myChannelCount > 2) myChannelCount = 2; /* and finally, open the stream */ status = Pa_OpenStream(&myStream, inputDevice, myChannelCount, paFloat32, NULL, paNoDevice, 0, 0, NULL, mySampleRate, myBlockSize, 0, paNoFlag, PASamplerCallback, self); if (status) { NSLog(@"Pa_OpenStream: returned %d (%s)", status, Pa_GetErrorText(status)); Pa_Terminate(); return nil; } return self; } @end int PASamplerCallback(void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, PaTimestamp outTime, void *userData) { return [(PortAudioSampler*)userData processData: inputBuffer frameCount: framesPerBuffer]; } // vim:syn=objc:nocin:si: |
From: <sco...@li...> - 2002-12-05 14:46:47
|
Update of /cvsroot/scopeapp/scopeapp/src/portaudio/pa_common In directory sc8-pr-cvs1:/tmp/cvs-serv2086/pa_common Added Files: pa_convert.c pa_host.h pa_lib.c pa_trace.c pa_trace.h portaudio.h Log Message: Add common and CoreAudio-specific components of PortAudio. --- NEW FILE: pa_convert.c --- /* * pa_conversions.c * portaudio * * Created by Phil Burk on Mon Mar 18 2002. * */ #include <stdio.h> #include "portaudio.h" #include "pa_host.h" #define CLIP( val, min, max ) { val = ((val) < (min)) ? min : (((val) < (max)) ? (max) : (val)); } /*************************************************************************/ static void PaConvert_Float32_Int16( float *sourceBuffer, int sourceStride, short *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { short samp = (short) (*sourceBuffer * (32767.0f)); *targetBuffer = samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Float32_Int16_Clip( float *sourceBuffer, int sourceStride, short *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { long samp = (long) (*sourceBuffer * (32767.0f)); CLIP( samp, -0x8000, 0x7FFF ); *targetBuffer = (short) samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Float32_Int16_ClipDither( float *sourceBuffer, int sourceStride, short *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { // use smaller scaler to prevent overflow when we add the dither float dither = PaConvert_TriangularDither() * PA_DITHER_SCALE; float dithered = (*sourceBuffer * (32766.0f)) + dither; long samp = (long) dithered; CLIP( samp, -0x8000, 0x7FFF ); *targetBuffer = (short) samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Float32_Int16_Dither( float *sourceBuffer, int sourceStride, short *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { // use smaller scaler to prevent overflow when we add the dither float dither = PaConvert_TriangularDither() * PA_DITHER_SCALE; float dithered = (*sourceBuffer * (32766.0f)) + dither; *targetBuffer = (short) dithered; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Int16_Float32( short *sourceBuffer, int sourceStride, float *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { float samp = *sourceBuffer * (1.0f / 32768.0f); *targetBuffer = samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Float32_Int8( float *sourceBuffer, int sourceStride, char *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { char samp = (char) (*sourceBuffer * (127.0)); *targetBuffer = samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Float32_Int8_Clip( float *sourceBuffer, int sourceStride, char *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { long samp = *sourceBuffer * 127.0f; CLIP( samp, -0x80, 0x7F ); *targetBuffer = (char) samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Float32_Int8_ClipDither( float *sourceBuffer, int sourceStride, char *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { // use smaller scaler to prevent overflow when we add the dither float dither = PaConvert_TriangularDither() * PA_DITHER_SCALE; float dithered = (*sourceBuffer * (126.0f)) + dither; long samp = (long) dithered; CLIP( samp, -0x80, 0x7F ); *targetBuffer = (char) samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Float32_Int8_Dither( float *sourceBuffer, int sourceStride, char *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { // use smaller scaler to prevent overflow when we add the dither float dither = PaConvert_TriangularDither() * PA_DITHER_SCALE; //FIXME float dithered = (*sourceBuffer * (126.0f)) + dither; long samp = (long) dithered; *targetBuffer = (char) samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Int8_Float32( char *sourceBuffer, int sourceStride, float *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { float samp = *sourceBuffer * (1.0f / 128.0f); *targetBuffer = samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_Float32_UInt8( float *sourceBuffer, int sourceStride, unsigned char *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { unsigned char samp = 128 + (unsigned char) (*sourceBuffer * (127.0)); *targetBuffer = samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static void PaConvert_UInt8_Float32( unsigned char *sourceBuffer, int sourceStride, float *targetBuffer, int targetStride, int numSamples ) { int i; for( i=0; i<numSamples; i++ ) { float samp = (*sourceBuffer - 128) * (1.0f / 128.0f); *targetBuffer = samp; sourceBuffer += sourceStride; targetBuffer += targetStride; } } /*************************************************************************/ static PortAudioConverter *PaConvert_SelectProc( PaSampleFormat sourceFormat, PaSampleFormat targetFormat, int ifClip, int ifDither ) { PortAudioConverter *proc = NULL; switch( sourceFormat ) { case paUInt8: switch( targetFormat ) { case paFloat32: proc = (PortAudioConverter *) PaConvert_UInt8_Float32; break; default: break; } break; case paInt8: switch( targetFormat ) { case paFloat32: proc = (PortAudioConverter *) PaConvert_Int8_Float32; break; default: break; } break; case paInt16: switch( targetFormat ) { case paFloat32: proc = (PortAudioConverter *) PaConvert_Int16_Float32; break; default: break; } break; case paFloat32: switch( targetFormat ) { case paUInt8: proc = (PortAudioConverter *) PaConvert_Float32_UInt8; break; case paInt8: if( ifClip && ifDither ) proc = (PortAudioConverter *) PaConvert_Float32_Int8_ClipDither; else if( ifClip ) proc = (PortAudioConverter *) PaConvert_Float32_Int8_Clip; else if( ifDither ) proc = (PortAudioConverter *) PaConvert_Float32_Int8_Dither; else proc = (PortAudioConverter *) PaConvert_Float32_Int8; break; case paInt16: if( ifClip && ifDither ) proc = (PortAudioConverter *) PaConvert_Float32_Int16_ClipDither; else if( ifClip ) proc = (PortAudioConverter *) PaConvert_Float32_Int16_Clip; else if( ifDither ) proc = (PortAudioConverter *) PaConvert_Float32_Int16_Dither; else proc = (PortAudioConverter *) PaConvert_Float32_Int16; break; default: break; } break; default: break; } return proc; } /*************************************************************************/ PaError PaConvert_SetupInput( internalPortAudioStream *past, PaSampleFormat nativeInputSampleFormat ) { past->past_NativeInputSampleFormat = nativeInputSampleFormat; past->past_InputConversionSourceStride = 1; past->past_InputConversionTargetStride = 1; if( nativeInputSampleFormat != past->past_InputSampleFormat ) { int ifDither = (past->past_Flags & paDitherOff) == 0; past->past_InputConversionProc = PaConvert_SelectProc( nativeInputSampleFormat, past->past_InputSampleFormat, 0, ifDither ); if( past->past_InputConversionProc == NULL ) return paSampleFormatNotSupported; } else { past->past_InputConversionProc = NULL; /* no conversion necessary */ } return paNoError; } /*************************************************************************/ PaError PaConvert_SetupOutput( internalPortAudioStream *past, PaSampleFormat nativeOutputSampleFormat ) { past->past_NativeOutputSampleFormat = nativeOutputSampleFormat; past->past_OutputConversionSourceStride = 1; past->past_OutputConversionTargetStride = 1; if( nativeOutputSampleFormat != past->past_OutputSampleFormat ) { int ifDither = (past->past_Flags & paDitherOff) == 0; int ifClip = (past->past_Flags & paClipOff) == 0; past->past_OutputConversionProc = PaConvert_SelectProc( past->past_OutputSampleFormat, nativeOutputSampleFormat, ifClip, ifDither ); if( past->past_OutputConversionProc == NULL ) return paSampleFormatNotSupported; } else { past->past_OutputConversionProc = NULL; /* no conversion necessary */ } return paNoError; } /************************************************************************* ** Called by host code. ** Convert input from native format to user format, ** call user code, ** then convert output to native format. ** Returns result from user callback. */ long PaConvert_Process( internalPortAudioStream *past, void *nativeInputBuffer, void *nativeOutputBuffer ) { int userResult; void *inputBuffer = NULL; void *outputBuffer = NULL; /* Get native input data. */ if( (past->past_NumInputChannels > 0) && (nativeInputBuffer != NULL) ) { if( past->past_InputSampleFormat == past->past_NativeInputSampleFormat ) { /* Already in native format so just read directly from native buffer. */ inputBuffer = nativeInputBuffer; } else { inputBuffer = past->past_InputBuffer; /* Convert input data to user format. */ (*past->past_InputConversionProc)(nativeInputBuffer, past->past_InputConversionSourceStride, inputBuffer, past->past_InputConversionTargetStride, past->past_FramesPerUserBuffer * past->past_NumInputChannels ); } } /* Are we doing output? */ if( (past->past_NumOutputChannels > 0) && (nativeOutputBuffer != NULL) ) { outputBuffer = (past->past_OutputConversionProc == NULL) ? nativeOutputBuffer : past->past_OutputBuffer; } /* AddTraceMessage("Pa_CallConvertInt16: inputBuffer = ", (int) inputBuffer ); AddTraceMessage("Pa_CallConvertInt16: outputBuffer = ", (int) outputBuffer ); */ /* Call user callback routine. */ userResult = past->past_Callback( inputBuffer, outputBuffer, past->past_FramesPerUserBuffer, past->past_FrameCount, past->past_UserData ); /* Advance frame counter for timestamp. */ past->past_FrameCount += past->past_FramesPerUserBuffer; // FIXME - should this be in here? /* Convert to native format if necessary. */ if( (past->past_OutputConversionProc != NULL ) && (outputBuffer != NULL) ) { (*past->past_OutputConversionProc)( outputBuffer, past->past_OutputConversionSourceStride, nativeOutputBuffer, past->past_OutputConversionTargetStride, past->past_FramesPerUserBuffer * past->past_NumOutputChannels ); } return userResult; } --- NEW FILE: pa_host.h --- #ifndef PA_HOST_H #define PA_HOST_H /* * $Id: pa_host.h,v 1.1 2002/12/05 14:46:43 narge Exp $ * Host dependant internal API for PortAudio * * Author: Phil Burk <phi...@so...> * * PortAudio Portable Real-Time Audio Library * Latest Version at: http://www.softsynth.com/portaudio/ * DirectSound and Macintosh Implementation * Copyright (c) 1999-2000 Phil Burk * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that * they can be incorporated into the canonical version. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #include "portaudio.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef SUPPORT_AUDIO_CAPTURE #define SUPPORT_AUDIO_CAPTURE (1) #endif #ifndef int32 typedef long int32; #endif #ifndef uint32 typedef unsigned long uint32; #endif #ifndef int16 typedef short int16; #endif #ifndef uint16 typedef unsigned short uint16; #endif /* Used to convert between various sample formats. */ typedef void (PortAudioConverter)( void *inputBuffer, int inputStride, void *outputBuffer, int outputStride, int numSamples ); #define PA_MAGIC (0x18273645) /************************************************************************************/ /****************** Structures ******************************************************/ /************************************************************************************/ typedef struct internalPortAudioStream { uint32 past_Magic; /* ID for struct to catch bugs. */ /* User specified information. */ uint32 past_FramesPerUserBuffer; uint32 past_NumUserBuffers; double past_SampleRate; /* Closest supported sample rate. */ int past_NumInputChannels; int past_NumOutputChannels; PaDeviceID past_InputDeviceID; PaDeviceID past_OutputDeviceID; PaSampleFormat past_NativeInputSampleFormat; PaSampleFormat past_InputSampleFormat; PaSampleFormat past_NativeOutputSampleFormat; PaSampleFormat past_OutputSampleFormat; void *past_DeviceData; PortAudioCallback *past_Callback; void *past_UserData; uint32 past_Flags; /* Flags for communicating between foreground and background. */ volatile int past_IsActive; /* Background is still playing. */ volatile int past_StopSoon; /* Background should keep playing when buffers empty. */ volatile int past_StopNow; /* Background should stop playing now. */ /* These buffers are used when the native format does not match the user format. */ void *past_InputBuffer; uint32 past_InputBufferSize; void *past_OutputBuffer; uint32 past_OutputBufferSize; /* Measurements */ uint32 past_NumCallbacks; PaTimestamp past_FrameCount; /* Frames output to buffer. */ /* For measuring CPU utilization. */ double past_AverageInsideCount; double past_AverageTotalCount; double past_Usage; int past_IfLastExitValid; /* Format Conversion */ /* These are setup by PaConversion_Setup() */ PortAudioConverter *past_InputConversionProc; int past_InputConversionSourceStride; int past_InputConversionTargetStride; PortAudioConverter *past_OutputConversionProc; int past_OutputConversionSourceStride; int past_OutputConversionTargetStride; } internalPortAudioStream; /************************************************************************************/ /******** These functions must be provided by a platform implementation. ************/ /************************************************************************************/ PaError PaHost_Init( void ); PaError PaHost_Term( void ); PaError PaHost_OpenStream( internalPortAudioStream *past ); PaError PaHost_CloseStream( internalPortAudioStream *past ); PaError PaHost_StartOutput( internalPortAudioStream *past ); PaError PaHost_StopOutput( internalPortAudioStream *past, int abort ); PaError PaHost_StartInput( internalPortAudioStream *past ); PaError PaHost_StopInput( internalPortAudioStream *past, int abort ); PaError PaHost_StartEngine( internalPortAudioStream *past ); PaError PaHost_StopEngine( internalPortAudioStream *past, int abort ); PaError PaHost_StreamActive( internalPortAudioStream *past ); void *PaHost_AllocateFastMemory( long numBytes ); void PaHost_FreeFastMemory( void *addr, long numBytes ); /* This only called if PA_VALIDATE_RATE IS CALLED. */ PaError PaHost_ValidateSampleRate( PaDeviceID id, double requestedFrameRate, double *closestFrameRatePtr ); /**********************************************************************/ /************ Common Utility Routines provided by PA ******************/ /**********************************************************************/ /* PaHost_IsInitialized() returns non-zero if PA is initialized, 0 otherwise */ int PaHost_IsInitialized( void ); internalPortAudioStream* PaHost_GetStreamRepresentation( PortAudioStream *stream ); int PaHost_FindClosestTableEntry( double allowableError, const double *rateTable, int numRates, double frameRate ); long Pa_CallConvertInt16( internalPortAudioStream *past, short *nativeInputBuffer, short *nativeOutputBuffer ); /* Calculate 2 LSB dither signal with a triangular distribution. ** Ranged properly for adding to a 32 bit 1.31 fixed point value prior to >>15. ** Range of output is +/- 65535 ** Multiply by PA_DITHER_SCALE to get a float between -2.0 and 2.0. */ #define PA_DITHER_BITS (15) #define PA_DITHER_SCALE (1.0f / ((1<<PA_DITHER_BITS)-1)) long PaConvert_TriangularDither( void ); PaError PaConvert_SetupInput( internalPortAudioStream *past, PaSampleFormat nativeInputSampleFormat ); PaError PaConvert_SetupOutput( internalPortAudioStream *past, PaSampleFormat nativeOutputSampleFormat ); long PaConvert_Process( internalPortAudioStream *past, void *nativeInputBuffer, void *nativeOutputBuffer ); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* PA_HOST_H */ --- NEW FILE: pa_lib.c --- /* * $Id: pa_lib.c,v 1.1 2002/12/05 14:46:43 narge Exp $ * Portable Audio I/O Library * Host Independant Layer * * Based on the Open Source API proposed by Ross Bencina * Copyright (c) 1999-2000 Phil Burk * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that * they can be incorporated into the canonical version. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /* Modification History: PLB20010422 - apply Mike Berry's changes for CodeWarrior on PC PLB20010820 - fix dither and shift for recording PaUInt8 format */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> /* PLB20010422 - "memory.h" doesn't work on CodeWarrior for PC. Thanks Mike Berry for the mod. */ #ifdef _WIN32 #ifndef __MWERKS__ #include <memory.h> #endif /* __MWERKS__ */ #else /* !_WIN32 */ #include <memory.h> #endif /* _WIN32 */ #include "portaudio.h" #include "pa_host.h" #include "pa_trace.h" /* The reason we might NOT want to validate the rate before opening the stream * is because many DirectSound drivers lie about the rates they actually support. */ #define PA_VALIDATE_RATE (0) /* If true validate sample rate against driver info. */ /* O- maybe not allocate past_InputBuffer and past_OutputBuffer if not needed for conversion */ #ifndef FALSE #define FALSE (0) #define TRUE (!FALSE) #endif #define PRINT(x) { printf x; fflush(stdout); } #define ERR_RPT(x) PRINT(x) #define DBUG(x) /* PRINT(x) */ #define DBUGX(x) /* PRINT(x) */ static int gInitCount = 0; /* Count number of times Pa_Initialize() called to allow nesting and overlapping. */ static PaError Pa_KillStream( PortAudioStream *stream, int abort ); /***********************************************************************/ int PaHost_FindClosestTableEntry( double allowableError, const double *rateTable, int numRates, double frameRate ) { double err, minErr = allowableError; int i, bestFit = -1; for( i=0; i<numRates; i++ ) { err = fabs( frameRate - rateTable[i] ); if( err < minErr ) { minErr = err; bestFit = i; } } return bestFit; } /************************************************************************** ** Make sure sample rate is legal and also convert to enumeration for driver. */ PaError PaHost_ValidateSampleRate( PaDeviceID id, double requestedFrameRate, double *closestFrameRatePtr ) { long bestRateIndex; const PaDeviceInfo *pdi; pdi = Pa_GetDeviceInfo( id ); if( pdi == NULL ) { return paInvalidDeviceId; } if( pdi->numSampleRates == -1 ) { /* Is it out of range? */ if( (requestedFrameRate < pdi->sampleRates[0]) || (requestedFrameRate > pdi->sampleRates[1]) ) { return paInvalidSampleRate; } *closestFrameRatePtr = requestedFrameRate; } else { bestRateIndex = PaHost_FindClosestTableEntry( 1.0, pdi->sampleRates, pdi->numSampleRates, requestedFrameRate ); if( bestRateIndex < 0 ) return paInvalidSampleRate; *closestFrameRatePtr = pdi->sampleRates[bestRateIndex]; } return paNoError; } /*************************************************************************/ PaError Pa_OpenStream( PortAudioStream** streamPtrPtr, PaDeviceID inputDeviceID, int numInputChannels, PaSampleFormat inputSampleFormat, void *inputDriverInfo, PaDeviceID outputDeviceID, int numOutputChannels, PaSampleFormat outputSampleFormat, void *outputDriverInfo, double sampleRate, unsigned long framesPerBuffer, unsigned long numberOfBuffers, unsigned long streamFlags, PortAudioCallback *callback, void *userData ) { internalPortAudioStream *past = NULL; PaError result = paNoError; int bitsPerInputSample; int bitsPerOutputSample; /* Print passed parameters. */ DBUG(("Pa_OpenStream( %p, %d, %d, %d, %p, /* input */ \n", streamPtrPtr, inputDeviceID, numInputChannels, inputSampleFormat, inputDriverInfo )); DBUG((" %d, %d, %d, %p, /* output */\n", outputDeviceID, numOutputChannels, outputSampleFormat, outputDriverInfo )); DBUG((" %g, %d, %d, 0x%x, , %p )\n", sampleRate, framesPerBuffer, numberOfBuffers, streamFlags, userData )); /* Check for parameter errors. */ if( (streamFlags & ~(paClipOff | paDitherOff)) != 0 ) return paInvalidFlag; if( streamPtrPtr == NULL ) return paBadStreamPtr; if( inputDriverInfo != NULL ) return paHostError; /* REVIEW */ if( outputDriverInfo != NULL ) return paHostError; /* REVIEW */ if( (inputDeviceID < 0) && ( outputDeviceID < 0) ) return paInvalidDeviceId; if( (outputDeviceID >= Pa_CountDevices()) || (inputDeviceID >= Pa_CountDevices()) ) { return paInvalidDeviceId; } if( (numInputChannels <= 0) && ( numOutputChannels <= 0) ) return paInvalidChannelCount; #if SUPPORT_AUDIO_CAPTURE if( inputDeviceID >= 0 ) { PaError size = Pa_GetSampleSize( inputSampleFormat ); if( size < 0 ) return size; bitsPerInputSample = 8 * size; if( (numInputChannels <= 0) ) return paInvalidChannelCount; } #else if( inputDeviceID >= 0 ) { return paInvalidChannelCount; } #endif /* SUPPORT_AUDIO_CAPTURE */ else { if( numInputChannels > 0 ) return paInvalidChannelCount; bitsPerInputSample = 0; } if( outputDeviceID >= 0 ) { PaError size = Pa_GetSampleSize( outputSampleFormat ); if( size < 0 ) return size; bitsPerOutputSample = 8 * size; if( (numOutputChannels <= 0) ) return paInvalidChannelCount; } else { if( numOutputChannels > 0 ) return paInvalidChannelCount; bitsPerOutputSample = 0; } if( callback == NULL ) return paNullCallback; /* Allocate and clear stream structure. */ past = (internalPortAudioStream *) PaHost_AllocateFastMemory( sizeof(internalPortAudioStream) ); if( past == NULL ) return paInsufficientMemory; memset( past, 0, sizeof(internalPortAudioStream) ); AddTraceMessage("Pa_OpenStream: past", (long) past ); past->past_Magic = PA_MAGIC; /* Set ID to catch bugs. */ past->past_FramesPerUserBuffer = framesPerBuffer; past->past_NumUserBuffers = numberOfBuffers; /* NOTE - PaHost_OpenStream() MUST CHECK FOR ZERO! */ past->past_Callback = callback; past->past_UserData = userData; past->past_OutputSampleFormat = outputSampleFormat; past->past_InputSampleFormat = inputSampleFormat; past->past_OutputDeviceID = outputDeviceID; past->past_InputDeviceID = inputDeviceID; past->past_NumInputChannels = numInputChannels; past->past_NumOutputChannels = numOutputChannels; past->past_Flags = streamFlags; /* Check for absurd sample rates. */ if( (sampleRate < 1000.0) || (sampleRate > 200000.0) ) { result = paInvalidSampleRate; goto cleanup; } /* Allocate buffers that may be used for format conversion from user to native buffers. */ if( numInputChannels > 0 ) { #if PA_VALIDATE_RATE result = PaHost_ValidateSampleRate( inputDeviceID, sampleRate, &past->past_SampleRate ); if( result < 0 ) { goto cleanup; } #else past->past_SampleRate = sampleRate; #endif /* Allocate single Input buffer for passing formatted samples to user callback. */ past->past_InputBufferSize = framesPerBuffer * numInputChannels * ((bitsPerInputSample+7) / 8); past->past_InputBuffer = PaHost_AllocateFastMemory(past->past_InputBufferSize); if( past->past_InputBuffer == NULL ) { result = paInsufficientMemory; goto cleanup; } } else { past->past_InputBuffer = NULL; } /* Allocate single Output buffer. */ if( numOutputChannels > 0 ) { #if PA_VALIDATE_RATE result = PaHost_ValidateSampleRate( outputDeviceID, sampleRate, &past->past_SampleRate ); if( result < 0 ) { goto cleanup; } #else past->past_SampleRate = sampleRate; #endif past->past_OutputBufferSize = framesPerBuffer * numOutputChannels * ((bitsPerOutputSample+7) / 8); past->past_OutputBuffer = PaHost_AllocateFastMemory(past->past_OutputBufferSize); if( past->past_OutputBuffer == NULL ) { result = paInsufficientMemory; goto cleanup; } } else { past->past_OutputBuffer = NULL; } result = PaHost_OpenStream( past ); if( result < 0 ) goto cleanup; *streamPtrPtr = (void *) past; return result; cleanup: if( past != NULL ) Pa_CloseStream( past ); *streamPtrPtr = NULL; return result; } /*************************************************************************/ PaError Pa_OpenDefaultStream( PortAudioStream** stream, int numInputChannels, int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, unsigned long framesPerBuffer, unsigned long numberOfBuffers, PortAudioCallback *callback, void *userData ) { return Pa_OpenStream( stream, ((numInputChannels > 0) ? Pa_GetDefaultInputDeviceID() : paNoDevice), numInputChannels, sampleFormat, NULL, ((numOutputChannels > 0) ? Pa_GetDefaultOutputDeviceID() : paNoDevice), numOutputChannels, sampleFormat, NULL, sampleRate, framesPerBuffer, numberOfBuffers, paNoFlag, callback, userData ); } /*************************************************************************/ PaError Pa_CloseStream( PortAudioStream* stream) { PaError result; internalPortAudioStream *past; DBUG(("Pa_CloseStream()\n")); if( stream == NULL ) return paBadStreamPtr; past = (internalPortAudioStream *) stream; Pa_AbortStream( past ); result = PaHost_CloseStream( past ); if( past->past_InputBuffer ) PaHost_FreeFastMemory( past->past_InputBuffer, past->past_InputBufferSize ); if( past->past_OutputBuffer ) PaHost_FreeFastMemory( past->past_OutputBuffer, past->past_OutputBufferSize ); PaHost_FreeFastMemory( past, sizeof(internalPortAudioStream) ); return result; } /*************************************************************************/ PaError Pa_StartStream( PortAudioStream *stream ) { PaError result = paHostError; internalPortAudioStream *past; if( stream == NULL ) return paBadStreamPtr; past = (internalPortAudioStream *) stream; past->past_FrameCount = 0.0; if( past->past_NumInputChannels > 0 ) { result = PaHost_StartInput( past ); DBUG(("Pa_StartStream: PaHost_StartInput returned = 0x%X.\n", result)); if( result < 0 ) goto error; } if( past->past_NumOutputChannels > 0 ) { result = PaHost_StartOutput( past ); DBUG(("Pa_StartStream: PaHost_StartOutput returned = 0x%X.\n", result)); if( result < 0 ) goto error; } result = PaHost_StartEngine( past ); DBUG(("Pa_StartStream: PaHost_StartEngine returned = 0x%X.\n", result)); if( result < 0 ) goto error; return paNoError; error: return result; } /*************************************************************************/ PaError Pa_StopStream( PortAudioStream *stream ) { return Pa_KillStream( stream, 0 ); } /*************************************************************************/ PaError Pa_AbortStream( PortAudioStream *stream ) { return Pa_KillStream( stream, 1 ); } /*************************************************************************/ static PaError Pa_KillStream( PortAudioStream *stream, int abort ) { PaError result = paNoError; internalPortAudioStream *past; DBUG(("Pa_StopStream().\n")); if( stream == NULL ) return paBadStreamPtr; past = (internalPortAudioStream *) stream; if( (past->past_NumInputChannels > 0) || (past->past_NumOutputChannels > 0) ) { result = PaHost_StopEngine( past, abort ); DBUG(("Pa_StopStream: PaHost_StopEngine returned = 0x%X.\n", result)); if( result < 0 ) goto error; } if( past->past_NumInputChannels > 0 ) { result = PaHost_StopInput( past, abort ); DBUG(("Pa_StopStream: PaHost_StopInput returned = 0x%X.\n", result)); if( result != paNoError ) goto error; } if( past->past_NumOutputChannels > 0 ) { result = PaHost_StopOutput( past, abort ); DBUG(("Pa_StopStream: PaHost_StopOutput returned = 0x%X.\n", result)); if( result != paNoError ) goto error; } error: past->past_Usage = 0; past->past_IfLastExitValid = 0; return result; } /*************************************************************************/ PaError Pa_StreamActive( PortAudioStream *stream ) { internalPortAudioStream *past; if( stream == NULL ) return paBadStreamPtr; past = (internalPortAudioStream *) stream; return PaHost_StreamActive( past ); } /*************************************************************************/ const char *Pa_GetErrorText( PaError errnum ) { const char *msg; switch(errnum) { case paNoError: msg = "Success"; break; case paHostError: msg = "Host error."; break; case paInvalidChannelCount: msg = "Invalid number of channels."; break; case paInvalidSampleRate: msg = "Invalid sample rate."; break; case paInvalidDeviceId: msg = "Invalid device ID."; break; case paInvalidFlag: msg = "Invalid flag."; break; case paSampleFormatNotSupported: msg = "Sample format not supported"; break; case paBadIODeviceCombination: msg = "Illegal combination of I/O devices."; break; case paInsufficientMemory: msg = "Insufficient memory."; break; case paBufferTooBig: msg = "Buffer too big."; break; case paBufferTooSmall: msg = "Buffer too small."; break; case paNullCallback: msg = "No callback routine specified."; break; case paBadStreamPtr: msg = "Invalid stream pointer."; break; case paTimedOut : msg = "Wait Timed Out."; break; case paInternalError: msg = "Internal PortAudio Error."; break; case paDeviceUnavailable: msg = "Device Unavailable."; break; default: msg = "Illegal error number."; break; } return msg; } /* Get CPU Load as a fraction of total CPU time. A value of 0.5 would imply that PortAudio and the sound generating callback was consuming roughly 50% of the available CPU time. The amount may vary depending on CPU load. This function may be called from the callback function. */ double Pa_GetCPULoad( PortAudioStream* stream) { internalPortAudioStream *past; if( stream == NULL ) return (double) paBadStreamPtr; past = (internalPortAudioStream *) stream; return past->past_Usage; } /*************************************************************************/ internalPortAudioStream* PaHost_GetStreamRepresentation( PortAudioStream *stream ) { internalPortAudioStream* result = (internalPortAudioStream*) stream; if( result == NULL || result->past_Magic != PA_MAGIC ) return NULL; else return result; } /************************************************************* ** Calculate 2 LSB dither signal with a triangular distribution. ** Ranged properly for adding to a 32 bit integer prior to >>15. ** Range of output is +/- 32767 */ #define PA_DITHER_BITS (15) #define PA_DITHER_SCALE (1.0f / ((1<<PA_DITHER_BITS)-1)) long PaConvert_TriangularDither( void ) { static unsigned long previous = 0; static unsigned long randSeed1 = 22222; static unsigned long randSeed2 = 5555555; long current, highPass; /* Generate two random numbers. */ randSeed1 = (randSeed1 * 196314165) + 907633515; randSeed2 = (randSeed2 * 196314165) + 907633515; /* Generate triangular distribution about 0. * Shift before adding to prevent overflow which would skew the distribution. * Also shift an extra bit for the high pass filter. */ #define DITHER_SHIFT ((32 - PA_DITHER_BITS) + 1) current = (((long)randSeed1)>>DITHER_SHIFT) + (((long)randSeed2)>>DITHER_SHIFT); /* High pass filter to reduce audibility. */ highPass = current - previous; previous = current; return highPass; } /************************************************************************* ** Called by host code. ** Convert input from Int16, call user code, then convert output ** to Int16 format for native use. ** Assumes host native format is paInt16. ** Returns result from user callback. */ long Pa_CallConvertInt16( internalPortAudioStream *past, short *nativeInputBuffer, short *nativeOutputBuffer ) { long temp; int userResult; unsigned int i; void *inputBuffer = NULL; void *outputBuffer = NULL; #if SUPPORT_AUDIO_CAPTURE /* Get native data from DirectSound. */ if( (past->past_NumInputChannels > 0) && (nativeInputBuffer != NULL) ) { /* Convert from native format to PA format. */ unsigned int samplesPerBuffer = past->past_FramesPerUserBuffer * past->past_NumInputChannels; switch(past->past_InputSampleFormat) { case paFloat32: { float *inBufPtr = (float *) past->past_InputBuffer; inputBuffer = past->past_InputBuffer; for( i=0; i<samplesPerBuffer; i++ ) { inBufPtr[i] = nativeInputBuffer[i] * (1.0f / 32767.0f); } break; } case paInt32: { /* Convert 16 bit data to 32 bit integers */ int *inBufPtr = (int *) past->past_InputBuffer; inputBuffer = past->past_InputBuffer; for( i=0; i<samplesPerBuffer; i++ ) { inBufPtr[i] = nativeInputBuffer[i] << 16; } break; } case paInt16: { /* Already in correct format so don't copy. */ inputBuffer = nativeInputBuffer; break; } case paInt8: { /* Convert 16 bit data to 8 bit chars */ char *inBufPtr = (char *) past->past_InputBuffer; inputBuffer = past->past_InputBuffer; if( past->past_Flags & paDitherOff ) { for( i=0; i<samplesPerBuffer; i++ ) { inBufPtr[i] = (char)(nativeInputBuffer[i] >> 8); } } else { for( i=0; i<samplesPerBuffer; i++ ) { temp = nativeInputBuffer[i]; temp += PaConvert_TriangularDither() >> 8; /* PLB20010820 */ temp = ((temp < -0x8000) ? -0x8000 : ((temp > 0x7FFF) ? 0x7FFF : temp)); inBufPtr[i] = (char)(temp >> 8); } } break; } case paUInt8: { /* Convert 16 bit data to 8 bit unsigned chars */ unsigned char *inBufPtr = (unsigned char *) past->past_InputBuffer; inputBuffer = past->past_InputBuffer; if( past->past_Flags & paDitherOff ) { for( i=0; i<samplesPerBuffer; i++ ) { inBufPtr[i] = ((unsigned char)(nativeInputBuffer[i] >> 8)) + 0x80; } } else { /* If you dither then you have to clip because dithering could push the signal out of range! */ for( i=0; i<samplesPerBuffer; i++ ) { temp = nativeInputBuffer[i]; temp += PaConvert_TriangularDither() >> 8; /* PLB20010820 */ temp = ((temp < -0x8000) ? -0x8000 : ((temp > 0x7FFF) ? 0x7FFF : temp)); inBufPtr[i] = (unsigned char)((temp>>8) + 0x80); /* PLB20010820 */ } } break; } default: break; } } #endif /* SUPPORT_AUDIO_CAPTURE */ /* Are we doing output time? */ if( (past->past_NumOutputChannels > 0) && (nativeOutputBuffer != NULL) ) { /* May already be in native format so just write directly to native buffer. */ outputBuffer = (past->past_OutputSampleFormat == paInt16) ? nativeOutputBuffer : past->past_OutputBuffer; } /* AddTraceMessage("Pa_CallConvertInt16: inputBuffer = ", (int) inputBuffer ); AddTraceMessage("Pa_CallConvertInt16: outputBuffer = ", (int) outputBuffer ); */ /* Call user callback routine. */ userResult = past->past_Callback( inputBuffer, outputBuffer, past->past_FramesPerUserBuffer, past->past_FrameCount, past->past_UserData ); past->past_FrameCount += (PaTimestamp) past->past_FramesPerUserBuffer; /* Convert to native format if necessary. */ if( outputBuffer != NULL ) { unsigned int samplesPerBuffer = past->past_FramesPerUserBuffer * past->past_NumOutputChannels; switch(past->past_OutputSampleFormat) { case paFloat32: { float *outBufPtr = (float *) past->past_OutputBuffer; if( past->past_Flags & paDitherOff ) { if( past->past_Flags & paClipOff ) /* NOTHING */ { for( i=0; i<samplesPerBuffer; i++ ) { *nativeOutputBuffer++ = (short) (outBufPtr[i] * (32767.0f)); } } else /* CLIP */ { for( i=0; i<samplesPerBuffer; i++ ) { temp = (long)(outBufPtr[i] * 32767.0f); *nativeOutputBuffer++ = (short)((temp < -0x8000) ? -0x8000 : ((temp > 0x7FFF) ? 0x7FFF : temp)); } } } else { /* If you dither then you have to clip because dithering could push the signal out of range! */ for( i=0; i<samplesPerBuffer; i++ ) { float dither = PaConvert_TriangularDither()*PA_DITHER_SCALE; float dithered = (outBufPtr[i] * (32767.0f)) + dither; temp = (long) (dithered); *nativeOutputBuffer++ = (short)((temp < -0x8000) ? -0x8000 : ((temp > 0x7FFF) ? 0x7FFF : temp)); } } break; } case paInt32: { int *outBufPtr = (int *) past->past_OutputBuffer; if( past->past_Flags & paDitherOff ) { for( i=0; i<samplesPerBuffer; i++ ) { *nativeOutputBuffer++ = (short) (outBufPtr[i] >> 16 ); } } else { for( i=0; i<samplesPerBuffer; i++ ) { /* Shift one bit down before dithering so that we have room for overflow from add. */ temp = (outBufPtr[i] >> 1) + PaConvert_TriangularDither(); temp = temp >> 15; *nativeOutputBuffer++ = (short)((temp < -0x8000) ? -0x8000 : ((temp > 0x7FFF) ? 0x7FFF : temp)); } } break; } case paInt8: { char *outBufPtr = (char *) past->past_OutputBuffer; for( i=0; i<samplesPerBuffer; i++ ) { *nativeOutputBuffer++ = ((short)outBufPtr[i]) << 8; } break; } case paUInt8: { unsigned char *outBufPtr = (unsigned char *) past->past_OutputBuffer; for( i=0; i<samplesPerBuffer; i++ ) { *nativeOutputBuffer++ = ((short)(outBufPtr[i] - 0x80)) << 8; } break; } default: break; } } return userResult; } /*************************************************************************/ PaError Pa_Initialize( void ) { if( gInitCount++ > 0 ) return paNoError; ResetTraceMessages(); return PaHost_Init(); } PaError Pa_Terminate( void ) { PaError result = paNoError; if( gInitCount == 0 ) return paNoError; else if( --gInitCount == 0 ) { result = PaHost_Term(); DumpTraceMessages(); } return result; } int PaHost_IsInitialized() { return gInitCount; } /*************************************************************************/ PaError Pa_GetSampleSize( PaSampleFormat format ) { int size; switch(format ) { case paUInt8: case paInt8: size = 1; break; case paInt16: size = 2; break; case paPackedInt24: size = 3; break; case paFloat32: case paInt32: case paInt24: size = 4; break; default: size = paSampleFormatNotSupported; break; } return (PaError) size; } --- NEW FILE: pa_trace.c --- /* * $Id: pa_trace.c,v 1.1 2002/12/05 14:46:43 narge Exp $ * Portable Audio I/O Library Trace Facility * Store trace information in real-time for later printing. * * Based on the Open Source API proposed by Ross Bencina * Copyright (c) 1999-2000 Phil Burk * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that * they can be incorporated into the canonical version. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "pa_trace.h" #if TRACE_REALTIME_EVENTS static char *traceTextArray[MAX_TRACE_RECORDS]; static int traceIntArray[MAX_TRACE_RECORDS]; static int traceIndex = 0; static int traceBlock = 0; /*********************************************************************/ void ResetTraceMessages() { traceIndex = 0; } /*********************************************************************/ void DumpTraceMessages() { int i; int numDump = (traceIndex < MAX_TRACE_RECORDS) ? traceIndex : MAX_TRACE_RECORDS; printf("DumpTraceMessages: traceIndex = %d\n", traceIndex ); for( i=0; i<numDump; i++ ) { printf("%3d: %s = 0x%08X\n", i, traceTextArray[i], traceIntArray[i] ); } ResetTraceMessages(); fflush(stdout); } /*********************************************************************/ void AddTraceMessage( char *msg, int data ) { if( (traceIndex == MAX_TRACE_RECORDS) && (traceBlock == 0) ) { traceBlock = 1; /* DumpTraceMessages(); */ } else if( traceIndex < MAX_TRACE_RECORDS ) { traceTextArray[traceIndex] = msg; traceIntArray[traceIndex] = data; traceIndex++; } } #endif --- NEW FILE: pa_trace.h --- #ifndef PA_TRACE_H #define PA_TRACE_H /* * $Id: pa_trace.h,v 1.1 2002/12/05 14:46:43 narge Exp $ * Portable Audio I/O Library Trace Facility * Store trace information in real-time for later printing. * * Based on the Open Source API proposed by Ross Bencina * Copyright (c) 1999-2000 Phil Burk * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that * they can be incorporated into the canonical version. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define TRACE_REALTIME_EVENTS (0) /* Keep log of various real-time events. */ #define MAX_TRACE_RECORDS (2048) #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /************************************************************************************/ /****************** Prototypes ******************************************************/ /************************************************************************************/ #if TRACE_REALTIME_EVENTS void DumpTraceMessages(); void ResetTraceMessages(); void AddTraceMessage( char *msg, int data ); #else #define AddTraceMessage(msg,data) /* noop */ #define ResetTraceMessages() /* noop */ #define DumpTraceMessages() /* noop */ #endif #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* PA_TRACE_H */ --- NEW FILE: portaudio.h --- #ifndef PORT_AUDIO_H #define PORT_AUDIO_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * $Id: portaudio.h,v 1.1 2002/12/05 14:46:43 narge Exp $ * PortAudio Portable Real-Time Audio Library * PortAudio API Header File * Latest version available at: http://www.audiomulch.com/portaudio/ * * Copyright (c) 1999-2000 Ross Bencina and Phil Burk * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that * they can be incorporated into the canonical version. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ typedef int PaError; typedef enum { paNoError = 0, paHostError = -10000, paInvalidChannelCount, paInvalidSampleRate, paInvalidDeviceId, paInvalidFlag, paSampleFormatNotSupported, paBadIODeviceCombination, paInsufficientMemory, paBufferTooBig, paBufferTooSmall, paNullCallback, paBadStreamPtr, paTimedOut, paInternalError, paDeviceUnavailable } PaErrorNum; /* Pa_Initialize() is the library initialisation function - call this before using the library. */ PaError Pa_Initialize( void ); /* Pa_Terminate() is the library termination function - call this after using the library. */ PaError Pa_Terminate( void ); /* Pa_GetHostError() returns a host specific error code. This can be called after receiving a PortAudio error code of paHostError. */ long Pa_GetHostError( void ); /* Pa_GetErrorText() translates the supplied PortAudio error number into a human readable message. */ const char *Pa_GetErrorText( PaError errnum ); /* Sample formats These are formats used to pass sound data between the callback and the stream. Each device has a "native" format which may be used when optimum efficiency or control over conversion is required. Formats marked "always available" are supported (emulated) by all PortAudio implementations. The floating point representation (paFloat32) uses +1.0 and -1.0 as the maximum and minimum respectively. paUInt8 is an unsigned 8 bit format where 128 is considered "ground" */ typedef unsigned long PaSampleFormat; #define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ #define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ #define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ #define paInt24 ((PaSampleFormat) (1<<3)) #define paPackedInt24 ((PaSampleFormat) (1<<4)) #define paInt8 ((PaSampleFormat) (1<<5)) #define paUInt8 ((PaSampleFormat) (1<<6)) #define paCustomFormat ((PaSampleFormat) (1<<16)) /* Device enumeration mechanism. Device ids range from 0 to Pa_CountDevices()-1. Devices may support input, output or both. */ typedef int PaDeviceID; #define paNoDevice -1 int Pa_CountDevices( void ); typedef struct { int structVersion; const char *name; int maxInputChannels; int maxOutputChannels; /* Number of discrete rates, or -1 if range supported. */ int numSampleRates; /* Array of supported sample rates, or {min,max} if range supported. */ const double *sampleRates; PaSampleFormat nativeSampleFormats; } PaDeviceInfo; /* Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the default device ids for input and output respectively, or paNoDevice if no device is available. The result can be passed to Pa_OpenStream(). On the PC, the user can specify a default device by setting an environment variable. For example, to use device #1. set PA_RECOMMENDED_OUTPUT_DEVICE=1 The user should first determine the available device ids by using the supplied application "pa_devs". */ PaDeviceID Pa_GetDefaultInputDeviceID( void ); PaDeviceID Pa_GetDefaultOutputDeviceID( void ); /* Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure for the device specified. If the device parameter is out of range the function returns NULL. PortAudio manages the memory referenced by the returned pointer, the client must not manipulate or free the memory. The pointer is only guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). */ const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device ); /* PaTimestamp is used to represent a continuous sample clock with arbitrary start time that can be used for syncronization. The type is used for the outTime argument to the PortAudioCallback and as the result of Pa_StreamTime() */ typedef double PaTimestamp; /* PortAudioCallback is implemented by PortAudio clients. inputBuffer and outputBuffer are arrays of interleaved samples, the format, packing and number of channels used by the buffers are determined by parameters to Pa_OpenStream() (see below). framesPerBuffer is the number of sample frames to be processed by the callback. outTime is the time in samples when the buffer(s) processed by this callback will begin being played at the audio output. See also Pa_StreamTime() userData is the value of a user supplied pointer passed to Pa_OpenStream() intended for storing synthesis data etc. return value: The callback can return a non-zero value to stop the stream. This may be useful in applications such as soundfile players where a specific duration of output is required. However, it is not necessary to utilise this mechanism as StopStream() will also terminate the stream. A callback returning a non-zero value must fill the entire outputBuffer. NOTE: None of the other stream functions may be called from within the callback function except for Pa_GetCPULoad(). */ typedef int (PortAudioCallback)( void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, PaTimestamp outTime, void *userData ); /* Stream flags These flags may be supplied (ored together) in the streamFlags ... [truncated message content] |
From: <sco...@li...> - 2002-12-05 14:46:47
|
Update of /cvsroot/scopeapp/scopeapp/src/portaudio/pa_mac_core In directory sc8-pr-cvs1:/tmp/cvs-serv2086/pa_mac_core Added Files: pa_mac_core.c Log Message: Add common and CoreAudio-specific components of PortAudio. --- NEW FILE: pa_mac_core.c --- /* * $Id: pa_mac_core.c,v 1.1 2002/12/05 14:46:43 narge Exp $ * pa_mac_core.c * Implementation of PortAudio for Mac OS X Core Audio * * PortAudio Portable Real-Time Audio Library * Latest Version at: http://www.portaudio.com * * Authors: Ross Bencina and Phil Burk * Copyright (c) 1999-2000 Ross Bencina and Phil Burk * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * [...1222 lines suppressed...] return (PaError) past->past_IsActive; } /*************************************************************************/ PaTimestamp Pa_StreamTime( PortAudioStream *stream ) { AudioTimeStamp timeStamp; PaTimestamp streamTime; PaHostSoundControl *pahsc; internalPortAudioStream *past = (internalPortAudioStream *) stream; if( past == NULL ) return paBadStreamPtr; pahsc = (PaHostSoundControl *) past->past_DeviceData; AudioDeviceGetCurrentTime(pahsc->pahsc_AudioDeviceID, &timeStamp); streamTime = ( timeStamp.mFlags & kAudioTimeStampSampleTimeValid) ? timeStamp.mSampleTime : past->past_FrameCount; return streamTime; } |
From: <sco...@li...> - 2002-12-05 14:36:44
|
Update of /cvsroot/scopeapp/scopeapp/src/portaudio/pa_mac_core In directory sc8-pr-cvs1:/tmp/cvs-serv29500/pa_mac_core Log Message: Directory /cvsroot/scopeapp/scopeapp/src/portaudio/pa_mac_core added to the repository |
From: <sco...@li...> - 2002-12-05 14:36:44
|
Update of /cvsroot/scopeapp/scopeapp/src/portaudio/pa_common In directory sc8-pr-cvs1:/tmp/cvs-serv29500/pa_common Log Message: Directory /cvsroot/scopeapp/scopeapp/src/portaudio/pa_common added to the repository |
From: <sco...@li...> - 2002-12-05 14:35:29
|
Update of /cvsroot/scopeapp/scopeapp/src/portaudio In directory sc8-pr-cvs1:/tmp/cvs-serv28855/portaudio Log Message: Directory /cvsroot/scopeapp/scopeapp/src/portaudio added to the repository |
From: <sco...@li...> - 2002-12-05 14:07:47
|
Update of /cvsroot/scopeapp/scopeapp In directory sc8-pr-cvs1:/tmp/cvs-serv12502 Modified Files: License.rtf Log Message: Added the "How to Apply These Terms" section (accidentally omitted). Index: License.rtf =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/License.rtf,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** License.rtf 19 Jun 2002 11:48:03 -0000 1.3 --- License.rtf 5 Dec 2002 14:07:43 -0000 1.4 *************** *** 1,5 **** ! {\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Optima-Bold;\f1\fswiss\fcharset77 Optima-Regular;\f2\fmodern\fcharset77 Courier; ! \f3\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural --- 1,5 ---- ! {\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Optima-Bold;\f1\fswiss\fcharset77 Optima-Regular;\f2\fmodern\fcharset77 Courier; ! \f3\fswiss\fcharset77 Helvetica;\f4\fmodern\fcharset77 Courier-Oblique;} {\colortbl;\red255\green255\blue255;} \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural *************** *** 12,16 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f2 \cf0 \CocoaLigature0\ \ Copyright (C) 1989, 1991 Free Software Foundation, Inc. \ --- 12,16 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f2 \cf0 \CocoaLigature0 \ \ Copyright (C) 1989, 1991 Free Software Foundation, Inc. \ *************** *** 21,25 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f3 \cf0 \CocoaLigature1\ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural --- 21,25 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f3 \cf0 \CocoaLigature1 \ \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural *************** *** 157,163 **** \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f1 \cf0 \ \ ! \f2\fs24 $Header$\ } --- 157,255 ---- \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f0\b\fs42 \cf0 END OF TERMS AND CONDITIONS\ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f3\b0\fs26 \cf0 \ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f0\b\fs42 \cf0 \ul How to Apply These Terms to Your New Programs\ulnone \ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f1\b0\fs28 \cf0 \ ! If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\ \ + To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.\ + \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! \f2 \cf0 \CocoaLigature0 \ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f4\i \cf0 \ ! one line to give the program's name and an idea of what it does. ! \f2\i0 \ ! Copyright (C) ! \f4\i yyyy ! \f2\i0 ! \f4\i name of author ! \f2\i0 \ ! \ ! This program is free software; you can redistribute it and/or\ ! modify it under the terms of the GNU General Public License\ ! as published by the Free Software Foundation; either version 2\ ! of the License, or (at your option) any later version.\ ! \ ! This program is distributed in the hope that it will be useful,\ ! but WITHOUT ANY WARRANTY; without even the implied warranty of\ ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\ ! GNU General Public License for more details.\ ! \ ! You should have received a copy of the GNU General Public License\ ! along with this program; if not, write to the Free Software\ ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f1 \cf0 \CocoaLigature1 \ ! Also add information on how to contact you by electronic and paper mail.\ ! \ ! If the program is interactive, make it output a short notice like this when it starts in an interactive mode:\ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f2 \cf0 \CocoaLigature0 \ ! \ ! Gnomovision version 69, Copyright (C) ! \f4\i year ! \f2\i0 ! \f4\i name of author ! \f2\i0 \ ! Gnomovision comes with ABSOLUTELY NO WARRANTY; for details\ ! type `show w'. This is free software, and you are welcome\ ! to redistribute it under certain conditions; type `show c' \ ! for details.\ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f1 \cf0 \CocoaLigature1 \ ! The hypothetical commands ! \f2 `show w' ! \f1 and ! \f2 `show c' ! \f1 should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than ! \f2 `show w' ! \f1 and ! \f2 `show c' ! \f1 ; they could even be mouse-clicks or menu items--whatever suits your program.\ ! \ ! You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:\ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f2 \cf0 \CocoaLigature0 \ ! \ ! Yoyodyne, Inc., hereby disclaims all copyright\ ! interest in the program `Gnomovision'\ ! (which makes passes at compilers) written \ ! by James Hacker.\ ! \ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f4\i \cf0 signature of Ty Coon ! \f2\i0 , 1 April 1989\ ! Ty Coon, President of Vice\ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f1 \cf0 \CocoaLigature1 \ ! This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. \ ! \ ! \ ! \pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural ! ! \f2\fs24 \cf0 $Header$\ } |
From: <sco...@li...> - 2002-11-12 23:33:45
|
Update of /cvsroot/scopeapp/scopeapp/src In directory usw-pr-cvs1:/tmp/cvs-serv12067 Modified Files: Tag: scopeapp-gnustep ScopeView.m Log Message: Branch broke some stuff. First try at fixing. Index: ScopeView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.m,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 *** ScopeView.m 29 Oct 2002 05:15:13 -0000 1.11.2.1 --- ScopeView.m 12 Nov 2002 23:33:42 -0000 1.11.2.2 *************** *** 28,35 **** #import "ScopeAppGlobals.h" ! #ifdef __APPLE__ ! #import "GSVbox.h" ! #import "GSHbox.h" ! #endif static double gTimeScales[10] = {0.001,0.002,0.005,0.01,0.02,0.05,0.1}; --- 28,37 ---- #import "ScopeAppGlobals.h" ! //#ifdef __APPLE__ ! //#import "GSVbox.h" ! //#import "GSHbox.h" ! //#endif ! #import <AppKit/GSHbox.h> ! #import <AppKit/GSVbox.h> static double gTimeScales[10] = {0.001,0.002,0.005,0.01,0.02,0.05,0.1}; |
From: <sco...@li...> - 2002-10-29 06:10:46
|
Update of /cvsroot/scopeapp/scopeapp/src In directory usw-pr-cvs1:/tmp/cvs-serv744 Modified Files: ScopeAppDelegate.h ScopeAppDelegate.m ScopeView.m Log Message: Still more gnustep code removed. Index: ScopeAppDelegate.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeAppDelegate.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ScopeAppDelegate.h 19 Oct 2002 06:39:31 -0000 1.9 --- ScopeAppDelegate.h 29 Oct 2002 06:10:43 -0000 1.10 *************** *** 40,45 **** - (void) applicationDidFinishLaunching: (NSNotification *)not; - - (void) createMenu; - @end --- 40,43 ---- Index: ScopeAppDelegate.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeAppDelegate.m,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ScopeAppDelegate.m 29 Oct 2002 05:59:08 -0000 1.14 --- ScopeAppDelegate.m 29 Oct 2002 06:10:43 -0000 1.15 *************** *** 38,43 **** id sampler; - [self createMenu]; - // FIXME choose an appropriate InputSampler sampler = [[TestSampler alloc] init]; --- 38,41 ---- Index: ScopeView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.m,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ScopeView.m 29 Oct 2002 05:50:11 -0000 1.12 --- ScopeView.m 29 Oct 2002 06:10:43 -0000 1.13 *************** *** 28,36 **** #import "ScopeAppGlobals.h" - #ifdef __APPLE__ - #import "GSVbox.h" - #import "GSHbox.h" - #endif - static double gTimeScales[10] = {0.001,0.002,0.005,0.01,0.02,0.05,0.1}; static double gVoltScales[7] = {0.01,0.02,0.05,0.1,0.2,0.5,1}; --- 28,31 ---- |
From: <sco...@li...> - 2002-10-29 05:59:10
|
Update of /cvsroot/scopeapp/scopeapp/src In directory usw-pr-cvs1:/tmp/cvs-serv29291 Modified Files: ScopeAppDelegate.m Log Message: Removed gnustep-specific code from non-branch revision Index: ScopeAppDelegate.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeAppDelegate.m,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ScopeAppDelegate.m 19 Oct 2002 06:39:31 -0000 1.13 --- ScopeAppDelegate.m 29 Oct 2002 05:59:08 -0000 1.14 *************** *** 38,46 **** id sampler; - #ifdef __APPLE__ - // menu is loaded from MainMenu.nib - #else [self createMenu]; - #endif // FIXME choose an appropriate InputSampler --- 38,42 ---- *************** *** 67,82 **** { return YES; // FIXME change after adding support for reading from files ? - } - - - (void) createMenu - { - NSMenu* menu; - menu = [NSMenu new]; - - [menu addItemWithTitle: _(@"Quit") - action: @selector (terminate:) - keyEquivalent: @"q"]; - - [NSApp setMainMenu: menu]; } --- 63,66 ---- |
From: <sco...@li...> - 2002-10-29 05:56:32
|
Update of /cvsroot/scopeapp/scopeapp/MacCRO X.pbproj In directory usw-pr-cvs1:/tmp/cvs-serv28564/MacCRO X.pbproj Modified Files: project.pbxproj Log Message: Add SpectrumView.[mh]; use Jaguar's Project Builder |
From: <sco...@li...> - 2002-10-29 05:50:14
|
Update of /cvsroot/scopeapp/scopeapp/src In directory usw-pr-cvs1:/tmp/cvs-serv26901 Modified Files: ScopeController.m ScopeView.h ScopeView.m TraceView.m XYPlotView.h XYPlotView.m Log Message: Remove gnustep-specific code (will be merged back in when gnustep version works properly) Index: ScopeController.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeController.m,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ScopeController.m 19 Oct 2002 06:39:31 -0000 1.8 --- ScopeController.m 29 Oct 2002 05:50:11 -0000 1.9 *************** *** 29,43 **** #import "ScopeController.h" ! @interface ScopeController (ScopeControllerInternal) ! ! // create the trace window which is managed by this ScopeController, ! // with the appropriate subviews ! -(id) createTraceWindow; ! ! // create the NSPanel containing all the controls for this ! // ScopeController's trace views ! -(id) createControlPanel; ! ! @end @implementation ScopeController --- 29,37 ---- #import "ScopeController.h" ! enum { ! eOscilloscopeTab = 0, ! eXYPlotTab, ! eSpectrumTab ! }; @implementation ScopeController *************** *** 45,49 **** -(id) initWithSampler: (id <InputSampler, NSObject>) sampler { ! self = [super initWithWindow: nil]; if(self != nil) --- 39,43 ---- -(id) initWithSampler: (id <InputSampler, NSObject>) sampler { ! self = [super initWithWindowNibName: @"ScopeWindow"]; if(self != nil) *************** *** 52,63 **** mySampler = sampler; ! if(mySampler != nil) ! { ! [mySampler retain]; ! } ! ! [self createTraceWindow]; ! [self createControlPanel]; ! [self windowDidLoad]; // would be called when loading from nib nCenter = [NSNotificationCenter defaultCenter]; --- 46,50 ---- mySampler = sampler; ! [mySampler retain]; nCenter = [NSNotificationCenter defaultCenter]; *************** *** 66,70 **** [nCenter addObserver: self selector: @selector(windowResignedMain:) name: @"NSWindowDidResignMain" object: [self window]]; - } --- 53,56 ---- *************** *** 88,93 **** // selectTabViewItemAtIndex: will ever call // tabView:didSelectTabViewItem: ! [myModeTabs selectTabViewItem: myScopeTab]; ! [self tabView: myModeTabs didSelectTabViewItem: myScopeTab]; [myModeTabs setDelegate: self]; } --- 74,80 ---- // selectTabViewItemAtIndex: will ever call // tabView:didSelectTabViewItem: ! [myModeTabs selectTabViewItemAtIndex: eOscilloscopeTab]; ! [self tabView: myModeTabs didSelectTabViewItem: ! [myModeTabs tabViewItemAtIndex: eOscilloscopeTab]]; [myModeTabs setDelegate: self]; } *************** *** 116,122 **** --- 103,113 ---- } + -(void) tabViewDidChangeNumberOfTabViewItems: (NSTabView*) tabView { } + -(void) tabView: (NSTabView *) tabView didSelectTabViewItem: (NSTabViewItem *) tabViewItem; { + int newTab = [tabView indexOfTabViewItem: tabViewItem]; + // assert that the tab view that has been switched is the mode tabs if(tabView != myModeTabs) { return; } *************** *** 131,230 **** // show and start drawing in the new active view ! if(tabViewItem == myScopeTab) { [[[self window] contentView] addSubview: myScopeView]; [myScopeView startDrawingWithSampler: mySampler]; ! } ! else if(tabViewItem == myXYPlotTab) ! { [[[self window] contentView] addSubview: myXYPlotView]; [myXYPlotView startDrawingWithSampler: mySampler]; ! } ! else if(tabViewItem == myXYPlotTab) ! { } } - @end - - @implementation ScopeController (ScopeControllerInternal) ! - createTraceWindow ! { ! NSWindow* window; ! NSRect rect = NSMakeRect(0, 0, 400, 400); ! unsigned int flags; ! ! // create the window ! flags = (NSTitledWindowMask | NSClosableWindowMask | ! NSMiniaturizableWindowMask | NSResizableWindowMask); ! window = [[NSWindow alloc] initWithContentRect: rect ! styleMask: flags ! backing: NSBackingStoreBuffered ! defer: YES]; ! [window setTitle: _(@"MacCRO X")]; ! // FIXME move the window to an appropriate position ! // [window setFrameTopLeftPoint: NSMakePoint(20, 63)]; ! [window setMinSize: NSMakeSize(400, 422)]; ! [window setFrameAutosaveName: @"TraceWindow"]; ! [window setFrameUsingName: @"TraceWindow"]; ! ! // create the trace views ! // these are not placed in the window yet; that will be ! // done when a tab is selected in the control panel ! myScopeView = [[ScopeView alloc] initWithFrame: rect]; ! [myScopeView awakeFromNib]; ! [myScopeView autorelease]; ! ! myXYPlotView = [[XYPlotView alloc] initWithFrame: rect]; ! [myXYPlotView awakeFromNib]; ! [myXYPlotView autorelease]; ! ! // now claim control of the window ! [self setWindow: window]; ! [window release]; ! ! return self; ! } ! ! - createControlPanel { ! // the layout-related magic numbers in this code ! // were determined by running nibtool -a on the ! // original nib file. If you change them, be sure ! // that the interface still looks right. ! NSRect rect; ! unsigned int flags; ! ! // Create the panel ! rect = NSMakeRect(82, 158, 713, 375); ! flags = (NSTitledWindowMask | NSMiniaturizableWindowMask | ! NSUtilityWindowMask); ! myControlPanel = [[NSPanel alloc] initWithContentRect: rect ! styleMask: flags ! backing: NSBackingStoreBuffered ! defer: YES]; ! [myControlPanel setTitle: _(@"Display Controls")]; ! [myControlPanel setFrameAutosaveName: @"ControlPanel"]; ! [myControlPanel setFrameUsingName: @"ControlPanel"]; ! ! // Create the mode tab view ! rect = NSMakeRect(-11, -7, 735, 372); ! myModeTabs = [[NSTabView alloc] initWithFrame: rect]; ! [[myControlPanel contentView] addSubview: myModeTabs]; ! ! // add and populate the tabs ! myScopeTab = [[NSTabViewItem alloc] init]; ! [myScopeTab setLabel: _(@"Oscilloscope")]; ! [myScopeView createControls: [myScopeTab view]]; ! [myModeTabs addTabViewItem: myScopeTab]; ! ! myXYPlotTab = [[NSTabViewItem alloc] init]; ! [myXYPlotTab setLabel: _(@"X/Y Plot")]; ! [myXYPlotView createControls: [myXYPlotTab view]]; ! [myModeTabs addTabViewItem: myXYPlotTab]; ! ! return self; } @end --- 122,149 ---- // show and start drawing in the new active view ! switch(newTab) { + case eOscilloscopeTab: [[[self window] contentView] addSubview: myScopeView]; [myScopeView startDrawingWithSampler: mySampler]; ! break; ! case eXYPlotTab: [[[self window] contentView] addSubview: myXYPlotView]; [myXYPlotView startDrawingWithSampler: mySampler]; ! break; ! case eSpectrumTab: ! break; } } ! -(BOOL) tabView: (NSTabView*) tabView ! shouldSelectTabViewItem: (NSTabViewItem*) tabViewItem { ! return YES; } + + -(void) tabView: (NSTabView*) tabView + willSelectTabViewItem: (NSTabViewItem*) tabViewItem { } @end Index: ScopeView.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ScopeView.h 19 Oct 2002 06:39:31 -0000 1.8 --- ScopeView.h 29 Oct 2002 05:50:11 -0000 1.9 *************** *** 80,85 **** -(id) updateControls; - -(id) createControls: (NSView*) parentView; - - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount --- 80,83 ---- Index: ScopeView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.m,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ScopeView.m 19 Oct 2002 06:39:31 -0000 1.11 --- ScopeView.m 29 Oct 2002 05:50:11 -0000 1.12 *************** *** 26,29 **** --- 26,35 ---- #import "ScopeView.h" + #import "ScopeAppGlobals.h" + + #ifdef __APPLE__ + #import "GSVbox.h" + #import "GSHbox.h" + #endif static double gTimeScales[10] = {0.001,0.002,0.005,0.01,0.02,0.05,0.1}; *************** *** 349,357 **** return self; - } - - -(id) createControls: (NSView*) parentView - { - #warning } --- 355,358 ---- Index: TraceView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/TraceView.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TraceView.m 19 Oct 2002 06:39:31 -0000 1.5 --- TraceView.m 29 Oct 2002 05:50:11 -0000 1.6 *************** *** 328,338 **** [self updateDisplay: 0]; [self updateDisplay: 1]; ! ! // Override for what seems to be a bug in gnustep ! #ifdef __APPLE__ [self display]; ! #else ! [self setNeedsDisplay: YES]; ! #endif [myDrawThreadState unlock]; } --- 328,334 ---- [self updateDisplay: 0]; [self updateDisplay: 1]; ! [self display]; ! [myDrawThreadState unlock]; } Index: XYPlotView.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/XYPlotView.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XYPlotView.h 19 Oct 2002 06:39:31 -0000 1.3 --- XYPlotView.h 29 Oct 2002 05:50:11 -0000 1.4 *************** *** 56,61 **** -(id) updateControls; - -(id) createControls: (NSView*) parentView; - @end --- 56,59 ---- Index: XYPlotView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/XYPlotView.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** XYPlotView.m 19 Oct 2002 06:39:31 -0000 1.6 --- XYPlotView.m 29 Oct 2002 05:50:11 -0000 1.7 *************** *** 85,93 **** -(id) updateControls { return self; } - -(id) createControls: (NSView*) parentView - { - #warning - } - - (id)updateDisplay: (int) inTrace { --- 85,88 ---- |
From: <sco...@li...> - 2002-10-29 05:15:16
|
Update of /cvsroot/scopeapp/scopeapp/src In directory usw-pr-cvs1:/tmp/cvs-serv16742 Modified Files: Tag: scopeapp-gnustep ScopeController.m ScopeView.m SpectrumView.h SpectrumView.m Log Message: Update implementation of control creation functions (still incomplete!) Index: ScopeController.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeController.m,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** ScopeController.m 19 Oct 2002 06:39:31 -0000 1.8 --- ScopeController.m 29 Oct 2002 05:15:13 -0000 1.8.2.1 *************** *** 66,70 **** [nCenter addObserver: self selector: @selector(windowResignedMain:) name: @"NSWindowDidResignMain" object: [self window]]; - } --- 66,69 ---- Index: ScopeView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.m,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** ScopeView.m 19 Oct 2002 06:39:31 -0000 1.11 --- ScopeView.m 29 Oct 2002 05:15:13 -0000 1.11.2.1 *************** *** 26,29 **** --- 26,35 ---- #import "ScopeView.h" + #import "ScopeAppGlobals.h" + + #ifdef __APPLE__ + #import "GSVbox.h" + #import "GSHbox.h" + #endif static double gTimeScales[10] = {0.001,0.002,0.005,0.01,0.02,0.05,0.1}; *************** *** 353,357 **** -(id) createControls: (NSView*) parentView { ! #warning } --- 359,452 ---- -(id) createControls: (NSView*) parentView { ! /* Magic numbers in this function are mostly ! * taken from the Aqua Human Interface Guidelines */ ! /* Hold on to your hats, this one's going to be nasty */ ! NSSlider* slider; ! NSTextField* text; ! NSTextField* genericText; ! NSTextField* genericSmallText; ! NSTextFieldCell* genericTextCell; ! NSMatrix* matrix; ! NSButtonCell* genericRadio; ! NSButton* genericCheckbox; ! NSControl* previousControl; ! GSVbox* bigVbox; ! GSVbox* smallVbox; ! GSHbox* bigHbox; ! GSHbox* smallHbox; ! ! /* first create our "generic" controls; these are ! * duplicated with -[NSObject copy] to create ! * real ones */ ! genericText = [[NSTextField alloc] init]; ! [genericText setSelectable: NO]; ! [genericText setEditable: NO]; ! ! genericSmallText = [genericText copy]; ! [genericSmallText setControlSize: NSSmallControlSize]; ! [genericSmallText setFont: ! [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; ! ! genericTextCell = [[NSTextFieldCell alloc] init]; ! [genericTextCell setSelectable: NO]; ! [genericTextCell setEditable: NO]; ! [genericSmallText setControlSize: NSSmallControlSize]; ! [genericTextCell setFont: ! [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; ! ! genericRadio = [[NSButtonCell alloc] init]; ! [genericRadio setButtonType: NSRadioButton]; ! [genericRadio setControlSize: NSSmallControlSize]; ! [genericRadio setFont: ! [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; ! ! genericCheckbox = [[NSButton alloc] init]; ! [genericCheckbox setButtonType: NSSwitchButton]; ! [genericCheckbox setControlSize: NSSmallControlSize]; ! [genericCheckbox setFont: ! [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; ! ! /* the "big" boxes are the top-level ones */ ! /* bigVbox is the highest-level box */ ! bigVbox = [GSVbox new]; ! [bigVbox setYBorder: 12]; ! ! /* bigHbox is the current row in bigVbox */ ! bigHbox = [GSHbox new]; ! [bigHbox setHBorder: 20]; ! ! /* smallVbox is the current column in bigHbox */ ! smallVbox = [GSVbox new]; ! ! /* Offset controls */ ! text = [genericText copy]; ! [text setTitle: _(@"Offsets")]; ! [smallVbox addView: text withMinYMargin: 12]; ! ! smallHbox = [GSHbox new]; ! ! text = [genericSmallText copy]; ! [text setTitle: _(@"A")]; ! [smallHbox addView: text]; ! ! text = [genericSmallText copy]; ! [text setTitle: _(@"B")]; ! [smallHbox addView: text]; ! ! [smallVbox addView: smallHbox]; ! ! [bigHbox addView: smallVbox]; ! ! [bigVbox addView: bigHbox]; ! ! [parentView addSubview: bigVbox]; ! ! [genericCheckbox release]; ! [genericRadio release]; ! [genericText release]; ! [genericTextCell release]; ! [genericSmallText release]; ! ! return self; } Index: SpectrumView.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/SpectrumView.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** SpectrumView.h 29 Oct 2002 04:24:46 -0000 1.1 --- SpectrumView.h 29 Oct 2002 05:15:13 -0000 1.1.2.1 *************** *** 68,70 **** --- 68,72 ---- -(id) updateControls; + -(id) createControls: (NSView*) parentView; + @end Index: SpectrumView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/SpectrumView.m,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** SpectrumView.m 29 Oct 2002 04:24:46 -0000 1.1 --- SpectrumView.m 29 Oct 2002 05:15:13 -0000 1.1.2.1 *************** *** 85,88 **** --- 85,93 ---- -(id) updateControls { return self; } + -(id) createControls: (NSView*) parentView + { + #warning + } + - (id)updateDisplay: (int) inTrace { |