CPDFSoundPlayBar.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // CPDFSoundPlayBar.h
  3. // ComPDFKit_Tools
  4. //
  5. // Copyright © 2014-2024 PDF Technologies, Inc. All Rights Reserved.
  6. //
  7. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  8. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  9. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  10. // This notice may not be removed from this file.
  11. //
  12. #import <UIKit/UIKit.h>
  13. typedef NS_ENUM(NSInteger, CPDFSoundState) {
  14. CPDFSoundStateRecord = 0,
  15. CPDFSoundStatePlay
  16. };
  17. @class CPDFSoundPlayBar;
  18. @class CAnnotStyle;
  19. NS_ASSUME_NONNULL_BEGIN
  20. @protocol CPDFSoundPlayBarDelegate <NSObject>
  21. @optional
  22. - (void)soundPlayBarRecordFinished:(CPDFSoundPlayBar *)soundPlayBar withFile:(NSString *)filePath;
  23. - (void)soundPlayBarRecordCancel:(CPDFSoundPlayBar *)soundPlayBar;
  24. - (void)soundPlayBarPlayClose:(CPDFSoundPlayBar *)soundPlayBar;
  25. @end
  26. @interface CPDFSoundPlayBar : UIView
  27. @property (nonatomic, readonly) CAnnotStyle *annotStyle;
  28. @property (nonatomic, readonly) CPDFSoundState soundState;
  29. @property (nonatomic, weak) id<CPDFSoundPlayBarDelegate> delegate;
  30. - (instancetype)initWithStyle:(CAnnotStyle *)annotStyle;
  31. - (void)showInView:(UIView *)subView soundState:(CPDFSoundState)soundState;
  32. - (void)setURL:(NSURL *)url;
  33. - (void)startAudioRecord;
  34. - (void)stopRecord;
  35. - (void)startAudioPlay;
  36. - (void)stopAudioPlay;
  37. @end
  38. NS_ASSUME_NONNULL_END