windytan / redsea

Command-line FM-RDS decoder with JSON output.
MIT License
390 stars 36 forks source link

Human-readable output format #71

Closed windytan closed 2 months ago

windytan commented 4 years ago

Redsea should have an optional human-readable output format. It should

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?

andimik commented 4 years ago

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