Use TopfieldUSBEcode for received values too.
[MacTF.git] / TFUSBController.h
blob89d3bfa9cffab22e8f8747b992a7159b6080cc7d
1 //
2 // TFUSBController.h
3 // MacTF
4 //
5 // Created by Nathan Oates on Sun Aug 01 2004.
6 // Copyright (c) 2004-7 Nathan Oates. All rights reserved.
7 //
9 // Includes code from uproar - see below for License:
12 * uproar 0.1
13 * Copyright (c) 2001 Kasima Tharnpipitchai <me@kasima.org>
15 * This source code is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Public License as published
17 * by the Free Software Foundation; either version 2 of the License,
18 * or (at your option) any later version.
20 * This source code is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 * Please refer to the GNU Public License for more details.
25 * You should have received a copy of the GNU Public License along with
26 * this source code; if not, write to:
27 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 /* This file was modified by Kalle Olavi Niemitalo on 2007-10-28. */
32 #import <Foundation/Foundation.h>
33 #include <IOKit/usb/IOUSBLib.h>
35 @class TFDataFormat, DataHandler;
37 //#define kBlockSize 0x08
38 #define kMaxXferSize 0xFFFF
40 #define kUproarSuccess 0
41 #define kUproarTrackNotFound -1
42 #define kUproarTrackExists -2
43 #define kUproarDeviceErr -3
44 #define kUproarNotEnoughSpace -4
47 typedef struct {
48 IOUSBDeviceInterface197 **dev;
49 IOUSBInterfaceInterface197 **intf;
50 } USBDeviceContext;
53 @interface TFUSBController : NSObject {
54 NSProgressIndicator* progressBar;
55 NSTextField* progressTime;
56 NSButton* turboCB;
57 USBDeviceContext* myContext;
58 NSMutableArray* transferQueue;
59 NSMutableArray* priorityTransferQueue;
60 NSMutableArray* pausedQueue;
61 TFDataFormat* dataFormat;
62 DataHandler* dh; //move
63 id tableView;// and this?
66 - (void) closeDevice:(USBDeviceContext *)device;
68 - (USBDeviceContext*) initializeUSB;
69 - (int) getFile:(NSDictionary*)fileInfo forPath:(NSString*)currentPath
70 toSaveTo:(NSString*)savePath beginAtOffset:(unsigned long long)offset
71 withLooping:(BOOL)looping existingTime:(NSTimeInterval)existingTime;
72 - (void) uploadFile:(NSString*)fileToUpload ofSize:(long long)size
73 fromPath:(NSString*)curPath withAttributes:(NSData*)typeFile
74 atOffset:(unsigned long long)offset
75 existingTime:(NSTimeInterval)existingTime;
76 - (int) getSpeed;
77 - (void) setDebug:(int)mode;
78 - (void) setRate:(int)newRate;
79 - (void) setProgressBar:(NSProgressIndicator*)bar time:(NSTextField*)timeField
80 turbo:(NSButton*)turbo;
81 - (void) deleteFile:(NSDictionary*)fileInfo fromPath:(NSString*)currentPath;
82 - (void) transfer:(id)sender;
83 - (void) addPriorityTransfer:(id)newTransfer;
84 - (void) addTransfer:(id)newTransfer atIndex:(int)front; //-1 for end of array
85 - (void) setDH:(id)newDH tableView:(id)tv;
86 - (BOOL) hasCurrentTransfer;
87 - (id) currentTransferInfo;
88 - (void) clearQueues;
89 - (id) firstPausedTransferInfo;
91 @end