1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // KBYTDownloadStream.h
- // Seas0nPass
- //
- // Created by Kevin Bradley on 3/9/07.
- // Copyright 2007 nito, LLC. All rights reserved.
- //
- #import <Cocoa/Cocoa.h>
- /**
-
- This class is used for downloading files from youtube, it takes care of fixing and multiplexing streams when necessary
-
- feed it a stream into downloadStream method and it will take care of the rest.
-
- */
- @protocol KBDownloadFileDelegate
- - (void)downloadFinished:(NSString *)downloadFile;
- - (void)downloadFailed:(NSString *)downloadFile;
- - (void)setDownloadProgress:(double)theProgress;
- @end
- @interface KBDownloadFile : NSObject <NSURLDownloadDelegate> {
-
- NSURLDownload *urlDownload;
- NSURLResponse *myResponse;
- float bytesReceived;
- NSString *downloadLocation;
- long long updateFrequency;
- long long freq;
- NSString *videoDownloadLocation;
- }
- @property (strong, atomic) void (^ProgressBlock)(double percentComplete);
- @property (strong, atomic) void (^FancyProgressBlock)(double percentComplete, NSString *status);
- @property (strong, atomic) void (^CompletedBlock)(NSString *downloadedFile);
- typedef void(^DownloadProgressBlock)(double percentComplete);
- typedef void(^FancyDownloadProgressBlock)(double percentComplete, NSString *downloadedFile);
- typedef void(^DownloadCompletedBlock)(NSString *downloadedFile);
- @property (nonatomic, retain) NSString *downloadLocation;
- @property (readwrite, assign) NSInteger downloadMode; //0 = muxed file, 1 = demuxed tracks
- - (void)downloadFileWithURL:(NSURL *)url
- toLocation:(NSString *)dlLocation
- progress:(DownloadProgressBlock)progressBlock
- completed:(DownloadCompletedBlock)completedBlock;
- - (long long)updateFrequency;
- - (void)setUpdateFrequency:(long long)newUpdateFrequency;
- - (void)setDownloadResponse:(NSURLResponse *)response;
- - (void)cancel;
- @end
|