Ircam - Centre Georges-Pompidou Équipe Analyse/Synthèse

Definitions des types utilises


 *    ^                                                                                ^  
 *   /!\  All modification in a structure have to be reported in the following files: /!\ 
 *   ---                                                                              --- 
 *                 init.c, free.c
 */

#if defined(__alpha)
#include 
#include 
#include 
#endif

#if defined(__mips64) || defined(__alpha)
typedef unsigned int bit32;
#else
typedef unsigned long bit32;                 /* was not unsigned.. */
#endif

typedef unsigned char byte;

#ifndef STRING_DEFINED
typedef char STRING[MAX_CHAR];
#define STRING_DEFINED 1
#endif

struct _MenuItem;
struct _KnownFont;
struct _KnownFile;
struct _SvpOptions;
struct _AnalysisContext;
struct _Scale;
struct _Margins;
struct _DisplayContext;
struct _Data;
struct _Channel;
struct _Source;
struct _Buffer;
struct _BufferName;
struct _Selection;
struct _SelectionList;
struct _SynchroTarget;
struct _ActionSynchroList;
struct _SynchroBase;
struct _View;
struct _Frame;
struct _XsWindow;
struct _Options;
struct _DefaultFormat;
struct _DefaultBpf;
struct _ColorRamp;

typedef struct _Input
{  
  XtInputId         *inputId;                  /* */
  FILE              *stream;                   /* */
  int                filedes;                  /* */
  unsigned long      nb;                       /* number of bytes read */
  unsigned long      nbTotal;                  /* number of bytes to read */
}
Input;

typedef struct _Fts
{  
  FILE              *stream;
  int                filedes;
  struct _Buffer    *buffer;
  struct _View      *destView;
}
Fts;

typedef struct _MenuItem 
{
  char              *name;                     /* name of the widget item */
  char               label[9];                    /* the label for the item */
  WidgetClass       *class;                    /* pushbutton, label, separator... */
  char               mnemonic;                 /* mnemonic; NULL if none */
  char              *accelerator;              /* accelerator; NULL if none */
  char              *accelText;                /* to be converted to compound string */
  void             (*callback)();              /* routine to call; NULL if none */
  XtPointer          callbackData;             /* clientData for callback() */
  struct _MenuItem  *subItems;                 /* pullright menu items, if not NULL */
  Widget             subWidget;                /* pullright menu widget, if not NULL */
}
MenuItem;

typedef struct _KnownFont 
{
  STRING             name;                     /* */
  XFontStruct       *xStruct;                  /* */
} 
KnownFont;

typedef struct _KnownFile
{
  short              type;                     /* FILE_TYPE_[SF, AIFF, ..] */
  STRING             name;                     /* file name (.. ahh... yes !) */
  FILE              *stream;                   /* stream (return by fopen) */
  int                descr;                    /* descriptor (return by fno) */
  struct stat        status;                   /* got with lstat(name, &status) */
  caddr_t            mmap;                     /* address of memory map of the file */
  int	     	     STdescr;		       /* descriptor of file opened by the sound Tool */
} 
KnownFile;

typedef struct _SvpOptions /* (modif 30/07/98) */
/* any change must be reported to copySvpOptions */
{
  int                fftSize;                  /* fft size in the super vp command line */
  int                windowSize;               /* window size */
  int                step;                     /* step size */
  STRING             output;                   /* super vp output (ampl or ampl_db) */
}
SvpOptions;

typedef struct _AnalysisContext
/* any change must be reported to copyAnalysisContext */
{
  Boolean            fromAnalCt;               /* True: compute analysis from selection copied in analysis context
						  False:   ''      ''     ''  active selection in source view */
  short              type;                     /* type of analysis: ANALYSIS_TYPE_### */
  short              spectrumType;             /* type of scale: SPECTRUM_TYPE_### */
  short              windowType;               /* type of window: WINDOW_TYPE_### */
  short              phasisType;               /* type of phasis warping: PHASIS_TYPE_### */
  double             start;                    /* */
  long               length;                   /* */
  float              f0;                       /* */
  float              f0Min;                    /* */
  float              f0Max;                    /* */
  float              freqMax;                  /* */
  long               subDiv;                   /* */
  float              f0Ratio;                  /* */
  float              picsTreshold;             /* */
  float              harmoTreshold;            /* */
  short		     power2;		       /* size of window */
  SvpOptions*        svpOptions;                /* options in the super vp command line */   
}
AnalysisContext;

