mas01mj@669
|
1 //
|
mas01mj@669
|
2 // AppController.h
|
mas01mj@706
|
3 // CAMUS
|
mas01mj@669
|
4 //
|
mas01mj@669
|
5 // Created by Mike Jewell on 27/01/2010.
|
mas01mj@669
|
6 // Copyright 2010 __MyCompanyName__. All rights reserved.
|
mas01mj@669
|
7 //
|
mas01mj@669
|
8
|
mas01mj@669
|
9 #import <Cocoa/Cocoa.h>
|
mas01mj@669
|
10 #include <audioDB_API.h>
|
mas01mj@669
|
11
|
mas01mj@699
|
12
|
mas01mj@669
|
13 @interface AppController : NSObject {
|
mas01mj@699
|
14 adb_t *db;
|
mas01mj@669
|
15 NSModalSession session;
|
mas01mj@669
|
16
|
mas01mj@669
|
17 NSString* dbName;
|
mas01mj@669
|
18 NSString* dbFilename;
|
mas01mj@669
|
19 NSString* plistFilename;
|
mas01mj@669
|
20 NSString* selectedKey;
|
mas01mj@669
|
21 NSString* selectedFilename;
|
mas01mj@669
|
22
|
mas01mj@669
|
23 IBOutlet NSTextField *statusField;
|
mas01mj@699
|
24 IBOutlet NSTableView* tracksView;
|
mas01mj@669
|
25 IBOutlet id mainWindow;
|
mas01mj@669
|
26
|
mas01mj@699
|
27 // Query Customizing
|
mas01mj@699
|
28
|
mas01mj@699
|
29 IBOutlet NSButton* multipleCheckBox;
|
mas01mj@699
|
30 IBOutlet NSButton* resetButton;
|
mas01mj@699
|
31 IBOutlet NSTextField* queryStartVectors;
|
mas01mj@699
|
32 IBOutlet NSTextField* queryStartSeconds;
|
mas01mj@699
|
33 IBOutlet NSTextField* queryLengthVectors;
|
mas01mj@699
|
34 IBOutlet NSTextField* queryLengthSeconds;
|
mas01mj@699
|
35 IBOutlet NSTextField* queryPath;
|
mas01mj@699
|
36 IBOutlet NSButton* queryButton;
|
mas01mj@699
|
37
|
mas01mj@699
|
38 // Main window buttons/fields.
|
mas01mj@699
|
39
|
mas01mj@699
|
40 IBOutlet NSToolbarItem* importAudioButton;
|
mas01mj@699
|
41 IBOutlet NSToolbarItem* performQueryButton;
|
mas01mj@699
|
42 IBOutlet NSToolbarItem* playBothButton;
|
mas01mj@699
|
43 IBOutlet NSToolbarItem* playResultButton;
|
mas01mj@699
|
44 IBOutlet NSToolbarItem* stopButton;
|
mas01mj@692
|
45 IBOutlet NSTextField* queryKey;
|
mas01mj@699
|
46
|
mas01mj@699
|
47 NSSound* queryTrack;
|
mas01mj@699
|
48 NSSound* resultTrack;
|
mas01mj@699
|
49
|
mas01mj@699
|
50 // Creating
|
mas01mj@699
|
51 IBOutlet id createSheet;
|
mas01mj@699
|
52 IBOutlet id querySheet;
|
mas01mj@699
|
53
|
mas01mj@699
|
54 IBOutlet NSMatrix* extractorOptions;
|
mas01mj@699
|
55 IBOutlet NSTextField* hopSizeField;
|
mas01mj@699
|
56 IBOutlet NSTextField* maxTracksField;
|
mas01mj@699
|
57 IBOutlet NSTextField* maxLengthField;
|
mas01mj@699
|
58
|
mas01mj@699
|
59 // Extracting
|
mas01mj@699
|
60 IBOutlet id importSheet;
|
mas01mj@699
|
61 IBOutlet NSProgressIndicator* indicator;
|
mas01mj@687
|
62
|
mas01mj@692
|
63 NSMutableArray* results;
|
mas01mj@692
|
64 NSDictionary* trackMap;
|
mas01mj@699
|
65 NSDictionary* dbState;
|
mas01mj@669
|
66 }
|
mas01mj@669
|
67
|
mas01mj@669
|
68 // Menus
|
mas01mj@669
|
69 -(IBAction)newDatabase:(id)sender;
|
mas01mj@669
|
70 -(IBAction)openDatabase:(id)sender;
|
mas01mj@669
|
71
|
mas01mj@669
|
72 // Import
|
mas01mj@669
|
73 -(IBAction)importAudio:(id)sender;
|
mas01mj@699
|
74 // -(IBAction)cancelImport:(id)sender;
|
mas01mj@699
|
75
|
mas01mj@699
|
76 // Create
|
mas01mj@699
|
77 -(IBAction)cancelCreate:(id)sender;
|
mas01mj@699
|
78 -(IBAction)createDatabase:(id)sender;
|
mas01mj@699
|
79
|
mas01mj@699
|
80 // Query
|
mas01mj@699
|
81 -(IBAction)pathAction:(id)sender;
|
mas01mj@699
|
82 -(IBAction)cancelQuery:(id)sender;
|
mas01mj@699
|
83 -(IBAction)performQuery:(id)sender;
|
mas01mj@699
|
84 -(IBAction)selectQueryFile:(id)sender;
|
mas01mj@699
|
85 -(IBAction)resetLengths:(id)sender;
|
mas01mj@687
|
86
|
mas01mj@669
|
87 // Buttons
|
mas01mj@669
|
88 -(IBAction)playBoth:(id)sender;
|
mas01mj@669
|
89 -(IBAction)playResult:(id)sender;
|
mas01mj@669
|
90 -(IBAction)stopPlay:(id)sender;
|
mas01mj@669
|
91 -(IBAction)chooseQuery:(id)sender;
|
mas01mj@669
|
92 -(IBAction)selectedChanged:(id)sender;
|
mas01mj@699
|
93 -(IBAction)tableDoubleClick:(id)sender;
|
mas01mj@669
|
94
|
mas01mj@699
|
95 -(void)reset;
|
mas01mj@669
|
96 -(void)updateStatus;
|
mas01mj@700
|
97 -(BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
|
mas01mj@700
|
98 -(void)sound:(NSSound *)sound didFinishPlaying:(BOOL)playbackSuccessful;
|
mas01mj@700
|
99 -(void)importFile:(NSString *)filename withExtractorConfig:(NSString *)extractorPath;
|
mas01mj@701
|
100 -(UInt64)getSampleRate:(NSString *)filename;
|
mas01mj@702
|
101 -(UInt64)getHopSizeInSamples:(NSString *)filename;
|
mas01mj@702
|
102 -(int)nearestPow2:(int)x;
|
mas01mj@669
|
103
|
mas01mj@669
|
104 @end
|