|
21 | 21 |
|
22 | 22 | unicode_config_t unicode_config;
|
23 | 23 | static uint8_t saved_mods;
|
24 |
| -#ifdef AUDIO_ENABLE |
25 |
| - #ifdef UNICODE_SONG_OSX |
26 |
| - float osx_song[][2] = UNICODE_SONG_OSX; |
27 |
| - #endif |
28 |
| - #ifdef UNICODE_SONG_LNX |
29 |
| - float song_lnx[][2] = UNICODE_SONG_LNX; |
30 |
| - #endif |
31 |
| - #ifdef UNICODE_SONG_BSD |
32 |
| - float song_bsd[][2] = UNICODE_SONG_BSD; |
33 |
| - #endif |
34 |
| - #ifdef UNICODE_SONG_WINDOWS |
35 |
| - float windows_song[][2] = UNICODE_SONG_WINDOWS; |
36 |
| - #endif |
37 |
| - #ifdef UNICODE_SONG_WIN_COMPOSE |
38 |
| - float win_compose_song[][2] = UNICODE_SONG_WIN_COMPOSE; |
39 |
| - #endif |
40 |
| - #ifdef UNICODE_SONG_OSX_RALT |
41 |
| - float osx_ralt_song[][2] = UNICODE_SONG_OSX_RALT; |
42 |
| - #endif |
43 |
| -#endif |
44 |
| - |
45 | 24 |
|
46 | 25 | void set_unicode_input_mode(uint8_t os_target) {
|
47 | 26 | unicode_config.input_mode = os_target;
|
@@ -153,50 +132,55 @@ bool process_unicode_common(uint16_t keycode, keyrecord_t *record) {
|
153 | 132 | switch (keycode) {
|
154 | 133 | case UNICODE_MODE_OSX:
|
155 | 134 | set_unicode_input_mode(UC_OSX);
|
156 |
| - #if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX) |
157 |
| - PLAY_SONG(osx_song); |
158 |
| - #endif |
| 135 | +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX) |
| 136 | + static float song_osx[][2] = UNICODE_SONG_OSX; |
| 137 | + PLAY_SONG(song_osx); |
| 138 | +#endif |
159 | 139 | break;
|
160 | 140 | case UNICODE_MODE_LNX:
|
161 | 141 | set_unicode_input_mode(UC_LNX);
|
162 |
| - #if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_LNX) |
163 |
| - PLAY_SONG(song_lnx); |
164 |
| - #endif |
| 142 | +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_LNX) |
| 143 | + static float song_lnx[][2] = UNICODE_SONG_LNX; |
| 144 | + PLAY_SONG(song_lnx); |
| 145 | +#endif |
165 | 146 | break;
|
166 | 147 | case UNICODE_MODE_BSD:
|
167 | 148 | set_unicode_input_mode(UC_BSD);
|
168 |
| - #if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_BSD) |
169 |
| - PLAY_SONG(song_bsd); |
170 |
| - #endif |
| 149 | +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_BSD) |
| 150 | + static float song_bsd[][2] = UNICODE_SONG_BSD; |
| 151 | + PLAY_SONG(song_bsd); |
| 152 | +#endif |
171 | 153 | break;
|
172 | 154 | case UNICODE_MODE_WIN:
|
173 | 155 | set_unicode_input_mode(UC_WIN);
|
174 |
| - #if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_WINDOWS) |
175 |
| - PLAY_SONG(windows_song); |
176 |
| - #endif |
| 156 | +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_WIN) |
| 157 | + static float song_win[][2] = UNICODE_SONG_WIN; |
| 158 | + PLAY_SONG(song_win); |
| 159 | +#endif |
177 | 160 | break;
|
178 | 161 | case UNICODE_MODE_WINC:
|
179 | 162 | set_unicode_input_mode(UC_WINC);
|
180 |
| - #if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_WIN_COMPOSE) |
181 |
| - PLAY_SONG(win_compose_song); |
182 |
| - #endif |
| 163 | +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_WINC) |
| 164 | + static float song_winc[][2] = UNICODE_SONG_WINC; |
| 165 | + PLAY_SONG(song_winc); |
| 166 | +#endif |
183 | 167 | break;
|
184 | 168 | case UNICODE_MODE_OSX_RALT:
|
185 | 169 | set_unicode_input_mode(UC_OSX_RALT);
|
186 |
| - #if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX_RALT) |
187 |
| - PLAY_SONG(osx_ralt_song); |
188 |
| - #endif |
| 170 | +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX_RALT) |
| 171 | + static float song_osx_ralt[][2] = UNICODE_SONG_OSX_RALT; |
| 172 | + PLAY_SONG(song_osx_ralt); |
| 173 | +#endif |
189 | 174 | break;
|
190 | 175 | }
|
191 | 176 | }
|
192 |
| - #ifdef UNICODE_ENABLE |
193 |
| - return process_unicode(keycode, record); |
194 |
| - #endif |
195 |
| - #ifdef UCIS_ENABLE |
196 |
| - return process_ucis(keycode, record); |
197 |
| - #endif |
198 |
| - #ifdef UNICODEMAP_ENABLE |
199 |
| - return process_unicode_map(keycode, record); |
200 |
| - #endif |
| 177 | +#if defined(UNICODE_ENABLE) |
| 178 | + return process_unicode(keycode, record); |
| 179 | +#elif defined(UNICODEMAP_ENABLE) |
| 180 | + return process_unicode_map(keycode, record); |
| 181 | +#elif defined(UCIS_ENABLE) |
| 182 | + return process_ucis(keycode, record); |
| 183 | +#else |
201 | 184 | return true;
|
| 185 | +#endif |
202 | 186 | }
|
0 commit comments