This is line2sine.h in view mode; [Download] [Up]
// convert lines from a Diagram document into sinusoids. // // Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> // Creation Date: Wed Jun 25 15:33:07 GMT-0800 1997 // Last Modified: Thu Jun 26 19:12:34 GMT-0800 1997 // Filename: .../sig/examples/line2sine/line2sine.h // Syntax: C++ // $Smake: smake -v `architecture` %f // $Smake-next: cc -Wall -O -o %b.next %f -I../../include -L../../lib -lsig % // -lg++ && strip %b.next && rm -f %b && ln -s %b.next %b // $Smake-linux: cc -Wall -O -o %b.linux %f -I../../include -L../../lib -lsig % // -lg++ && strip %b.linux && rm -f %b && ln -s %b.linux %b // #ifndef _LINETWOSINE_H_INCLUDED #define _LINETWOSINE_H_INCLUDED #include <fstream.h> #include "Vertex.h" #include "OscParameter.h" ////////////////////////////// // // checkMinMax -- check minfreq and maxfreq for correct input // void checkMinMax(double& min, double& max); ////////////////////////////// // // exitHelp -- prints help for program, then exits the program // void exitHelp(char* args[]); ////////////////////////////// // // extractAmpEnvelope -- creates the amplitude envelope for // the current line in the input file. // void extractAmpEnvelope(fstream& infile, OscParameter& output); ////////////////////////////// // // findLine -- returns the number tag for the current line being // processed in the file stream. Returns -1 if no more lines. // int findLine(fstream& infile); ////////////////////////////// // // findVertex -- returns the number tag for the current vertex being // processed in the file stream. Returns -1 if no more vertices. // int findVertex(fstream& infile); ////////////////////////////// // // getDimensions -- gets the window dimensions of the Diagram // document, and also gets the number of lines. Origin // is in the upper left corner. // void getDimensions(const char* filename, double& x, double& y); ////////////////////////////// // // extractNumber -- for use only with getDimensions. // int extractNumber(ifstream& infile); ////////////////////////////// // // getLineInfo -- return parameter information for one sinusoid. // you give it the file stream and it will extract the next // line from it. It is an error to look for a line when // there are no more lines in Diagram file. // OscParameter getLineInfo(fstream& infile, Vertices& vertices); ////////////////////////////// // // getVertexCoordinates -- returns the vertex coordinates // You must guarentee that valid data can be extracted // X value is in fractions of the total Duration. // Y value is in hertz. // doubleXY getVertexCoordinates(fstream& infile); ////////////////////////////// // // inputParameters // void inputParameters(const char* filename, OscParameters& parameters); ////////////////////////////// // // readVertices -- reads in an array of the vertices for // processing with lines. // void readVertices(char* filename, Vertices& vertices); ////////////////////////////// // // string2double -- converts a string into a float // double string2double(const char* aString); ////////////////////////////// // // string2int -- converts a string into an int // int string2int(const char* aString); #endif _LINETWOSINE_H_INCLUDED
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.