00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00045
00211 #ifndef __SNDVIEW_H__
00212 #define __SNDVIEW_H__
00213
00214 #import <AppKit/AppKit.h>
00215
00216 #import "SndDisplayDataList.h"
00217 #import "SndDisplayData.h"
00218 #import "Snd.h"
00219
00220 enum SndViewStereoMode {
00221 SNDVIEW_LEFTONLY = 0,
00222 SNDVIEW_RIGHTONLY = 1,
00223 SNDVIEW_STEREOMODE = 256
00224 };
00225
00226 #define SND_SOUNDVIEW_MINMAX 0
00227 #define SND_SOUNDVIEW_WAVE 1
00228
00229
00230 #define NX_SOUNDVIEW_MINMAX SND_SOUNDVIEW_MINMAX
00231 #define NX_SOUNDVIEW_WAVE SND_SOUNDVIEW_WAVE
00232
00233 @interface SndView: NSView <NSCoding>
00234 {
00236 Snd *sound;
00238 Snd *pasteboardSound;
00240 id delegate;
00242 NSRange selectedFrames;
00244 int displayMode;
00246 NSColor *backgroundColour;
00248 NSColor *foregroundColour;
00250 NSColor *selectionColour;
00252 float reductionFactor;
00254 float amplitudeZoom;
00255
00269 struct {
00270 unsigned int disabled:1;
00271 unsigned int continuousSelectionUpdates:1;
00272 unsigned int cursorOn:1;
00273 unsigned int drawsCrosses:1;
00274 unsigned int autoscale:1;
00275 unsigned int bezeled:1;
00276 unsigned int notEditable:1;
00277 unsigned int notOptimizedForSpeed:1;
00278 } svFlags;
00279
00281 NSTimer *cursorFlashTimer;
00283 NSImage *dragIcon;
00284
00285 int optThreshold;
00286 int optSkip;
00287 float peakFraction;
00288
00290 int stereoMode;
00291
00292 int defaultRecordFormat;
00293 int defaultRecordChannelCount;
00294 double defaultRecordSampleRate;
00295 float defaultRecordSeconds;
00297 Snd *recordingSound;
00298
00301 NSRect cachedSelectionRect;
00303 NSRange previousSelectedFrames;
00304
00305 int lastPasteCount;
00306 int lastCopyCount;
00307 BOOL notProvidedData;
00308 BOOL noSelectionDraw;
00309 BOOL firstDraw;
00310
00312 SndDisplayDataList *dataList;
00313
00314 @private
00315 float ampScaler;
00316 float amplitudeDisplayHeight;
00318 NSArray *validPasteboardSendTypes;
00320 NSArray *validPasteboardReturnTypes;
00321 }
00322
00326 - hideCursor;
00327
00331 - showCursor;
00332
00339 - (BOOL) resignFirstResponder;
00340
00347 - (BOOL) becomeFirstResponder;
00348
00353 - (void) copy: (id) sender;
00354
00363 - (void) cut: (id) sender;
00364
00372 - (void) delete: (id) sender;
00373
00384 - (void) paste: (id) sender;
00385
00390 - (void) selectAll: (id) sender;
00391
00396 - delegate;
00397
00407 - didPlay: (id) sender duringPerformance: (SndPerformance *) performance;
00408
00417 - didRecord: (id) sender;
00418
00425 - (int) displayMode;
00426
00438 - (void) drawRect: (NSRect) rects;
00439
00448 - (void) getSelection: (unsigned int *) firstSample size: (unsigned int *) sampleCount;
00449
00456 - (void) setSelection: (int) firstSample size: (int) sampleCount;
00457
00464 - hadError: (id) sender;
00465
00473 - initWithFrame: (NSRect) frameRect;
00474
00479 - (BOOL) isAutoScale;
00480
00485 - (BOOL) isBezeled;
00486
00493 - (BOOL) isContinuousSelectionUpdates;
00494
00499 - (BOOL) isEditable;
00500
00507 - (BOOL) isEnabled;
00508
00515 - (BOOL) isOptimizedForSpeed;
00516
00521 - (BOOL) isPlayable;
00522
00527 - (BOOL) isEntireSoundVisible;
00528
00529 - (float) getDefaultRecordTime;
00530 - (void) setDefaultRecordTime: (float) seconds;
00531
00538 - (void) selectionChanged;
00539
00551 - (void) mouseDown: (NSEvent *) theEvent;
00552
00561 - (void) pasteboard: (NSPasteboard *) thePasteboard provideDataForType: (NSString *) pboardType;
00562
00567 - (void) pause: (id) sender;
00568
00578 - (void) play: (id) sender;
00579
00585 - (void) resume: (id) sender;
00586
00597 - (void) record: (id) sender;
00598
00603 - (void) stop: (id) sender;
00604
00618 - (BOOL) readSelectionFromPasteboard: (NSPasteboard *) thePasteboard;
00619
00629 - (void) setAmplitudeZoom: (float) newAmplitudeZoom;
00630
00635 - (float) amplitudeZoom;
00636
00643 - (float) reductionFactor;
00644
00669 - (BOOL) setReductionFactor: (float) reductionFactor;
00670
00677 - (void) scaleTo: (float) scaleRatio;
00678
00689 - (void) scaleToFit;
00690
00701 - (void) resizeToFit;
00702
00714 - (void) resizeToFit: (BOOL) withAutoscaling;
00715
00720 - (void) resizeToScale: (float) scaleRatio;
00721
00734 - setAutoscale: (BOOL) aFlag;
00735
00744 - (void) setBezeled: (BOOL) aFlag;
00745
00753 - (void) setContinuousSelectionUpdates: (BOOL) aFlag;
00754
00761 - (void) setDelegate: (id) anObject;
00762
00769 - (void) setDisplayMode: (int) aMode;
00770
00777 - (void) setEditable: (BOOL) aFlag;
00778
00785 - (void) setEnabled: (BOOL) aFlag;
00786
00797 - (void) setOptimizedForSpeed: (BOOL) flag;
00798
00809 - (void) setSound: (Snd *) aSound;
00810
00815 - (Snd *) sound;
00816
00823 - (void) setFrameSize: (NSSize) newSize;
00824
00836 - (Snd *) soundBeingProcessed;
00837
00849 - (void) tellDelegate: (SEL) theMessage;
00850
00862 - (void) tellDelegate: (SEL) theMessage duringPerformance: (SndPerformance *) performance;
00863
00871 - validRequestorForSendType: (NSString *) sendType returnType: (NSString *) returnType;
00872
00882 - (void) willPlay: sender duringPerformance: (SndPerformance *) performance;
00883
00892 - (void) willRecord: (id) sender;
00893
00899 - (BOOL) writeSelectionToPasteboard: (NSPasteboard *) thePasteboard types: (NSArray *) pboardTypes;
00900 - (BOOL) writeSelectionToPasteboardNoProvide: (NSPasteboard *) thePasteboard types: (NSArray *) pboardTypes;
00901
00902 - (id) initWithCoder: (NSCoder *) aDecoder;
00903 - (void) encodeWithCoder: (NSCoder *) aCoder;
00904
00905
00906
00907
00908
00909
00910 - (BOOL) invalidateCacheStartPixel: (int) start end: (int) end;
00911
00912 - (BOOL) invalidateCacheStartSample: (int) start end: (int) end;
00913
00914
00922 - (void) invalidateCache;
00923
00931 - (void) setDrawsCrosses: (BOOL) aFlag;
00932
00937 - (BOOL) drawsCrosses;
00938
00939
00940 - (void) setOptThreshold: (int) threshold;
00941 - (int) getOptThreshold;
00942 - (void) setOptSkip: (int) skip;
00943 - (int) getOptSkip;
00944 - (void) setPeakFraction: (float) fraction;
00945 - (float) getPeakFraction;
00946
00951 - (BOOL) setStereoMode: (enum SndViewStereoMode) stereoMode;
00952
00957 - (enum SndViewStereoMode) getStereoMode;
00958
00963 - (void) setSelectionColor: (NSColor *) color;
00964
00969 - (NSColor *) selectionColor;
00970
00975 - (void) setBackgroundColor: (NSColor *) color;
00976
00981 - (NSColor *) backgroundColor;
00982
00987 - (void) setForegroundColor: (NSColor *) color;
00988
00993 - (NSColor *) foregroundColor;
00994
01003 - (void) setDragIcon: (NSImage *) newDragIcon;
01004
01011 - (NSImage *) dragIcon;
01012
01013 @end
01014
01015 #endif