typedef struct _Scale
{
  GC                 gc;                       /* Graphic Context for this axis only */
  KnownFont         *font;                     /* font for the string unit */
  short              type;                     /* x axis or y axis DIM_TYPE_[x, y, ..]*/
  STRING             unit;                     /* written under the hor. axis at right end */
  long               nbPixPerDiv;              /* minimum nb of pixesl between two primary divisions */
  long               horTxtOffset;             /* offset from primary hatch to middle of x label strings
						* e.g. horTxtOffset=3  =>  x label string middle is 3 pixels
						* at right of primary hatch bar */
  long               verTxtOffset;             /* offset between top of x label strings and hor. axis
						* e.g. 6 places the top of x label strings 6 pixels
						* under  the hor. axis */
  long               prLen;                    /* length of the primary hatch-times bar */
  long               scLen;                    /* length of the secondary hatch-times bar */
  long               trLen;                    /* length of the tertiary hatch-times bar */
  long               axisOffset;               /* position of the axis from left or bottom drawable */
  long               unitMargin;               /* margin between top of unit string and axis */
  long               maxDigitsFraction;        /* maximum of digits in the fractional part of x label strings */
  long               maxDigitsInt;             /* maximum of digits in the integer part of x label strings */
}
Scale;

typedef struct _Margins
{  
  long               top;                      /* top, */
  long               bottom;                   /* bottom, */
  long               left;                     /* left, */
  long               right;                    /* and right margins in pixel */
}
Margins;

typedef struct _DisplayContext
{
  Boolean            updated;                  /* display context is updated by a first use */
  GC                 gc;                       /* Graphic Context */
  XColor             background;               /* the background color, set in the gc */
  XColor             foreground;               /* the foreground color, set in the gc */
  Margins           *margins;                  /* top, bottom, left and right  margins in pixel */
  XRectangle         clipRectangle;            /* rectangle used to clip the "in margins" area */
  KnownFont         *font;                     /* font for nothing for the moment but..
						* "on ne sait jamais" */
  Boolean            visibleSignal;            /* signal must be visible */
  Boolean            visibleScales;            /* scales must be visible */
  Boolean	     visibleScalesInactive;    /* scales must be visible even when the view is inactive */
  Boolean            visibleSelections;        /* selections must be visible */
  Boolean            visibleColorScale;        /* (modif 01/09/98) colorscale must be visible */
  Boolean            visibleColorScaleInactive;/* (modif 02/09/98) colorscale must be visible even when the view is inactive */
  short              mode;                     /* line or shadow */
  double             coeff[MAX_DIM];           /* scale coeff. of display in pixels per unit */
  double             offset[MAX_DIM];          /* starting offset of display in pixels 
						*      pixel = coeff * unit + offset */
  Boolean            centredXAxis;             /* is the x axis centred in the Frame ? 
						* ^-  redondant avec  -v */
  Boolean            freezeAxis;               /* dont compute min and max, 
						  but take them in the display context of the previous buffer in the view */
  double             zoomCoeff;                /* zoom factor (1/2 means zooming in, half page width) */
  double             pageCoeff;                /* page moving factor (1/2 means moving an half page forward) */
  Scale             *scale[MAX_DIM];           /* the scales */
  Boolean            outlineMode;              /* if true, the view is not completly draw, used for move*/ 
                                               /* (modif 14/08/98) */ 
}
DisplayContext;

typedef struct _Data
{
  int		     type;                     /* format of samples: 
						* DATA_TYPE_[ALAW, ULAW, CHAR, SHORT, LONG, FLOAT] */
  unsigned long      nb;                       /* number of values */
  int                size;                     /* size of samples in bytes in memory */
  caddr_t            values;                   /* pointer to values (to be cast later) 
						* ###  OR   ?? ###*/
  short              increment;                /* increment when entrelaced values (mult. channels) */
  double             min[MAX_DIM];             /* the min. value */
  double             max[MAX_DIM];             /* the max. value */
  double             peakAmp[MAX_DIM];         /* the amplitude peak */
  double 	     globalPeakAmp[MAX_DIM];   /* the amplitude peak from the beginning until where we are */
}
Data;

typedef struct _Channel
{
  struct _Buffer    *buffer;                   /* the buffer where channel is from */
  Data              *data;                     /* the data */
  float		     outputLevel;	       /* coeff to set the sound output level */
  int                nview;                    /* number of view in which the channel is displayed */
  struct _View      *view[MAX_VIEW_CHANNEL];   /* the view in which the channel is displayed, NULL if not */
}
Channel;

