ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
groups.h File Reference

Option group definitions for composable mode presets. More...

Go to the source code of this file.

Macros

#define MODE_SERVER_GROUPS
 Mode group presets.
 
#define MODE_CLIENT_GROUPS
 
#define MODE_MIRROR_GROUPS    (OPT_GROUP_BINARY | OPT_GROUP_TERMINAL | OPT_GROUP_WEBCAM | OPT_GROUP_DISPLAY | OPT_GROUP_SNAPSHOT | OPT_GROUP_MEDIA)
 
#define MODE_DISCOVERY_GROUPS
 
#define MODE_ACDS_GROUPS   (OPT_GROUP_BINARY | OPT_GROUP_NETWORK | OPT_GROUP_CRYPTO | OPT_GROUP_WEBRTC)
 

Enumerations

enum  option_group_t {
  OPT_GROUP_NONE = 0 , OPT_GROUP_BINARY = (1 << 0) , OPT_GROUP_TERMINAL = (1 << 1) , OPT_GROUP_NETWORK = (1 << 2) ,
  OPT_GROUP_WEBCAM = (1 << 3) , OPT_GROUP_DISPLAY = (1 << 4) , OPT_GROUP_AUDIO = (1 << 5) , OPT_GROUP_SNAPSHOT = (1 << 6) ,
  OPT_GROUP_CRYPTO = (1 << 7) , OPT_GROUP_COMPRESSION = (1 << 8) , OPT_GROUP_ACDS = (1 << 9) , OPT_GROUP_MEDIA = (1 << 10) ,
  OPT_GROUP_SERVER = (1 << 11) , OPT_GROUP_CLIENT = (1 << 12) , OPT_GROUP_WEBRTC = (1 << 13)
}
 Option group identifiers. More...
 

Detailed Description

Option group definitions for composable mode presets.

This header defines option groups that allow modes to share common options without duplication. Each group is a collection of related options that can be added to a builder to create mode-specific configurations.

Option Group Architecture

Options are organized into logical groups:

  • BINARY: Options parsed before mode selection (help, version, logging)
  • TERMINAL: Terminal dimension options (width, height)
  • NETWORK: Network connection options (address, port, reconnect)
  • WEBCAM: Video capture options (device, flip, test pattern)
  • DISPLAY: Rendering options (color mode, palette, render mode)
  • AUDIO: Audio streaming options (enable, devices, volume)
  • SNAPSHOT: Single-frame capture options
  • CRYPTO: Encryption and authentication options
  • COMPRESSION: Network compression options
  • ACDS: Discovery service integration options
  • MEDIA: Media file streaming options

Mode Group Composition

Each mode uses a specific combination of groups:

  • Server: BINARY + NETWORK + CRYPTO + COMPRESSION + ACDS
  • Client: BINARY + TERMINAL + NETWORK + WEBCAM + DISPLAY + AUDIO + SNAPSHOT + CRYPTO + COMPRESSION + ACDS + MEDIA
  • Mirror: BINARY + TERMINAL + WEBCAM + DISPLAY + SNAPSHOT + MEDIA
  • Discovery: BINARY + TERMINAL + NETWORK + WEBCAM + DISPLAY + AUDIO + SNAPSHOT + CRYPTO + ACDS + MEDIA
  • ACDS: BINARY + NETWORK + CRYPTO
Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
January 2026

Definition in file groups.h.

Macro Definition Documentation

◆ MODE_ACDS_GROUPS

ACDS mode options: discovery service with network and crypto

Definition at line 99 of file groups.h.

◆ MODE_CLIENT_GROUPS

#define MODE_CLIENT_GROUPS
Value:
@ OPT_GROUP_CRYPTO
Encryption and authentication options.
Definition groups.h:59
@ OPT_GROUP_DISPLAY
Display options (color mode, palette, render mode)
Definition groups.h:56
@ OPT_GROUP_CLIENT
Client-specific options (reconnect, server-key)
Definition groups.h:64
@ OPT_GROUP_ACDS
ACDS discovery service options.
Definition groups.h:61
@ OPT_GROUP_BINARY
Binary-level options (help, version, logging)
Definition groups.h:52
@ OPT_GROUP_AUDIO
Audio options (enable, devices, volume)
Definition groups.h:57
@ OPT_GROUP_COMPRESSION
Compression options.
Definition groups.h:60
@ OPT_GROUP_NETWORK
Network options (address, port, reconnect)
Definition groups.h:54
@ OPT_GROUP_SNAPSHOT
Snapshot mode options.
Definition groups.h:58
@ OPT_GROUP_TERMINAL
Terminal dimension options (width, height)
Definition groups.h:53
@ OPT_GROUP_WEBCAM
Webcam options (device, flip, test pattern)
Definition groups.h:55
@ OPT_GROUP_MEDIA
Media file streaming options.
Definition groups.h:62
@ OPT_GROUP_WEBRTC
WebRTC connectivity options (STUN/TURN)
Definition groups.h:65

Client mode options: display, webcam, audio, crypto, ACDS

Definition at line 83 of file groups.h.

108 {
109 switch (group) {
110 case OPT_GROUP_NONE:
111 return "NONE";
112 case OPT_GROUP_BINARY:
113 return "BINARY";
115 return "TERMINAL";
117 return "NETWORK";
118 case OPT_GROUP_WEBCAM:
119 return "WEBCAM";
121 return "DISPLAY";
122 case OPT_GROUP_AUDIO:
123 return "AUDIO";
125 return "SNAPSHOT";
126 case OPT_GROUP_CRYPTO:
127 return "CRYPTO";
129 return "COMPRESSION";
130 case OPT_GROUP_ACDS:
131 return "ACDS";
132 case OPT_GROUP_MEDIA:
133 return "MEDIA";
134 case OPT_GROUP_SERVER:
135 return "SERVER";
136 case OPT_GROUP_CLIENT:
137 return "CLIENT";
138 case OPT_GROUP_WEBRTC:
139 return "WEBRTC";
140 default:
141 return "UNKNOWN";
142 }
143}
144
154static inline bool option_group_has(uint32_t mode_groups, option_group_t group) {
155 return (mode_groups & (uint32_t)group) != 0;
156}
unsigned int uint32_t
Definition common.h:58
option_group_t
Option group identifiers.
Definition groups.h:50
@ OPT_GROUP_NONE
No groups.
Definition groups.h:51
@ OPT_GROUP_SERVER
Server-specific options (max_clients, client-keys)
Definition groups.h:63

◆ MODE_DISCOVERY_GROUPS

#define MODE_DISCOVERY_GROUPS

◆ MODE_MIRROR_GROUPS

Mirror mode options: local webcam preview without networking

Definition at line 89 of file groups.h.