this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add fftusecapturedevices option; re-add feature to use defined capture device

alice 04ee60a0 713a934a

+28 -6
+24 -5
src/ext/fft.c
··· 140 140 141 141 printf("\n"); 142 142 143 - // for now always prefer loopback 144 - // TODO: what about CapturePlaybackDevices? 145 - bool useLoopback = ma_is_loopback_supported(context.backend); 146 - ma_device_config config = ma_device_config_init(useLoopback ? ma_device_type_loopback : ma_device_type_capture); 147 - // ma_device_config config = ma_device_config_init( CapturePlaybackDevices ? ma_device_type_loopback : ma_device_type_capture ); 143 + bool useLoopback = (ma_is_loopback_supported(context.backend) && CapturePlaybackDevices); 144 + printf("[FFT] Loopback support: %s, Use loopback: %s\n", ma_is_loopback_supported(context.backend) ? "Yes" : "No", useLoopback ? "Yes" : "No"); 145 + 146 + if(CaptureDeviceSearchString && strlen(CaptureDeviceSearchString) > 0) { 147 + if(useLoopback) { 148 + for (ma_uint32 iDevice = 0; iDevice < playbackDeviceCount; ++iDevice) { 149 + char* DeviceName = pPlaybackDeviceInfos[iDevice].name; 150 + if(strstr(DeviceName, CaptureDeviceSearchString) != NULL) { 151 + TargetDevice = &pPlaybackDeviceInfos[iDevice].id; 152 + break; 153 + } 154 + } 155 + } else { 156 + for (ma_uint32 iDevice = 0; iDevice < captureDeviceCount; ++iDevice) { 157 + char* DeviceName = pCaptureDeviceInfos[iDevice].name; 158 + if(strstr(DeviceName, CaptureDeviceSearchString) != NULL) { 159 + TargetDevice = &pCaptureDeviceInfos[iDevice].id; 160 + break; 161 + } 162 + } 163 + } 164 + } 165 + 166 + ma_device_config config = ma_device_config_init( useLoopback ? ma_device_type_loopback : ma_device_type_capture ); 148 167 config.capture.pDeviceID = TargetDevice; 149 168 config.capture.format = ma_format_f32; 150 169 config.capture.channels = 2;
+1
src/studio/studio.c
··· 2393 2393 CMD_PARAMS_LIST(CMD_PARAMS_DEF) 2394 2394 #undef CMD_PARAMS_DEF 2395 2395 OPT_BOOLEAN('\0', "fft", &args.fft, "enable FFT support"), 2396 + OPT_BOOLEAN('\0', "fftusecapturedevices", &args.fftusecapturedevices, "Use capture devices"), 2396 2397 OPT_BOOLEAN('\0', "fftlist", &args.fftlist, "list FFT devices"), 2397 2398 OPT_STRING('\0', "fftdevice", &args.fftdevice, "name of the device to use with FFT"), 2398 2399 OPT_END(),
+1
src/studio/studio.h
··· 97 97 98 98 bool fft; 99 99 s32 fftlist; 100 + bool fftusecapturedevices; 100 101 const char *fftdevice; 101 102 } StartArgs; 102 103
+1
src/studio/system.h
··· 146 146 s32 uiScale; 147 147 148 148 bool fft; 149 + bool fftusecapturedevices; 149 150 const char *fftdevice; 150 151 } StudioConfig; 151 152
+1 -1
src/system/sdl/main.c
··· 330 330 331 331 if (studio_config(platform.studio)->fft) 332 332 { 333 - FFT_Open(false, NULL); 333 + FFT_Open(studio_config(platform.studio)->fftusecapturedevices, studio_config(platform.studio)->fftdevice); 334 334 } 335 335 336 336 platform.audio.device = SDL_OpenAudioDevice(NULL, 0, &want, &platform.audio.spec, 0);