typedef struct _Source
{
  struct _View      *view;                     /* the source view, if already exists */
  float              analysisBeginTime;        /* the position in the source view where the analysis begins */
                                               /* (modif 11/08/98) */
  struct _Buffer    *buffer;                   /* the source buffer */
  Channel           *channel;                  /* the source channel */
  struct _Selection *selection;                /* the source selection (copy of the view's selection) */
  AnalysisContext   *analysisContext;          /* analysis Context */
}
Source;

typedef struct _Buffer
{
  Widget             menuButton;               /* button in the buffer's list menu widget */
  Widget             popupButton;              /* button in the buffer's popup menu widget */
  short              type;                     /* format of buffer:
						* BUFFER_TYPE_[sample, List1D, List2D, ListOfTrames, half2D] */
  short              dimension;                /* dimension of buffer: DIM_TYPE_[1D, 2D, 3D] */
  short              nature;                   /* nature of buffer:
						* BUFFER_NATURE_[TAsignal, TFsignal, spectrum, spectrogram,...] */
  STRING             identifier;               /* identifier (for ex. file basename) */
  STRING             comment;                  /* comment string */
  double             rate;                     /* sampling rate if one */
  Boolean            swap;                     /* the disk's samples has to be swaped */
  long               dataOffset;               /* offset of data (from buffer->file->mmap) */
  double             min[MAX_DIM];             /* the min. value */
  double             max[MAX_DIM];             /* the max. value */
  double             peakAmp[MAX_DIM];         /* the amplitude peak */
  Boolean            writable;                 /* the buffer is writable if file is writable */
  Boolean            modified;                 /* the buffer is modified if buffer != file */
  KnownFile         *file;                     /* the file where are saved the data if it exists */
  Input             *input;                    /* the input from which the data were read */
  XtInputId	     inputId;		       /* the inputId in input.c */
  Source            *source;                   /* the source from which the data were computed */
  int                nchannel;                 /* number of sound channels in the file */
  Channel           *channel[MAX_CHANNEL];     /* the channel list (### PROVISOIRE array ###) */
  Boolean	     visitingMode;	       /* memorymap or load */
#if defined(__alpha)
  SFHEADER	     SFhd;		       /* Header used by the sound Tool */
#endif
  Boolean            removableFile;            /* the associated file can be removed */
}
Buffer;

typedef struct _BufferName
{
  STRING             name;                     /* name (for ex. file basename) */
  int                number;                   /* number of buffers which have that name */
}
BufferName;

typedef struct _Selection
{
  short              type;                     /* SELECT_TYPE_[CURSOR, SEGMENT, RECTANGLE, POLYGON, DIPHONE..] */
  short              dimension;                /* dimension: A segment: DIM_TYPE_[x, y, z]
						*            A surface: DIM_TYPE_[xy, yz, xz]
						*            A volume:  DIM_TYPE_xyz */
  STRING             identifier;               /* identifier */
  STRING	     textValues;	       /* text in the window->textWidget with the values of the selection */
  Boolean            visible;                  /* is visible ? */
  int                isynchro;                 /* index in the view's synchro list (### PROVISOIRE array ###) */
  int                nmark;                    /* number of marks (if polygon) */
  int                pixelMark[MAX_MARK];      /* the marks list (### PROVISOIRE array ###) */
  double             valueMark[MAX_MARK];      /* the marks list (### PROVISOIRE array ###) */
}
Selection;

typedef struct _SelectionList                  /* THE ndimSelection FIRST SELECTIONS ARE RESERVED
					        * FOR THE [X, Y or z] AXIS DISPLAY SELECTION */
{
  int                nselection;               /* number of selections */
  int                ndimSelection;            /* number of dim.-selections 
						* EX: first = time, second = freq, etc.. */
  int                activeSelection;          /* active (or current) selection*/
  int                activeCursor;             /* active (or current) cursor */
  Selection         *selection[MAX_SELECT];    /* the selections list (### PROVISOIRE array ###) */
}
SelectionList;

typedef struct _SynchroTarget
{
  short              actionTarget;              /* (### PROVISOIRE type of ###) action to be done (target view) to synchronize */
  struct _View      *view;                      /* which view to synchronize with */
}
SynchroTarget;

typedef struct _ActionSynchroList
{
  int		     nsynchroTarget;	      	     /* number of target to synchronize with the view */
  SynchroTarget	    *synchroTarget[MAX_SYNCHRO];     /* list of the targets to synchronize */
}
ActionSynchroList;

