Skip to content

Commit

Permalink
For issue #118, added rc option to auto-enable virtual ports.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Oct 8, 2023
1 parent 98269c2 commit eb5c646
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 128 deletions.
8 changes: 3 additions & 5 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
TO DO for Seq66 0.99.10
Chris Ahlstrom
2019-04-13 to 2023-10-07
2019-04-13 to 2023-10-08

Misc:

- Issue #118
- Document and test mute groups. Issues:
- performer: cliear_mute_groups(), reset_mute_groups(), and
mutegroup_reset() all basically do the same things, except
Expand Down Expand Up @@ -332,15 +331,14 @@ ISSUES:

#117 Option to close pattern windows with esc key?

STATUS: Thinking... This can be done if (1) not playing; and
(2) not in Paint mode.
STATUS: Done, not yet official.

#118 When enabling virtual ports, make those new ports enabled by default?
Currently one has to tick the box to enable and enter the number of output
and input ports, restart seq66, and then tick all the input port
checkboxes in the list then restart seq66 again.

STATUS: At least make it an rc option.
STATUS: Done, not yet official.

#119 Quantized Record Active does not work
Having this button active has no effect; tried changing snap size to
Expand Down
3 changes: 3 additions & 0 deletions data/linux/qseq66.rc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ MIDI Clocks and MIDI Inputs tabs.

# Provides a flag and file-name for MIDI-control I/O settings. '""' means
# no 'ctrl' file. If none, default keystrokes are used, with no MIDI control.
# Note that all configuration files are stored in the "home" configuration
# directory; any paths in the file-names are stripped.

[midi-control-file]

Expand Down Expand Up @@ -119,6 +121,7 @@ tempo-track = 0
[manual-ports]

virtual-ports = false
auto-enable = false
output-port-count = 8
input-port-count = 4

Expand Down
13 changes: 8 additions & 5 deletions doc/latex/tex/menu.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
% \library Documents
% \author Chris Ahlstrom
% \date 2015-08-31
% \update 2023-10-07
% \update 2023-10-08
% \version $Revision$
% \license $XPC_GPL_LICENSE$
%
Expand Down Expand Up @@ -800,7 +800,7 @@ \subsubsection{Menu / Edit / Preferences}
\texttt{-{}-reveal-ports} (\texttt{-r}) option.
If you define these sections, they should match your
hardware exactly, and your hardware should not change from session to
session.
session (or port-mapping should be enabled).
If the "auto ALSA ports" option is turned on, via the \texttt{-a} or
\texttt{-{}-auto-ports} option, then
the input ports from the system are shown.
Expand Down Expand Up @@ -829,21 +829,24 @@ \subsubsection{Menu / Edit / Preferences}

\itempar{Input/Output Recording}{record!by channel}
\index{input by channel}
\textbf{Record input into sequence according to channel}
\textbf{Record input into patterns by channel}
causes MIDI input with multiple channels to be distributed to
each sequence according to MIDI channel number.
When disabled, the normal recording behavior dumps all data into the current
sequence, regardless of channel.

\itempar{Input/Output Virtual Ports}{ports!virtual}
\textbf{Use virtual (manual) I/O Ports}
This new option
\textbf{Use virtual (manual) I/O ports}
This option
allows for configuration of the manual-ports option from within the
user-interace.
Once the option is enable
A \textsl{reload session} (see \sectionref{subsec:concepts_reload_session})
is necessary for this option to take effect.

\itempar{Virtual Ports Auto-Enable}{ports!virtual auto-enable}
\textbf{Auto-enable virtual I/O ports}

\paragraph{Menu / Edit / Preferences / Keyboard (removed)}
\label{paragraph:menu_edit_preferences_keyboard}

Expand Down
13 changes: 12 additions & 1 deletion libseq66/include/cfg/rcsettings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-09-22
* \updates 2023-10-04
* \updates 2023-10-07
* \license GNU GPLv2 or above
*
* This collection of variables describes the options of the application,
Expand Down Expand Up @@ -278,6 +278,7 @@ class rcsettings final : public basesettings
bool m_song_start_is_auto; /**< True if "auto" read from 'rc'. */
bool m_filter_by_channel; /**< Record only sequence channel data. */
bool m_manual_ports; /**< [manual-ports] setting. */
bool m_manual_auto_enable; /**< [manual-port] auto-enable. */
int m_manual_port_count; /**< [manual-ports] outputjport count. */
int m_manual_in_port_count; /**< [manual-ports] inputjport count. */
bool m_reveal_ports; /**< [reveal-ports] setting. */
Expand Down Expand Up @@ -911,6 +912,11 @@ class rcsettings final : public basesettings
return m_manual_ports;
}

bool manual_auto_enable () const
{
return m_manual_auto_enable;
}

int manual_port_count () const
{
return m_manual_port_count;
Expand Down Expand Up @@ -1341,6 +1347,11 @@ class rcsettings final : public basesettings
m_manual_ports = flag;
}

void manual_auto_enable (bool flag)
{
m_manual_auto_enable = flag;
}

