diff options
Diffstat (limited to 'tools/osx/simulator-osx.c')
-rw-r--r-- | tools/osx/simulator-osx.c | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/tools/osx/simulator-osx.c b/tools/osx/simulator-osx.c new file mode 100644 index 0000000..abd25f9 --- /dev/null +++ b/tools/osx/simulator-osx.c | |||
@@ -0,0 +1,99 @@ | |||
1 | /****************************************************************************** | ||
2 | |||
3 | Copyright (c) 2015, Focusrite Audio Engineering Ltd. | ||
4 | All rights reserved. | ||
5 | |||
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions are met: | ||
8 | |||
9 | * Redistributions of source code must retain the above copyright notice, this | ||
10 | list of conditions and the following disclaimer. | ||
11 | |||
12 | * Redistributions in binary form must reproduce the above copyright notice, | ||
13 | this list of conditions and the following disclaimer in the documentation | ||
14 | and/or other materials provided with the distribution. | ||
15 | |||
16 | * Neither the name of Focusrite Audio Engineering Ltd., nor the names of its | ||
17 | contributors may be used to endorse or promote products derived from | ||
18 | this software without specific prior written permission. | ||
19 | |||
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
30 | |||
31 | *****************************************************************************/ | ||
32 | |||
33 | #include <stdio.h> | ||
34 | #include "app.h" | ||
35 | |||
36 | // ____________________________________________________________________________ | ||
37 | // | ||
38 | // Simulator "hal". This lets you exercise your device code without having to upload | ||
39 | // it to the hardware, which also means you can debug it interactively. | ||
40 | // ____________________________________________________________________________ | ||
41 | |||
42 | void hal_plot_led(u8 type, u8 index, u8 red, u8 green, u8 blue) | ||
43 | { | ||
44 | // wire this up to MIDI out... | ||
45 | } | ||
46 | |||
47 | void hal_send_midi(u8 port, u8 status, u8 d1, u8 d2) | ||
48 | { | ||
49 | // send this up a virtual MIDI port? | ||
50 | } | ||
51 | |||
52 | void hal_send_sysex(u8 port, const u8* data, u16 length) | ||
53 | { | ||
54 | // as above, or just dump to console? | ||
55 | } | ||
56 | |||
57 | // ____________________________________________________________________________ | ||
58 | // | ||
59 | // App event wrappers - these just log to the console. Would be nice to wire | ||
60 | // these up to a MIDI input from the real Launchpad Pro! | ||
61 | // ____________________________________________________________________________ | ||
62 | |||
63 | static void sim_app_init() | ||
64 | { | ||
65 | app_init(); | ||
66 | } | ||
67 | |||
68 | static void sim_app_surface_event(u8 type, u8 index, u8 value) | ||
69 | { | ||
70 | app_surface_event(type, index, value); | ||
71 | } | ||
72 | |||
73 | static void sim_app_midi_event(u8 port, u8 status, u8 d1, u8 d2) | ||
74 | { | ||
75 | app_midi_event(port, status, d1, d2); | ||
76 | } | ||
77 | |||
78 | static void sim_app_timer_event() | ||
79 | { | ||
80 | app_timer_event(); | ||
81 | } | ||
82 | |||
83 | // ____________________________________________________________________________ | ||
84 | |||
85 | int main(int argc, char * argv[]) | ||
86 | { | ||
87 | // open MIDI ports and wire them up | ||
88 | |||
89 | // init the app | ||
90 | sim_app_init(); | ||
91 | |||
92 | // start the terrible busywaiting timer loop | ||
93 | for (;;) | ||
94 | { | ||
95 | |||
96 | } | ||
97 | |||
98 | return 0; | ||
99 | } \ No newline at end of file | ||