Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 104 lines (78 sloc) 4.552 kb
371a598 @krevis Updated copyright headers.
authored
1 /*
523ef97 @krevis Updated copyright dates on 2008 modified files
authored
2 Copyright (c) 2002-2008, Kurt Revis. All rights reserved.
371a598 @krevis Updated copyright headers.
authored
3
4 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
6 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8 * Neither the name of Kurt Revis, nor Snoize, nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9
10 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11 */
12
26d8b59 @krevis Rationalized #imports -- use <Cocoa/Cocoa.h> instead of forward-declarin...
authored
13 #import <Cocoa/Cocoa.h>
14 #import <SnoizeMIDI/SnoizeMIDI.h>
f79023f @krevis Big refactoring: moved SMPortOrVirtual{Output}Stream over to SysExLibrar...
authored
15 #import "SSEOutputStreamDestination.h"
66309d8 @krevis Adding SysExLibrarian project. Pretty much a skeleton at the moment.
authored
16
17 @class SSEMainWindowController;
f79023f @krevis Big refactoring: moved SMPortOrVirtual{Output}Stream over to SysExLibrar...
authored
18 @class SSECombinationOutputStream;
66309d8 @krevis Adding SysExLibrarian project. Pretty much a skeleton at the moment.
authored
19
26d8b59 @krevis Rationalized #imports -- use <Cocoa/Cocoa.h> instead of forward-declarin...
authored
20
1388fad @krevis Got rid of OmniBase and OmniFoundation. Reimplemented methods as necessa...
authored
21 typedef enum {
22 SSEMIDIControllerIdle,
23 SSEMIDIControllerSending,
24 SSEMIDIControllerWillDelayBeforeNext,
25 SSEMIDIControllerDelayingBeforeNext,
26 SSEMIDIControllerCancelled,
27 SSEMIDIControllerFinishing
28 } SSEMIDIControllerSendStatus;
29
51ba7de @krevis SSEMainController is now SSEMIDIController.
authored
30 @interface SSEMIDIController : NSObject <SMMessageDestination>
66309d8 @krevis Adding SysExLibrarian project. Pretty much a skeleton at the moment.
authored
31 {
9ae556a @krevis Moved functionality for importing and finding missing files into separat...
authored
32 SSEMainWindowController *nonretainedMainWindowController;
66309d8 @krevis Adding SysExLibrarian project. Pretty much a skeleton at the moment.
authored
33
34 // MIDI processing
5c26a14 @krevis Listen to all input sources at the same time. Removed UI for selecting a...
authored
35 SMPortInputStream *inputStream;
f0e6364 @krevis Integrated changes from Robert Chin <robertchin@mac.com> to listen for p...
authored
36 SMVirtualInputStream *virtualInputStream;
f79023f @krevis Big refactoring: moved SMPortOrVirtual{Output}Stream over to SysExLibrar...
authored
37 SSECombinationOutputStream *outputStream;
d1066c3 @krevis If we can send messages asynchronously, do them one at a time instead of...
authored
38
66309d8 @krevis Adding SysExLibrarian project. Pretty much a skeleton at the moment.
authored
39 // Transient data
2a1a705 @krevis Beginnings of a "library" for the sysex files.
authored
40 NSMutableArray *messages;
41
3ee8dc6 @krevis Added preferences for sysex receive timeout and durations of pause betwe...
authored
42 // ... for listening for sysex
f0e6364 @krevis Integrated changes from Robert Chin <robertchin@mac.com> to listen for p...
authored
43 BOOL listeningToSysexMessages;
44 BOOL listenToMultipleSysexMessages;
ad0e2fd @krevis We can now read multiple sysex messages. Redid all the progress stuff to...
authored
45 unsigned int messageBytesRead;
46 unsigned int totalBytesRead;
47
48 // ... for sending sysex
d1066c3 @krevis If we can send messages asynchronously, do them one at a time instead of...
authored
49 NSTimeInterval pauseTimeBetweenMessages;
f672591 @krevis Improve the sending behavior again. Use a scheduled event for updates in...
authored
50 SMSysExSendRequest *nonretainedCurrentSendRequest;
3f3d3bb @krevis Sending multiple sysex messages now works. Progress is looking nicer.
authored
51 unsigned int sendingMessageCount;
52 unsigned int sendingMessageIndex;
53 unsigned int bytesToSend;
54 unsigned int bytesSent;
1388fad @krevis Got rid of OmniBase and OmniFoundation. Reimplemented methods as necessa...
authored
55 SSEMIDIControllerSendStatus sendStatus;
56 BOOL scheduledUpdateSysExReadIndicator;
f0e6364 @krevis Integrated changes from Robert Chin <robertchin@mac.com> to listen for p...
authored
57
58 // ... for listening to program change messages
59 BOOL listeningToProgramChangeMessages;
66309d8 @krevis Adding SysExLibrarian project. Pretty much a skeleton at the moment.
authored
60 }
61
9ae556a @krevis Moved functionality for importing and finding missing files into separat...
authored
62 - (id)initWithWindowController:(SSEMainWindowController *)mainWindowController;
63
f79023f @krevis Big refactoring: moved SMPortOrVirtual{Output}Stream over to SysExLibrar...
authored
64 - (NSArray *)destinations;
8c040d4 @krevis Put the destinations (of SSECombinationOutputStream) in groups by what k...
authored
65 - (NSArray *)groupedDestinations;
f79023f @krevis Big refactoring: moved SMPortOrVirtual{Output}Stream over to SysExLibrar...
authored
66 - (id <SSEOutputStreamDestination>)selectedDestination;
67 - (void)setSelectedDestination:(id <SSEOutputStreamDestination>)destination;
c07d676 @krevis Hooked up the output port and UI.
authored
68
2a1a705 @krevis Beginnings of a "library" for the sysex files.
authored
69 - (NSArray *)messages;
70 - (void)setMessages:(NSArray *)value;
71
ad0e2fd @krevis We can now read multiple sysex messages. Redid all the progress stuff to...
authored
72 // Listening to sysex messages
73
74 - (void)listenForOneMessage;
75 - (void)listenForMultipleMessages;
76 - (void)cancelMessageListen;
77 - (void)doneWithMultipleMessageListen;
78
79 - (void)getMessageCount:(unsigned int *)messageCountPtr bytesRead:(unsigned int *)bytesReadPtr totalBytesRead:(unsigned int *)totalBytesReadPtr;
80
81 // Sending sysex messages
e59462c @krevis We can now recieve a sysex message and keep it in an internal buffer. We...
authored
82
3f3d3bb @krevis Sending multiple sysex messages now works. Progress is looking nicer.
authored
83 - (void)sendMessages;
84 - (void)cancelSendingMessages;
85
86 - (void)getMessageCount:(unsigned int *)messageCountPtr messageIndex:(unsigned int *)messageIndexPtr bytesToSend:(unsigned int *)bytesToSendPtr bytesSent:(unsigned int *)bytesSentPtr;
e59462c @krevis We can now recieve a sysex message and keep it in an internal buffer. We...
authored
87
66309d8 @krevis Adding SysExLibrarian project. Pretty much a skeleton at the moment.
authored
88 @end
458eb7b @krevis Save the selected destination in the user defaults.
authored
89
90 // Preferences keys
0000dc5 @krevis When a destination on a device with broken sysex is selected, show a war...
authored
91 extern NSString *SSESelectedDestinationPreferenceKey;
3ee8dc6 @krevis Added preferences for sysex receive timeout and durations of pause betwe...
authored
92 extern NSString *SSESysExReadTimeOutPreferenceKey;
93 extern NSString *SSESysExIntervalBetweenSentMessagesPreferenceKey;
f0e6364 @krevis Integrated changes from Robert Chin <robertchin@mac.com> to listen for p...
authored
94 extern NSString *SSEListenForProgramChangesPreferenceKey;
95 extern NSString *SSEInterruptOnProgramChangePreferenceKey;
072891a @krevis Separated "record one" stuff out from the main window controller into a ...
authored
96
97 // Notifications
98 extern NSString *SSEMIDIControllerReadStatusChangedNotification;
99 extern NSString *SSEMIDIControllerReadFinishedNotification;
69d7e70 @krevis Moved play-related code into a separate controller and nib.
authored
100 extern NSString *SSEMIDIControllerSendWillStartNotification;
101 extern NSString *SSEMIDIControllerSendFinishedNotification;
102 // userInfo has NSNumber for key "success" indicating if all messages were sent
c0cfb60 @krevis When we sent sysex through a virtual endpoint, we were sending immediate...
authored
103 extern NSString *SSEMIDIControllerSendFinishedImmediatelyNotification;
Something went wrong with that request. Please try again.