redsea
redsea copied to clipboard
Human-readable output format
Redsea should have an optional human-readable output format. It should
- be compact and regularly formatted
- for the most part, have one line per group
- perhaps utilize ANSI colors to show the status of booleans
For example, this:
{"pi":"0xD385","group":"2A","prog_type":"Pop music","tp":false}
{"pi":"0xD385","group":"2A","prog_type":"Pop music","tp":false}
{"pi":"0xD385","group":"0A","ps":" N-JOY ","di":{"dynamic_pty":true},"is_music":true,"prog_type":"Pop music","ta":false,"tp":false}
{"pi":"0xD385","group":"2A","prog_type":"Pop music","tp":false}
{"pi":"0xD385","group":"2A","radiotext":"Speeding Cars - Walking On Cars","prog_type":"Pop music","tp":false}
{"pi":"0xD385","group":"0A","di":{"stereo":false},"is_music":true,"prog_type":"Pop music","ta":false,"tp":false}
{"pi":"0xD385","group":"2A","prog_type":"Pop music","tp":false}
becomes this:
D385 2A TP MS (Pop music)
D385 2A TP MS (Pop music)
D385 0A TP MS (Pop music) PS: N-JOY
D385 2A TP MS (Pop music)
D385 2A TP MS (Pop music) RT:Speeding Cars - Walking On Cars
D385 0A TP MS (Pop music)
D385 2A TP MS (Pop music)
This could be implemented by fetching data from the internal JSON representation. A downside to that is that we have to remember the sorting tags for each key.
Some PTY names are quite long compared to the other information, and they take an unnecessarily large space. Arguably it's not even useful information in a human-readable output. Should they be abbreviated somehow? Even omitted?
Radio manufacturers who use 8 digit displays have already such terms in use, for example https://helpguide.sony.net/ev/dsx-b41d/v1/en/contents/TP0002733572.html