| 419 | } |
| 420 | |
| 421 | void print_help(char* programname, struct device* device_found, bool show_all) |
| 422 | { |
| 423 | printf("HeadsetControl by Sapd (Denis Arnst)\n\thttps://github.com/Sapd/HeadsetControl\n\n"); |
| 424 | printf("Version: %s\n\n", VERSION); |
| 425 | // printf("Usage: %s [options]\n", programname); |
| 426 | // printf("Options:\n"); |
| 427 | |
| 428 | printf("Select device:\n"); |
| 429 | printf(" -d, --device vendorid:productid\n"); |
| 430 | printf("\t\t\t\tVendor ID and product ID separated by a colon.\n"); |
| 431 | printf("\n"); |
| 432 | |
| 433 | if (show_all || device_has_capability(device_found, CAP_SIDETONE)) { |
| 434 | printf("Sidetone:\n"); |
| 435 | printf(" -s, --sidetone LEVEL\t\tSet sidetone level (0-128)\n"); |
| 436 | printf("\n"); |
| 437 | } |
| 438 | |
| 439 | if (show_all || device_has_capability(device_found, CAP_BATTERY_STATUS)) { |
| 440 | printf("Battery:\n"); |
| 441 | printf(" -b, --battery\t\t\tCheck battery level\n"); |
| 442 | printf("\n"); |
| 443 | } |
| 444 | |
| 445 | // ------ Category: lights and notifications |
| 446 | bool show_lights = show_all || device_has_capability(device_found, CAP_LIGHTS); |
| 447 | bool show_voice_prompts = show_all || device_has_capability(device_found, CAP_VOICE_PROMPTS); |
| 448 | |
| 449 | if (show_lights || show_voice_prompts) { |
| 450 | printf("%s:\n", (show_lights && show_voice_prompts) ? "Lights and Voice Prompts" : (show_lights ? "Lights" : "Voice Prompts")); |
| 451 | if (show_lights) { |
| 452 | printf(" -l, --light [0|1]\t\tTurn lights off (0) or on (1)\n"); |
| 453 | } |
| 454 | if (show_voice_prompts) { |
| 455 | printf(" -v, --voice-prompt [0|1]\tTurn voice prompts off (0) or on (1)\n"); |
| 456 | } |
| 457 | printf("\n"); |
| 458 | } |
| 459 | // ------ |
| 460 | |
| 461 | // ------ Category: Features |
| 462 | bool show_inactive_time = show_all || device_has_capability(device_found, CAP_INACTIVE_TIME); |
| 463 | bool show_chatmix_status = show_all || device_has_capability(device_found, CAP_CHATMIX_STATUS); |
| 464 | bool show_notification_sound = show_all || device_has_capability(device_found, CAP_NOTIFICATION_SOUND); |
| 465 | bool show_volume_limiter = show_all || device_has_capability(device_found, CAP_VOLUME_LIMITER); |
| 466 | |
| 467 | if (show_inactive_time || show_chatmix_status || show_notification_sound) { |
| 468 | printf("Features:\n"); |
| 469 | if (show_inactive_time) { |
| 470 | printf(" -i, --inactive-time MINUTES\tSet inactive time (0-90 minutes, 0 disables)\n"); |
| 471 | } |
| 472 | if (show_chatmix_status) { |
| 473 | printf(" -m, --chatmix\t\t\tGet chat-mix-dial level (0-128, <64 for game, >64 for chat)\n"); |
| 474 | } |
| 475 | if (show_notification_sound) { |
| 476 | printf(" -n, --notificate SOUNDID\tPlay notification sound (SOUNDID depends on device)\n"); |
| 477 | } |
| 478 | if (show_volume_limiter) { |
no test coverage detected