typedef struct _SynchroBase
{
  Boolean 	     activeSynchro;			  /* True if  the synchros are activated */
  struct _View	    *tempViewTarget;		       	  /* pointer to the target View */
  Boolean	     actionsTab[MAX_ACTION][MAX_ACTION];  /* table of all the actions to synchronize */	
  Widget	     toggleTab[MAX_ACTION][MAX_ACTION];   /* table of the toggles in the synchroTab */
  Boolean	     xPageModified;			  /* flag = 1 if xPage has been modified */
  Boolean	     yPageModified;			  /* flag = 1 if yPage has been modified */
  int		     nactionSynchro;	               	  /* number of actions to synchronize with other views */
  ActionSynchroList *actionSynchroList[MAX_ACTION];  	  /* actions to synchronize with other views 
							   0 <=> page, 1<=> pageX ... */
}	
SynchroBase;


typedef struct _View
{
  struct _Frame     *frame;                    /* the parent frame */
  STRING             identifier;               /* identify the view (file, type..) */
  Widget             idWidget;                 /* identifer widget */
  Widget             menuButton;               /* button in the view's list menu widget */
  Widget             popupButton;              /* button in the view's popup menu widget */
  Pixmap             pixmap;                   /* Xwindow pixmap */
  GC                 gc;                       /* Xwindow Graphic Context to copy view in frame */
  Pixmap             clipMask;                 /* Xwindow clipMask, added to gc */
#ifdef openGL
  GLXPixmap          glxPixmap;                /* (modif 03/08/98) pixmap used by openGL */
  GLXContext         glxContext;               /* (modif 14/08/98) glx context used by openGL */
#endif
  GC                 gcClip;                   /* Xwindow Graphic Context to copy view pixmap  */
  int                nsegment;                 /* number of segments */
  XSegment           segment[MAX_SEGS];        /* segments drawn byXDrawSeg, for 2D signals */
#ifdef openGL
  GLuint             glListName;               /* name of the view's openGl display list */
#endif                                         /* (modif 12/08/98) */
  int                nDC;                      /* number of Display Context */
  int                activeDC;                 /* active (or current) Display Context */
  DisplayContext    *displayContext[MAX_DC];   /* display Context list (### PROVISOIRE array ###) */
  Buffer            *buffer;                   /* the assoc. buffer */
  int                ichannel;                 /* the assoc. channel */
  Channel           *channel;                  /* the assoc. channel */
  SelectionList     *selectionList;            /* the selection list (### PROVISOIRE array ###) */ 

  SynchroBase	    *synchroBase;	       /* all the elements which concern the synchronization */

  int                baseSelectionUndo;        /* base of Undo stack */
  int                nSelectionUndo;           /* active element of Undo stack */
  Selection         *selectionUndo[MAX_UNDO];  /* undo circular stack */
  AnalysisContext   *defaultAnalysisContext;   /* default analysis Context */
}
View;

typedef struct _Frame
{
  struct _XsWindow  *window;                   /* the parent window */
  Widget             drawWidget;               /* drawing area widget */
  Widget             menuButton;               /* button in the frame's list menu widget */
  Widget             popupButton;              /* button in the frame's popup menu widget */
  Dimension          width, height;            /* drawing area sizes */
  Pixmap             pixmap;                   /* global Xwindow pixmap */
#ifdef openGL
  GLXPixmap          glxPixmap;                /* pixmap for openGL (modif 03/08/98) */
  GLXContext         glxContext;               /* (modif 14/08/98) glx context used by openGL */
#endif  
  GC                 gc;                       /* global Xwindow graphic context,
						* to copy frame pixmap to drawingArea and some others op. */
  int                nview;                    /* number of views in the frame */
  int                activeView;               /* active (or current) view */
  View              *view[MAX_VIEW_FRAME];     /* the views list (### PROVISOIRE array ###) */
}
Frame;

typedef struct _XsWindow
{
  Widget             widget;                   /* MainWindow widget */
  Display           *display;                  /* display */
  Screen            *screen;                   /* screen */
  Window             xWindow;                  /* window X */
  char              *geometry;                 /* geometry */
  Dimension          width, height;            /* size */
  Widget	     textWidget;      	       /* text field with information on the activeSelection ...*/	
  Widget	     synchroButton;	       /* button to activate or deactivate the synhcro */
  int                nframe;                   /* number of frames in the window */
  int                activeFrame;              /* active (or current) frame */
  Frame             *frame[MAX_FRAME_WINDOW];  /* the frames list (### PROVISOIRE array ###) */
}
XsWindow;