void manual_port_count (int count)
{
if (count <= 0 || count > c_output_buss_max)
Expand Down
10 changes: 5 additions & 5 deletions libseq66/include/midi/midibase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ class midibase

/**
* This flag indicates if an input or output bus has been selected for
* action as an input device (such as a MIDI controller). It is turned on
* if the user selects the port in the Options / MIDI Input tab.
* action as an input device (such as a MIDI controller). It is turned
* on if the user selects the port in the Options / MIDI Input tab.
*/

bool m_io_active;

/**
* Indicates if the port is unavailable. For example, when the
* Windows MIDI Mapper grabs the GS wave-table synthesizer.
* The port is not just disabled... it cannot be enabled.
* Indicates if the port is unavailable. For example, when the Windows
* MIDI Mapper grabs the GS wave-table synthesizer. The port is not
* just disabled... it cannot be enabled.
*/

bool m_unavailable;
Expand Down
22 changes: 12 additions & 10 deletions libseq66/src/cfg/rcfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-11-23
* \updates 2023-09-15
* \updates 2023-10-08
* \license GNU GPLv2 or above
*
* The <code> ~/.config/seq66.rc </code> configuration file is fairly simple
Expand Down Expand Up @@ -309,6 +309,8 @@ rcfile::parse ()

bool flag = get_boolean(file, tag, "virtual-ports");
rc_ref().manual_ports(flag);
flag = get_boolean(file, tag, "auto-enable");
rc_ref().manual_auto_enable(flag);

int count = get_integer(file, tag, "output-port-count");
rc_ref().manual_port_count(count);
Expand Down Expand Up @@ -874,11 +876,12 @@ rcfile::write ()
file << "\n"
"# Set to true to create virtual ALSA/JACK I/O ports and not auto-connect\n"
"# to other clients. It allows up to 48 output or input ports (defaults to 8\n"
"# and 4). Set to false to auto-connect Seq66 to the existing ALSA/JACK MIDI\n"
"# ports.\n"
"# and 4). Keep it false to auto-connect Seq66 to real ALSA/JACK MIDI ports.\n"
"# Set 'auto-enable' to enable all virtual ports automatically.\n"
"\n[manual-ports]\n\n"
;
write_boolean(file, "virtual-ports", rc_ref().manual_ports());
write_boolean(file, "auto-enable", rc_ref().manual_auto_enable());
write_integer(file, "output-port-count", rc_ref().manual_port_count());
write_integer(file, "input-port-count", rc_ref().manual_in_port_count());

Expand All @@ -887,8 +890,8 @@ rcfile::write ()
"# These MIDI ports are for input and control. JACK's view: these are\n"
"# 'playback' devices. The first number is the bus, the second number is the\n"
"# input status, disabled (0) or enabled (1). The item in quotes is the full\n"
"# input bus name.\n\n"
"[midi-input]\n\n"
"# input bus name. The type of port depends on the 'virtual-ports' setting.\n"
"\n[midi-input]\n\n"
<< std::setw(2) << int(inbuses)
<< " # number of MIDI input (or control) buses\n\n"
;
Expand Down Expand Up @@ -942,11 +945,10 @@ rcfile::write ()
"#\n"
"# With Clock Modulo, clocking doesn't begin until song position reaches the\n"
"# start-modulo value [midi-clock-mod-ticks]. Ports that are unavailable\n"
"# (because another portapplication, e.g. Windows MIDI Mapper, has exclusive\n"
"# access to the device) are displayed ghosted.\n"
"\n"
"[midi-clock]\n"
"\n"
"# (because another port, e.g. Windows MIDI Mapper, has exclusive access to\n"
"# the device) are displayed ghosted. The type of port depends on the\n"
"# 'virtual-ports' setting.\n"
"\n[midi-clock]\n\n"
<< std::setw(2) << int(outbuses)
<< " # number of MIDI clocks (output/display buses)\n\n"
;
Expand Down
4 changes: 3 additions & 1 deletion libseq66/src/cfg/rcsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* \library seq66 application
* \author Seq24 team; modifications by Chris Ahlstrom
* \date 2015-09-22
* \updates 2023-10-04
* \updates 2023-10-08
* \license GNU GPLv2 or above
*
* Note that this module also sets the legacy global variables, so that
Expand Down Expand Up @@ -98,6 +98,7 @@ rcsettings::rcsettings () :
m_song_start_mode (sequence::playback::automatic),
m_song_start_is_auto (true),
m_manual_ports (false),
m_manual_auto_enable (false),
m_manual_port_count (c_output_buss_default),
m_manual_in_port_count (c_input_buss_default),
m_reveal_ports (false),
Expand Down Expand Up @@ -206,6 +207,7 @@ rcsettings::set_defaults ()
m_song_start_mode = sequence::playback::automatic;
m_song_start_is_auto = true;
m_manual_ports = false;
m_manual_auto_enable = false;
m_manual_port_count = c_output_buss_default;
m_manual_in_port_count = c_input_buss_default;
m_reveal_ports = false;
Expand Down
Loading

0 comments on commit eb5c646

Please sign in to comment.