@@ -97,7 +97,7 @@ struct state_acap_wasapi {
9797enum { IDX_LOOP = -2 , IDX_DFL = -1 };
9898
9999string wasapi_get_name (IMMDevice *pDevice);
100- static void show_help ();
100+ static void show_help (bool full );
101101string wasapi_get_default_device_id (EDataFlow dataFlow, IMMDeviceEnumerator *enumerator);
102102
103103#define SAFE_RELEASE (u ) \
@@ -197,10 +197,11 @@ string wasapi_get_default_device_id(EDataFlow dataFlow, IMMDeviceEnumerator *enu
197197 return ret;
198198}
199199
200- static void show_help () {
200+ static void show_help (bool full ) {
201201 col () << " Usage:\n "
202- << SBOLD (SRED (" \t -s wasapi" ) << " [:d[evice]=<index>|<ID>|<name>]" )
203- << " \n\n Available devices:\n " ;
202+ << SBOLD (SRED (" \t -s wasapi" ) << " [:d[evice]=<index>|<ID>|<name>]" ) << " \n "
203+ << SBOLD (" \t -s wasapi:[full]help" ) << " \n "
204+ << " \n Available devices:\n " ;
204205
205206 IMMDeviceEnumerator *enumerator = nullptr ;
206207 IMMDeviceCollection *pEndpoints = nullptr ;
@@ -225,10 +226,13 @@ static void show_help() {
225226 string dev_id = win_wstr_to_str (pwszID);
226227 color_printf (
227228 " %s\t " TBOLD (" %2d" ) " ) " TBOLD (
228- " %s" ) " (ID: %s) \n " ,
229+ " %s" ),
229230 (dev_id == default_dev_id ? " (*)" : " " ), i,
230- wasapi_get_name (pDevice).c_str (),
231- dev_id.c_str ());
231+ wasapi_get_name (pDevice).c_str ());
232+ if (full) {
233+ color_printf (" (ID: %s)" , dev_id.c_str ());
234+ }
235+ color_printf (" \n " );
232236 } catch (ug_runtime_error &e) {
233237 LOG (LOG_LEVEL_WARNING) << MOD_NAME << " Device " << i << " : " << e.what () << " \n " ;
234238 }
@@ -241,6 +245,9 @@ static void show_help() {
241245 SAFE_RELEASE (pEndpoints);
242246 com_uninitialize (&com_initialized);
243247 col () << " " << SBOLD (" loopback" ) << " ) " << SBOLD (" computer audio output" ) << " (ID: loopback)\n " ;
248+ if (!full) {
249+ printf (" (use \" fullhelp\" to show device IDs)\n " );
250+ }
244251 printf (" \n Device " TBOLD (" name" ) " can be a substring (selects first matching device).\n " );
245252}
246253
@@ -272,8 +279,9 @@ parse_fmt(const char *cfg, int *req_index, char *req_dev_name,
272279
273280static void * audio_cap_wasapi_init (struct module *parent, const char *cfg)
274281{
275- if (strcmp (cfg, " help" ) == 0 ) {
276- show_help ();
282+ if (strcmp (cfg, " help" ) == 0 ||
283+ strcmp (cfg, " fullhelp" ) == 0 ) {
284+ show_help (strcmp (cfg, " fullhelp" ) == 0 );
277285 return INIT_NOERR;
278286 }
279287 UNUSED (parent);
0 commit comments