Output view controller now has a delegate rather than a direct reference to the input...
[enjoyable.git] / Classes / NJOutputViewController.h
index 2f50ef8..a35c735 100644 (file)
@@ -8,9 +8,11 @@
 
 #import "NJKeyInputField.h"
 
-@class NJInputController;
-@class NJOutput;
 @class NJInput;
+@class NJOutput;
+@class NJMapping;
+
+@protocol NJOutputViewControllerDelegate;
 
 @interface NJOutputViewController : NSObject <NJKeyInputFieldDelegate> {
     IBOutlet NJKeyInputField *keyInput;
     IBOutlet NSSlider *scrollSpeedSlider;
     IBOutlet NSTextField *title;
     IBOutlet NSPopUpButton *mappingPopup;
-    IBOutlet NJInputController *inputController;
     IBOutlet NSButton *smoothCheck;
     IBOutlet NSButton *unknownMapping;
 }
 
-@property (assign) BOOL enabled;
+@property (nonatomic, weak) IBOutlet id <NJOutputViewControllerDelegate> delegate;
+
+- (void)loadOutput:(NJOutput *)output forInput:(NJInput *)input;
+- (void)focusKey;
 
-- (void)loadInput:(NJInput *)input;
 - (IBAction)radioChanged:(id)sender;
 - (IBAction)mdirChanged:(id)sender;
 - (IBAction)mbtnChanged:(id)sender;
 - (IBAction)scrollSpeedChanged:(id)sender;
 - (IBAction)scrollTypeChanged:(id)sender;
 
-- (void)focusKey;
+@end
+
+@protocol NJOutputViewControllerDelegate
+
+- (NJMapping *)outputViewController:(NJOutputViewController *)ovc
+                    mappingForIndex:(NSUInteger)index;
+- (void)outputViewController:(NJOutputViewController *)ovc
+                   setOutput:(NJOutput *)output
+                    forInput:(NJInput *)input;
 
 @end