{"action":"created","issue":{"url":"https://api.github.com/repos/Vampouille/superboucle/issues/22","labels_url":"https://api.github.com/repos/Vampouille/superboucle/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/Vampouille/superboucle/issues/22/comments","events_url":"https://api.github.com/repos/Vampouille/superboucle/issues/22/events","html_url":"https://github.com/Vampouille/superboucle/pull/22","id":88323731,"number":22,"title":"Several features added","user":{"login":"IARI","id":1053417,"avatar_url":"https://avatars.githubusercontent.com/u/1053417?v=3","gravatar_id":"","url":"https://api.github.com/users/IARI","html_url":"https://github.com/IARI","followers_url":"https://api.github.com/users/IARI/followers","following_url":"https://api.github.com/users/IARI/following{/other_user}","gists_url":"https://api.github.com/users/IARI/gists{/gist_id}","starred_url":"https://api.github.com/users/IARI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IARI/subscriptions","organizations_url":"https://api.github.com/users/IARI/orgs","repos_url":"https://api.github.com/users/IARI/repos","events_url":"https://api.github.com/users/IARI/events{/privacy}","received_events_url":"https://api.github.com/users/IARI/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-15T05:34:33Z","updated_at":"2015-06-15T10:01:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Vampouille/superboucle/pulls/22","html_url":"https://github.com/Vampouille/superboucle/pull/22","diff_url":"https://github.com/Vampouille/superboucle/pull/22.diff","patch_url":"https://github.com/Vampouille/superboucle/pull/22.patch"},"body":"... now including the working autoconnect option."},"comment":{"url":"https://api.github.com/repos/Vampouille/superboucle/issues/comments/112003171","html_url":"https://github.com/Vampouille/superboucle/pull/22#issuecomment-112003171","issue_url":"https://api.github.com/repos/Vampouille/superboucle/issues/22","id":112003171,"user":{"login":"Vampouille","id":7067560,"avatar_url":"https://avatars.githubusercontent.com/u/7067560?v=3","gravatar_id":"","url":"https://api.github.com/users/Vampouille","html_url":"https://github.com/Vampouille","followers_url":"https://api.github.com/users/Vampouille/followers","following_url":"https://api.github.com/users/Vampouille/following{/other_user}","gists_url":"https://api.github.com/users/Vampouille/gists{/gist_id}","starred_url":"https://api.github.com/users/Vampouille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vampouille/subscriptions","organizations_url":"https://api.github.com/users/Vampouille/orgs","repos_url":"https://api.github.com/users/Vampouille/repos","events_url":"https://api.github.com/users/Vampouille/events{/privacy}","received_events_url":"https://api.github.com/users/Vampouille/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T10:01:19Z","updated_at":"2015-06-15T10:01:19Z","body":"This is a test file for output port management. It setup several at startup : MAIN, REAR, BASS, PIANO. Then it set new wanted ports (when you load a new song for example) : MAIN, REAR and DELAY. Following code will update client ports to reflect new configuration but without removing all ports and recreating all new ports. It would be nice if you can use this kind of code in updatePorts() method.\r\n\r\nAt the end of example you have `output_ports_by_name` var, this can be used in process callback to retreive port reference from name found in clip.output\r\n\r\n\r\n\t#!/usr/bin/env python3\r\n\r\n\timport jack\r\n\r\n\tclient = jack.Client(\"Output port test\")\r\n\r\n\tclient.outports.register(\"MAIN_L\")\r\n\tclient.outports.register(\"MAIN_R\")\r\n\r\n\tclient.outports.register(\"REAR_L\")\r\n\tclient.outports.register(\"REAR_R\")\r\n\tclient.outports.register(\"BASS_L\")\r\n\tclient.outports.register(\"BASS_R\")\r\n\tclient.outports.register(\"PIANO_L\")\r\n\tclient.outports.register(\"PIANO_R\")\r\n\r\n\r\n\t# activate !\r\n\twith client:\r\n\r\n\t    print(\"Outputs ports : \")\r\n\t    for port in client.outports:\r\n\t\tprint(port)\r\n\r\n\t    # This list can be retreive from clips :\r\n\t    # wanted_ports = [clip.output for clip in song.clips]\r\n\t    wanted_ports = [\"MAIN\", \"REAR\", \"DELAY\"]\r\n\t    real_wanted_ports = []\r\n\t    for name in wanted_ports:\r\n\t\treal_wanted_ports.append(\"%s_L\" % name)\r\n\t\treal_wanted_ports.append(\"%s_R\" % name)\r\n\r\n\t    print(\"real wanted ports:\")\r\n\t    print(real_wanted_ports)\r\n\r\n\t    # remove unwanted ports\r\n\t    for port in [port for port in client.outports\r\n\t\t         if port.shortname not in real_wanted_ports]:\r\n\t\tport.unregister()\r\n\r\n\t    print(\"Outputs ports after removing unused ports : \")\r\n\t    for port in client.outports:\r\n\t\tprint(port)\r\n\r\n\t    # create new ports\r\n\t    current_ports = [port.shortname for port in client.outports]\r\n\t    for new_port_name in [name for name in real_wanted_ports\r\n\t\t                  if name not in current_ports]:\r\n\t\tclient.outports.register(new_port_name)\r\n\r\n\t    print(\"Outputs ports after adding new ports : \")\r\n\t    for port in client.outports:\r\n\t\tprint(port)\r\n\r\n\t    \r\n\t    output_ports_by_name = {port.shortname: port for port in client.outports}\r\n\t    print(output_ports_by_name)\r\n\r\n\t    print(\"#\" * 80)\r\n\t    print(\"press Return to quit\")\r\n\t    print(\"#\" * 80)\r\n\t    input()\r\n"}}