mirror of
https://github.com/oonyeje/Get-Hip.git
synced 2025-12-25 03:37:40 +00:00
40 lines
942 B
Objective-C
Executable File
40 lines
942 B
Objective-C
Executable File
//
|
|
// TDAudioStream.h
|
|
// TDAudioStreamer
|
|
//
|
|
// Created by Tony DiPasquale on 10/4/13.
|
|
// Copyright (c) 2013 Tony DiPasquale. The MIT License (MIT).
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
typedef NS_ENUM(NSUInteger, TDAudioStreamEvent) {
|
|
TDAudioStreamEventHasData,
|
|
TDAudioStreamEventWantsData,
|
|
TDAudioStreamEventEnd,
|
|
TDAudioStreamEventError
|
|
};
|
|
|
|
@class TDAudioStream;
|
|
|
|
@protocol TDAudioStreamDelegate <NSObject>
|
|
|
|
@required
|
|
- (void)audioStream:(TDAudioStream *)audioStream didRaiseEvent:(TDAudioStreamEvent)event;
|
|
|
|
@end
|
|
|
|
@interface TDAudioStream : NSObject
|
|
|
|
@property (assign, nonatomic) id<TDAudioStreamDelegate> delegate;
|
|
|
|
- (instancetype)initWithInputStream:(NSInputStream *)inputStream;
|
|
- (instancetype)initWithOutputStream:(NSOutputStream *)outputStream;
|
|
|
|
- (void)open;
|
|
- (void)close;
|
|
- (UInt32)readData:(uint8_t *)data maxLength:(UInt32)maxLength;
|
|
- (UInt32)writeData:(uint8_t *)data maxLength:(UInt32)maxLength;
|
|
|
|
@end
|