Files
lmms/include
Michael Gregorius 997764a0dc Inputs and Outputs Selection for Jack Driver (#7919)
# GUI

## Present inputs/outputs in hierarchical menu

Present the available inputs and outputs in a hierarchical sorted menu
which shows clients with their ports.

The heavy lifting of creating the menu for the tool button is done in the
new method `buildMenu`.

It takes the input/output names in Jack's "Client name:Port name" format.
If an input/output name can be successfully split into the client name
and port name then a sub menu with the client name is created (if it was
not already created before) and the port name is added as an entry.

If the name cannot be split into exactly two components then it is simply
added to the top level menu as is.

Ports of the LMMS client are filtered out to prevent loops.

The menu starts with the client's sub menus in alphabetical order. Then
the top level entries are added in alphabetical order as well.

The callbacks for the `QAction` instances are implemented with lambdas
because MOC does not support nested classes like the setup widget is. For
now the used lambda only sets the text of the `QToolButton` as these are
used for persisting the configuration anyway.

## Disconnected state

Add the option to keep inputs/outputs disconnected.

The disconnected state is represented by the string "-" which is also
what is saved into the configuration in this case. For now the
representation in the GUI and of the save state is the same as it has the
advantage that no translation is necessary and thus not mapping between
display text and save state is necessary.

## Show technical output/input names

Show the technical output and input port names used by LMMS in the setup
dialog. Note: these are the names that are shown in tools like `qjackctl`
or `qpwgraph`.

This was proposed in a review. Personally I like the non-technical names
better but let's see what's accepted.

## Let the tool buttons use available space

Let the tool buttons stretch so that they look uniform and use all the
available space.

# Driver

## Reconnect inputs and outputs

Attempt to reconnect the inputs and outputs from the configuration during
startup of the Jack driver. Nothing will be done for inputs and outputs
that are not available at startup. Example: the users might have saved
some inputs when a device was available. The device is then disconnected
and LMMS restarted. The stored inputs cannot be used anymore. To give the
users the least surprise nothing is done.

`AudioJack::attemptToConnect` does the actual reconnection and also
prints some information for now.

`attemptToReconnectOutput` and `attemptToReconnectInput` delegate to
`attemptToConnect` with the right parameters.

# Technical details

## Generalized number of inputs/outputs

Generalize the number of inputs and outputs by using for loops. This
affects the number of widgets that are created and the amount of
configuration that is stored.

This change is a result of a code review discussion. In my opinion it
adds unnecessary complexity to something that should later be implemented
completely different anyway. It is for example now necessary to compute
the key names that are used during the saving of the configuration based
on the channel number. The commit exists so that its changes can be
discussed further. It might be reverted in one of the next commits.

## Collecting input and output names

Add `AudioJack::setupWidget::getAudioPortNames` which takes the type of
port and then collects all port names which match. Make
`getAudioOutputNames` and `getAudioInputNames` delegate to that method
with the appropriate type. This also hides the different terminologies a
bit.

## Separate Jack client in the GUI

The separate Jack client is necessary because the setup dialog does not
have any access to the actual driver. So a new client is created when the
dialog is opened and deleted when it is closed, i.e. when the dialog is
deleted itself.

## Repeated strings

Repeatedly used hard-coded strings are defined as static constant
variables in the anonymous namespace. This should prevent subtle mistakes
when working with the configuration values of the Jack driver.

## Saving the settings

`AudioJack::setupWidget::saveSettings` saves the selections that have
been made from the widgets right into the configuration.
2025-07-16 22:31:01 +02:00
..
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2025-06-08 20:15:16 -04:00
2023-01-05 17:58:49 -05:00
2024-08-11 12:20:02 +02:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-11-11 18:09:38 -05:00
2023-01-05 17:58:49 -05:00
2023-11-19 00:44:15 -05:00
2025-06-15 14:41:23 -04:00
2023-01-05 17:58:49 -05:00
2023-08-24 19:16:02 +01:00
2023-01-05 17:58:49 -05:00
2024-11-22 23:11:39 -05:00
2023-01-05 17:58:49 -05:00
2025-04-26 18:26:26 -04:00
2024-09-20 20:00:36 -04:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-08-24 19:16:02 +01:00
2023-01-05 17:58:49 -05:00
2025-03-20 01:30:29 -04:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-09-28 20:23:35 -04:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2025-07-07 20:16:24 -04:00
2023-01-05 17:58:49 -05:00
2008-07-22 11:36:50 +00:00
2023-01-05 17:58:49 -05:00
2023-11-19 00:44:15 -05:00
2023-11-19 00:44:15 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-09-24 17:36:59 +02:00
2025-06-08 20:15:16 -04:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2024-07-08 23:02:49 +02:00
2023-08-24 19:16:02 +01:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-08-24 19:16:02 +01:00
2023-08-24 19:16:02 +01:00
2023-07-22 23:03:31 +02:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-06-02 22:17:03 +02:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2024-06-01 12:09:47 +02:00
2023-01-05 17:58:49 -05:00
2023-11-19 00:44:15 -05:00
2023-01-05 17:58:49 -05:00
2024-02-25 13:49:56 -05:00
2024-07-08 23:02:49 +02:00
2023-01-05 17:58:49 -05:00
2023-08-24 19:16:02 +01:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-08-24 19:16:02 +01:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2025-04-26 18:26:26 -04:00
2023-01-05 17:58:49 -05:00
2023-07-16 14:11:24 +02:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-08-24 19:16:02 +01:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-01-05 17:58:49 -05:00
2023-08-24 19:16:02 +01:00
2024-02-25 13:49:56 -05:00