Add option to not connect jack ports automatically
This commit is contained in:
parent
8f981845dc
commit
4f6a713b32
2
NEWS
2
NEWS
@ -12,6 +12,8 @@ ver 0.22 (not yet released)
|
|||||||
- ffmpeg: new plugin based on FFmpeg's libavfilter library
|
- ffmpeg: new plugin based on FFmpeg's libavfilter library
|
||||||
- hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback
|
- hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback
|
||||||
- volume: convert S16 to S24 to preserve quality and reduce dithering noise
|
- volume: convert S16 to S24 to preserve quality and reduce dithering noise
|
||||||
|
* output
|
||||||
|
- jack: add option "auto_destination_ports"
|
||||||
* switch to C++17
|
* switch to C++17
|
||||||
- GCC 7 or clang 4 (or newer) recommended
|
- GCC 7 or clang 4 (or newer) recommended
|
||||||
|
|
||||||
|
@ -864,6 +864,10 @@ The jack plugin connects to a `JACK server <http://jackaudio.org/>`_.
|
|||||||
- The names of the JACK source ports to be created. By default, the ports "left" and "right" are created. To use more ports, you have to tweak this option.
|
- The names of the JACK source ports to be created. By default, the ports "left" and "right" are created. To use more ports, you have to tweak this option.
|
||||||
* - **destination_ports A,B**
|
* - **destination_ports A,B**
|
||||||
- The names of the JACK destination ports to connect to.
|
- The names of the JACK destination ports to connect to.
|
||||||
|
* - **auto_destination_ports yes|no**
|
||||||
|
- If set to *yes*, then MPD will automatically create connections between the send ports of
|
||||||
|
MPD and receive ports of the first sound card; if set to *no*, then MPD will only create
|
||||||
|
connections to the contents of *destination_ports* if it is set. Enabled by default.
|
||||||
* - **ringbuffer_size NBYTES**
|
* - **ringbuffer_size NBYTES**
|
||||||
- Sets the size of the ring buffer for each channel. Do not configure this value unless you know what you're doing.
|
- Sets the size of the ring buffer for each channel. Do not configure this value unless you know what you're doing.
|
||||||
|
|
||||||
|
@ -57,6 +57,8 @@ struct JackOutput final : AudioOutput {
|
|||||||
|
|
||||||
std::string destination_ports[MAX_PORTS];
|
std::string destination_ports[MAX_PORTS];
|
||||||
unsigned num_destination_ports;
|
unsigned num_destination_ports;
|
||||||
|
/* overrides num_destination_ports*/
|
||||||
|
bool auto_destination_ports;
|
||||||
|
|
||||||
size_t ringbuffer_size;
|
size_t ringbuffer_size;
|
||||||
|
|
||||||
@ -201,6 +203,8 @@ JackOutput::JackOutput(const ConfigBlock &block)
|
|||||||
num_destination_ports = 0;
|
num_destination_ports = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto_destination_ports = block.GetBlockValue("auto_destination_ports", true);
|
||||||
|
|
||||||
if (num_destination_ports > 0 &&
|
if (num_destination_ports > 0 &&
|
||||||
num_destination_ports != num_source_ports)
|
num_destination_ports != num_source_ports)
|
||||||
FormatWarning(jack_output_domain,
|
FormatWarning(jack_output_domain,
|
||||||
@ -498,6 +502,10 @@ JackOutput::Start()
|
|||||||
const char *dports[MAX_PORTS], **jports;
|
const char *dports[MAX_PORTS], **jports;
|
||||||
unsigned num_dports;
|
unsigned num_dports;
|
||||||
if (num_destination_ports == 0) {
|
if (num_destination_ports == 0) {
|
||||||
|
/* if user requests no auto connect, we are done */
|
||||||
|
if (!auto_destination_ports) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* no output ports were configured - ask libjack for
|
/* no output ports were configured - ask libjack for
|
||||||
defaults */
|
defaults */
|
||||||
jports = jack_get_ports(client, nullptr, nullptr,
|
jports = jack_get_ports(client, nullptr, nullptr,
|
||||||
|
Loading…
Reference in New Issue
Block a user