mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	jack: tweak names a little
Move the Description in the main node/port name. This then matches the device names seen in pavucontrol. Make the port alias contain the node nick.
This commit is contained in:
		
							parent
							
								
									e66cb18659
								
							
						
					
					
						commit
						60233e30a7
					
				
					 2 changed files with 15 additions and 7 deletions
				
			
		| 
						 | 
					@ -2113,8 +2113,8 @@ static void registry_event_global(void *data, uint32_t id,
 | 
				
			||||||
		if ((str = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS)) != NULL)
 | 
							if ((str = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS)) != NULL)
 | 
				
			||||||
			o->node.is_bridge = strstr(str, "Bridge") != NULL;
 | 
								o->node.is_bridge = strstr(str, "Bridge") != NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ((str = spa_dict_lookup(props, PW_KEY_NODE_NICK)) == NULL &&
 | 
							if ((str = spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)) == NULL &&
 | 
				
			||||||
		    (str = spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)) == NULL &&
 | 
							    (str = spa_dict_lookup(props, PW_KEY_NODE_NICK)) == NULL &&
 | 
				
			||||||
		    (str = node_name) == NULL) {
 | 
							    (str = node_name) == NULL) {
 | 
				
			||||||
			str = "node";
 | 
								str = "node";
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,7 +84,7 @@ static void node_port_init(void *data, struct pw_impl_port *port)
 | 
				
			||||||
	const struct pw_properties *old;
 | 
						const struct pw_properties *old;
 | 
				
			||||||
	enum pw_direction direction;
 | 
						enum pw_direction direction;
 | 
				
			||||||
	struct pw_properties *new;
 | 
						struct pw_properties *new;
 | 
				
			||||||
	const char *str, *path, *node_name, *media_class;
 | 
						const char *str, *path, *desc, *nick, *name, *node_name, *media_class;
 | 
				
			||||||
	char position[8], *prefix;
 | 
						char position[8], *prefix;
 | 
				
			||||||
	bool is_monitor, is_device, is_duplex, is_virtual;
 | 
						bool is_monitor, is_device, is_duplex, is_virtual;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -138,15 +138,23 @@ static void node_port_init(void *data, struct pw_impl_port *port)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((node_name = pw_properties_get(n->props, PW_KEY_NODE_DESCRIPTION)) == NULL &&
 | 
						desc = pw_properties_get(n->props, PW_KEY_NODE_DESCRIPTION);
 | 
				
			||||||
	    (node_name = pw_properties_get(n->props, PW_KEY_NODE_NICK)) == NULL &&
 | 
						nick = pw_properties_get(n->props, PW_KEY_NODE_NICK);
 | 
				
			||||||
	    (node_name = pw_properties_get(n->props, PW_KEY_NODE_NAME)) == NULL) {
 | 
						name = pw_properties_get(n->props, PW_KEY_NODE_NAME);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if ((node_name = desc) == NULL && (node_name = nick) == NULL &&
 | 
				
			||||||
 | 
						    (node_name = name) == NULL)
 | 
				
			||||||
		node_name = "node";
 | 
							node_name = "node";
 | 
				
			||||||
	}
 | 
					
 | 
				
			||||||
	pw_properties_setf(new, PW_KEY_OBJECT_PATH, "%s:%s_%d",
 | 
						pw_properties_setf(new, PW_KEY_OBJECT_PATH, "%s:%s_%d",
 | 
				
			||||||
			path ? path : node_name, prefix, pw_impl_port_get_id(port));
 | 
								path ? path : node_name, prefix, pw_impl_port_get_id(port));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_properties_setf(new, PW_KEY_PORT_NAME, "%s_%s", prefix, str);
 | 
						pw_properties_setf(new, PW_KEY_PORT_NAME, "%s_%s", prefix, str);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if ((node_name = nick) == NULL && (node_name = desc) == NULL &&
 | 
				
			||||||
 | 
						    (node_name = name) == NULL)
 | 
				
			||||||
 | 
							node_name = "node";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_properties_setf(new, PW_KEY_PORT_ALIAS, "%s:%s_%s",
 | 
						pw_properties_setf(new, PW_KEY_PORT_ALIAS, "%s:%s_%s",
 | 
				
			||||||
			node_name, prefix, str);
 | 
								node_name, prefix, str);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue