//
//  FWHelper.h
//  AFFFmpegWrapper
//
//  Created by Scott on 7/4/09.
//  Copyright 2009 The Little App Factory. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "FWFileAnalyzer.h"
#import "FWFileTranscoder.h"


@interface FWHelper : NSObject {
	
	id							delegate;
	NSURL*						ffmpegURL;
	NSURL*						inputFileURL;
	NSURL*						outputFileURL;
	NSMutableDictionary*		options;
	FWFileAnalyzer*				analyzer;
	FWFileTranscoder*			transcoder;
	BOOL						isStopping;
	NSString*					ffmpegPath;
	NSURLDownload*				ffmpegDownload;
	NSURLResponse*				ffmpegResponse;
	long long					ffmpegBytesReceived;
	NSTask*						ffmpegUnzipTask;
	
	
}

- (BOOL)ffmpegExistsAtPath:(NSString*)path withExpectedHash:(NSString*)expectedHash;
- (void)ffmpegDownloadURL:(NSURL *)url toPath:(NSString *)path withExpectedHash:(NSString *)expectedHash;
+ (BOOL)isVideoFileURL:(NSURL *)fileURL;
+ (int)cpuCount;

- (id)initWithFFmpegURL:(NSURL *)ffmpegURL;
- (id)delegate;
- (void)setDelegate:(id)delegate;
- (void)transcodeFileURL:(NSURL *)inputFileURL toFileURL:(NSURL *)outputFileURL options:(NSMutableDictionary *)options;
- (void)extractThumbnailFromFileURL:(NSURL*)_inputURL toFileURL:(NSURL*)_outputURL fromSecondPosition:(int)_secondPosition width:(int)_width height:(int)_height;
- (void)stop;
- (void)pauseTranscode;
- (void)resumeTranscode;

@end