typedef struct _ColorRamp /* (modif 03/08/98) */
{  
  int                ibramp;                   /* index of the begining of the color ramp */
  int                ieramp;                   /* index of the end of the color ramp */
  int                bDisplayRampAmpl;         /* index of the begining ampl of the displayed color ramp */
  int                eDisplayRampAmpl;         /* index of the end amplitude of the displayed color ramp */
}
ColorRamp;


typedef struct _Options
{
  Boolean            askBeforeExit;            /* */
#if defined(__alpha)
  char              *audioDisplay;             /* */
#endif
  Boolean            autoPlaceWindow;          /* */
  int                buttonBarSize;            /* */
  Boolean            createViewWarning;        /* */
  Boolean            firstViewCreated;         /* */
  char 		    *fileFormat;	       /* */	
  char              *frameActiveBkgColor;      /* */
  char              *frameActiveShadowType;    /* */
  int                frameActiveShadowCode;    /* */
  char              *frameBkgColor;            /* */
  char              *frameShadowType;          /* */
  int                frameShadowCode;          /* */
  char              *idActiveBkgColor;         /* */
  char              *idBkgColor;               /* */
  int                idLeftPosition;           /* */
  int                marginTop;                /* */
  int                marginBottom;             /* */
  int                marginRight;              /* */
  int                marginLeft;               /* */
  float              maxSecVerify;             /* */
  float              maxSecScreen;             /* */
  char              *mode;                     /* */
  int                nColors;                  /* */
  char              *openFilesIn;              /* */
  Boolean	     rawWarning;	       /* */
  Boolean  	     selectionQuestion;        /* */
  char              *sfDir;                    /* */
  Boolean            signalFullPage;           /* */
  int                splitPercent;            /* */
  Boolean            watchBufferLimits;        /* */
  char              *zoomMode;                 /* */
  Boolean	     privateColormap;           /* */
  char              *menuBarColor;        	/* */
  char              *buttonColor;         	/* */
  int		     activeBufferForeground;    /* */	
  int                nbSamplesBeforeWarning;    /* */	
  int                dBLimitForDisplay;          /* (modif 04/09/98) les valeurs < ne sont pas esprises en compte*/ 
}
*OptionsPtr, Options;

typedef struct _DefaultFormat
{
  char 		    *type;			/* short or float */
  int		     size;			/* size of samples in bytes in memory */
  double 	     rate;			/*  */
  char		    *byteOrder;			/* big or little */
  long 		     dataOffset;	        /* */
  int		     channels;			/* */
} DefaultFormat;

/*** New Typedef ***/
typedef struct _DefaultBpf
{
  Boolean invert;      /* inverse : y x values instead of x y values */
  int     columns;     /* nb columns */
  float   rate;        /* sample rate */
  char    *outputMode; 
  float   filterTime;  /* Filter Time for Super VP output */
} DefaultBpf;

/*** New Typedef ***/
enum TShortCutSynchro {
  SRCXLIM_TGXLIM, /* Synchro Source X limits / Target X limits */
  SRCSEG_TGSEG, /* Synchro Source Segment / Target Segment  */
  SRCSEG_TGANA, /* Synchro Source Segment / Target Analysis */
  SRCPG_TGPG    /* Synchro Source Page / Target Page        */
}; 


/****** XSedit Structures *****/
/* Definition de types */
typedef struct _xyCel {
  float x, y ;
  struct _xyCel * next ;
  void * props ;
} xyCel ;

typedef struct _listCel {
  struct _listCel * next ;
  void * data, * props ;
} listCel ;

typedef struct _BrkpfStruc {
  long drawPoints;
  long drawLines;
  long drawSelected;
  long delete;
  long select, move  ;
  long drag;
  long initDrag ;
  char dragType ;
  long dragIX ;
  long dragIY ;
  XPoint oldPoint ;
  listCel * listOfList ;
  listCel * listOfListCur ;
  xyCel * prevPointedCel ; 
  xyCel * movingCel ;
  long x, y, width, height ;
  unsigned moveMask ; 
  Cursor cutCurs, selCurs , moveCurs, penCurs;
  GC gc, gcTemp, clearGc, selectGc, zoomGc, frameGc, zoomClearGc , frameClearGc ;
} BrkpfStruc ;

typedef struct _polyLines {
  Display * myDisplay ;
  Drawable myWindow ;
  GC gc ;
  XPoint * beginPoint ;
  XPoint * endPoint ;
  XPoint * points;
  int npoints ;
} polyLines ;






Derniere modification : 15/09/98 - Vivien Guillet