5 // Created by Nathan Oates on Sun Aug 01 2004.
6 // Copyright (c) 2004-7 Nathan Oates. All rights reserved.
9 // Includes code from uproar - see below for License:
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>
39 #include <mach/mach.h>
41 #include <CoreFoundation/CFNumber.h>
42 #import "DataHandler.h"
43 #include <IOKit/IOKitLib.h>
44 #include <IOKit/IOCFPlugIn.h>
45 #include <IOKit/usb/IOUSBLib.h>
47 //#define kBlockSize 0x08
48 #define kMaxXferSize 0xFFFF
50 #define kUproarSuccess 0
51 #define kUproarTrackNotFound -1
52 #define kUproarTrackExists -2
53 #define kUproarDeviceErr -3
54 #define kUproarNotEnoughSpace -4
58 IOUSBDeviceInterface197
**dev
;
59 IOUSBInterfaceInterface197
**intf
;
63 @interface TFUSBController
: NSObject
{
64 NSProgressIndicator
* progressBar
;
65 NSTextField
* progressTime
;
67 USBDeviceContext
* myContext
;
68 NSMutableArray
* transferQueue
;
69 NSMutableArray
* priorityTransferQueue
;
70 NSMutableArray
* pausedQueue
;
71 DataHandler
* dh
; //move
72 id tableView
;// and this?
79 - (void) closeDevice
:(USBDeviceContext
*)device
;
81 - (USBDeviceContext
*) initializeUSB
;
82 - (int) getFile
:(NSDictionary
*)fileInfo forPath
:(NSString
*)currentPath
83 toSaveTo
:(NSString
*)savePath beginAtOffset
:(unsigned long long)offset
84 withLooping
:(BOOL
)looping existingTime
:(NSTimeInterval
)existingTime
;
85 - (void) uploadFile
:(NSString
*)fileToUpload ofSize
:(long long)size
86 fromPath
:(NSString
*)curPath withAttributes
:(NSData
*)typeFile
87 atOffset
:(unsigned long long)offset
88 existingTime
:(NSTimeInterval
)existingTime
;
90 - (void) setDebug
:(int)mode
;
91 - (void) setRate
:(int)newRate
;
92 - (void) setProgressBar
:(NSProgressIndicator
*)bar time
:(NSTextField
*)timeField
93 turbo
:(NSButton
*)turbo
;
94 - (void) deleteFile
:(NSDictionary
*)fileInfo fromPath
:(NSString
*)currentPath
;
95 - (void) transfer
:(id
)sender
;
96 - (void) addPriorityTransfer
:(id
)newTransfer
;
97 - (void) addTransfer
:(id
)newTransfer atIndex
:(int)front
; //-1 for end of array
98 - (void) setDH
:(id
)newDH tableView
:(id
)tv
;
100 - (id
) transferQueue
;