Peter Hutterer
a1e821c259
pw-dump: use the spa_ato* helpers for string to number conversions
2021-06-02 07:39:41 +00:00
Peter Hutterer
1a5faa7b52
spa: add a header for ANSI color sequences
...
Makes the code more readable and guarantees we use the same sequences for the
same colors everywhere.
2021-06-02 14:17:29 +10:00
Wim Taymans
f383ac21dd
pw-cat: remove debug
2021-05-27 15:26:09 +02:00
Wim Taymans
b9b89b92b2
spa: add some latency helpers
...
Add more fields to the latency object.
Add methods to create, parse and process latency info.
2021-05-27 15:26:09 +02:00
Wim Taymans
f007ca475c
pw-cli: handle failure to create context
...
Fixes #1234
2021-05-26 10:18:15 +02:00
Peter Hutterer
e1211e6a94
tools: fix scan-build errors for unused variables
...
All cases of value stored but never read
2021-05-26 07:51:27 +00:00
Peter Hutterer
92514d57e4
treewide: replace plain strcmp() calls with spa_streq
2021-05-18 22:10:27 +10:00
Peter Hutterer
522f87d5ea
treewide: replace strcmp() != 0 with !spa_streq
...
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Peter Hutterer
95a84e797a
treewide: replace !strcmp() with spa_streq()
...
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Peter Hutterer
7697ed0757
treewide: replace strcmp() == 0 with spa_streq()
...
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Wim Taymans
59842b3bd6
make and use pw_properties_serialize_dict()
...
Remove the multiple other variants and make a better one. Flags are for
future options for escaping and formatting.
2021-05-14 09:08:46 +02:00
Barnabás Pőcze
68f75bbd57
tools/pw-dump: fix parentheses around isatty() call
...
Previously,
isatty(fileno(data.out) && getenv("NO_COLOR") == NULL))
would call `isatty()` with
fileno(data.out) && getenv("NO_COLOR") == NULL
as its argument. This meant that, for example,
NO_COLOR=1 pw-dump
would still produce colored output when run with
a TTY as its standard input.
Fix that by moving the parenthesis.
Fixes: af63d08453 ("tools/pw-dump: only print colors if we're connected to a terminal")
2021-05-08 03:57:34 +02:00
Peter Hutterer
af63d08453
tools/pw-dump: only print colors if we're connected to a terminal
...
We don't want ansi escape codes in the output of `pw-dump > log`. And where
colors are needed after the fact, it's easy to just run `jq . $file`.
2021-05-07 06:57:31 +00:00
Peter Hutterer
2405f0942b
spa/buffer: rename SPA_MEMBER to SPA_PTROFF
...
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
2021-05-06 09:39:39 +00:00
Wim Taymans
3c11b75e32
pw-cli: allow setting keys by their value.
...
Makes things like:
pw-cli s 102 Props '{ 16777216: 1.2 }'
work. Useful when dealing with custom properties that don't have a name
in the type array.
2021-05-03 11:50:42 +02:00
Wim Taymans
7145b2becf
pw-cli: add support for creating Struct in pod
...
Support creating Struct as well. When an object property is marked as
Struct, use [] to start the struct and copy each item with its type into
the struct:
pw-cli s 0 Route '{ info = [ "foo": 0.1 "bar": null [ 0.1 10 "hat" ]] }'
2021-04-30 17:21:42 +02:00
Wim Taymans
aea55f662a
i18n: move to separate .h file
...
So that we can include it where needed and don't cause redefined _()
macros for other projects.
Fixes #1120
2021-04-30 09:57:30 +02:00
Wim Taymans
c52637f783
pw-loopback: implement with the module
...
Implement pw-loopback by loading the module-loopback.
Fixes #1061
2021-04-22 16:16:21 +02:00
Wim Taymans
66e37f6bb7
pw-cli: free properties in create_ functions
2021-04-19 16:37:05 +02:00
Wim Taymans
036c54b043
Add i18n support for some more user-visible strings
2021-04-15 17:56:40 +02:00
Peter Hutterer
223f20709d
meson: replace join_paths(a, b) with a / b
...
More readable and from the meson reference manual:
(since 0.49.0) Using the/ operator on strings is equivalent to calling join_paths.
2021-04-15 06:57:00 +00:00
Wim Taymans
23854539fe
pw-dump: reparse and format JSON metadata values
...
Reparse the metadata value as json and dump it. This ensures the JSON
is valid and that the colors are applied properly.
2021-04-13 20:59:42 +02:00
Wim Taymans
bded2a02a0
pw-dump: output Spa:String:JSON values as literal
...
Don't escape the Spa:String:JSON types in the metadata as it is
supposed to be valid JSON that can be output directly. We might want
to reparse and reformat it later to be sure.
2021-04-13 19:03:06 +02:00
Wim Taymans
ca4b549472
pw-cli: handle properties without type info
...
Some properties don't have type info and then we want to skip
constructing the pod instead of crashing. This makes it possible to
cut and paste the output of pw-dump Route into pw-cli s <card> Route,
for example.
2021-04-09 16:14:50 +02:00
Wim Taymans
d57979517e
pw-loopback: fix help text
...
The id in the help text is not supported
2021-04-09 15:56:00 +02:00
Wim Taymans
6217f20c04
pw-cli: allow param names in enum-params
...
So that "pw-cli e <object.id> Props" works
2021-04-09 15:55:04 +02:00
Wim Taymans
87706c7442
pw-cli: use more powerful pw_properties_new_string()
...
Remove our custom property parsing code and use
pw_properties_new_string() for more powerful syntax.
2021-04-09 15:53:33 +02:00
Wim Taymans
9019edec31
pw-link: improve unlink
...
When we only have one argument, just check the link id and if that
fails don't try to check the second argument because we would crash.
2021-04-08 15:32:06 +02:00
Wim Taymans
1b29531336
pw-link: make it possible to use ids
...
Make it possible to link/unlink using port ids
Make it possible to unlink using the link id
2021-04-08 13:09:51 +02:00
Wim Taymans
40194833ce
pw-link: add option to print ids
...
Add an option to print the object ids
Improve monitor output
2021-04-08 12:54:53 +02:00
Wim Taymans
a296007ed9
pw-link: implement monitor
2021-04-08 12:08:04 +02:00
Wim Taymans
67a3f28bdf
tools: add new pw-link tool
...
pw-link can be used to list, link and unlink ports.
2021-04-07 18:56:44 +02:00
Wim Taymans
3dfd7f26b9
meson: improve tools build
...
Build the tools and sources from a list.
2021-04-07 18:56:44 +02:00
Erkki Seppälä
6a10ac36aa
pw-dot: added -9/--90 for outputting using 'splines = ortho'
...
This results in always drawing edges with 90-degree angles instead of
smooth splines. Graphs laid out this way may be look nicer sometimes,
but it is slower to lay out with large graphs.
2021-04-02 12:04:32 +03:00
Erkki Seppälä
71b53f1590
pw-dot: added -L/--lr for outputting the graph using 'rankdir = "LR"'
...
Graphs laid out this way may be look nicer sometimes.
2021-04-02 12:04:32 +03:00
Erkki Seppälä
21a36f3c51
pw-dot: using output - will write the output to stdout
...
This enables single-liners for viewing the graph in applicable shells.
2021-04-02 12:04:32 +03:00
Erkki Seppälä
4a0b7fa9b8
pw-dot: send diagnostic messages to stderr, not stdout
...
This will help when using stdout for other purposes in the
future (e.g. next commit).
2021-04-02 12:04:32 +03:00
Wim Taymans
90de408e31
loopback: use _raw_build helpers
...
Now that the raw_builder supports wildcard for rate, use it in loopback
and add an option to force resampling as well.
2021-04-01 10:47:23 +02:00
Wim Taymans
c85a04fb49
tools: add some check when parsing the profile info
...
Fail when we can't parse the profile info to avoid using invalid
values.
2021-03-27 20:37:26 +01:00
Wim Taymans
ae22852a9b
remove some useless checks
...
The variable was already dereferenced above and thus can't be NULL
2021-03-27 20:36:43 +01:00
Wim Taymans
faeb42fa66
pw-loopback: fix leaks, improve cleanup
2021-03-25 16:50:49 +01:00
Arseny Maslennikov
403f27c531
meson, pw-top: use ncursesw
...
Some PulseAudio clients are known to use localised client and
stream names as values for the respective PulseAudio props, most
notably plain old pavucontrol.
We call setlocale before anything else for ncurses to display
localised text correctly. We also want to link with ncursesw, which
supports multibyte Unicode locales.
2021-03-25 11:22:52 +00:00
Wim Taymans
b759f9a691
pw-loopback: handle NULL buffers
...
Make sure we return the non-NULL buffers in all cases.
2021-03-24 17:45:18 +01:00
Wim Taymans
4bcb7e0468
tools: add pw-loopback
...
Sends the captured data from a source directly to a sink.
It uses an input and output stream so the source and sink can be
moved in pavucontrol, channel remixing is possible and the volume
can be adjusted.
See #959
2021-03-24 17:02:21 +01:00
Wim Taymans
3b0b5cb55d
pw-dump: print id-xxx for unknown ids
...
When the id has no info in the type system use id-xxx instead
of "unknown".
2021-03-23 11:32:35 +01:00
Wim Taymans
4873dbcf8e
pw-dump: respect NO_COLOR
...
See no-color.org
2021-03-13 20:30:13 +01:00
Thibault Saunier
485bae5eb0
meson: Use feature options everywhere it makes sense
2021-03-10 20:18:34 +00:00
FeRD (Frank Dana)
2931522d2c
pw-cli: Make 'dump' type arg case-insensitive
2021-03-10 11:41:32 -05:00
Wim Taymans
c8fd34a41d
metadata: store default-nodes as JSON
...
Don't just store the id in the metadata but a JSON object with
the node name. This makes it possible to easily introspect the
metadata and also extend the metadata with more fields later.
Instead of matching the metadata id to the global ids we now
have to match it against the name.
2021-03-05 17:37:12 +01:00
Wim Taymans
27f85d1f52
tools: remove registry listener before destroying
...
Otherwise we access freed memory when we try to remove
the listener later.
2021-02-24 14:58:20 +01:00