Skip to content

Commit

Permalink
Added usr option to disable learn-complete prompt.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Apr 17, 2023
1 parent ba413ec commit 84a6118
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 94 deletions.
Binary file modified contrib/midi/mutes-test.midi
Binary file not shown.
173 changes: 90 additions & 83 deletions data/linux/qseq66.usr
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# Seq66 0.97.2 user ('usr') configuration file
# Seq66 0.99.3 user ('usr') configuration file
#
# /home/usr/.config/seq66/qseq66.usr
# Written 2021-12-03 07:49:33
# Written 2023-04-17 19:12:53
#
# 'usr' file. Edit it and place it in $HOME/.config/seq66. It allows
# aliases (alternate names) to each MIDI bus/port, channel, and
# control code, per channel. It has options not present in Seq24.
# 'usr' file. Edit it and place it in ~/.config/seq66. It allows naming each
# MIDI bus/port, channel, and control code.

[Seq66]

config-type = "usr"
version = 9
version = 10

# [comments] holds user documentation for this file. The first empty,
# hash-commented, or tag line ends the comment.
# [comments] holds user documentation for this file. The first empty, hash-
# commented, or tag line ends the comment.

[comments]

Expand All @@ -26,66 +25,65 @@ look empty with a space.
# 1. Define instruments and their control-code names, as applicable.
# 2. Define MIDI busses, names, and the instruments on each channel.
#
# In these definitions, channels are counted from 0-15, not 1-16.
# Instruments not set here are set to -1 and are GM (General MIDI).
# These labels are shown in MIDI Clocks, Inputs, the pattern editor
# buss, channel, and event drop-downs. To disable entries, set
# counts to 0.
# Channels are counted from 0-15, not 1-16. Instruments not set here are set
# to -1 and are GM (General MIDI). These labels are shown in MIDI Clocks,
# Inputs, the pattern editor buss, channel, and event drop-downs. To disable
# entries, set counts to 0.

[user-midi-bus-definitions]

0 # number of user-defined MIDI busses

# In these MIDI instrument definitions, active controller numbers
# (i.e. supported by the instrument) are paired with the (optional)
# name of the controller supported.
# In these MIDI instrument definitions, active (supported by the instrument)
# controller numbers are paired with the (optional) name of the controller.

[user-instrument-definitions]

0 # instrument list count

# [user-interface-settings]
#
# Configures some user-interface elements. Many became obsolete and
# were removed in version 5 of this file. Also see [user-ui-tweaks].
# The grid holds Qt buttons. For styling, use Qt themes/style-sheets.
# Configures some user-interface elements. Obsolete ones were removed in
# version 5 of this file. Also see [user-ui-tweaks]. The grid holds Qt push-
# buttons. For styling, use Qt themes/style-sheets.
#
# 'swap-coordinates' swaps numbering so pattern numbers vary fastest
# by column instead of (legacy) rows. This setting applies to the live
# grid, mute-group buttons, and set-buttons.
# 'swap-coordinates' swaps numbering so pattern numbers vary fastest by column
# instead of rows. This setting applies to the live grid, mute-group buttons,
# and set-buttons.
#
# 'mainwnd-rows' and 'mainwnd-columns' (option '-o sets=RxC') specify
# rows/columns in the main grid. R ranges from 4 to 8, C from 4 to 12.
# Values other than 4x8 have not been tested thoroughly.
#
# 'mainwnd-spacing' is for grid buttons; from 0 to 16, default = 2.
#
# 'default-zoom' is the initial zoom for the piano rolls. From 1 to
# 512, defaults = 2. Larger PPQNs require larger zoom to look good.
# Seq66 adapts the zoom to the PPQN if set to 0. The unit of zoom is
# ticks/pixel.
# 'default-zoom' is the initial zoom for piano rolls. From 1 to 512, default
# = 2. Larger PPQNs require larger zoom to look good. Seq66 adapts the zoom to
# the PPQN if set to 0. The unit of zoom is ticks/pixel.
#
# 'global-seq-feature' specifies if the key, scale, and background
# pattern are applied to all patterns, or separately to each. These
# These values are stored in the MIDI file, either in the global
# SeqSpec (if true) or in each track (if false).
# 'global-seq-feature' applies the key, scale, and background pattern to all
# patterns versus separately to each. If all, these values are stored in the
# MIDI file in the global SeqSpec versus in each track.
#
# 'progress-bar-thick specifies a thicker progress bar. Default is 1
# pixel; thick is 2 pixels if set to true. Also makes the progress box
# 'progress-bar-thick specifies a thicker progress bar. Default is 1 pixel;
# thick is 2 pixels if set to true. Also makes the progress box border
# border 2 pixels, and the slot font bold.
#
# 'inverse-colors' (option -K/--inverse) specifies use of an inverse
# color palette. Palettes are for Seq66 drawing areas, not for the
# Qt theme. Normal/inverse palettes are changed via a 'palette' file.
# 'inverse-colors' (option -K/--inverse) specifies use of an inverse color
# palette. Palettes are for Seq66 drawing areas, not for Qt widgets.
# Normal/inverse palettes can be reconfigured via a 'palette' file.
#
# 'dark-theme' specifies that are dark theme is active.
#
# 'window-redraw-rate' specifies the base window redraw rate for all
# windows. From 10 to 100; default = 40 ms (25 ms for Windows).
# 'window-redraw-rate' specifies the base window redraw rate for all windows.
# From 10 to 100; default = 40 ms (25 ms for Windows).
#
# Window-scale (option '-o scale=m.n[xp.q]') specifies scaling the
# main window at startup. Defaults to 1.0 x 1.0. If between 0.5 and
# 3.0, it changes the size of the main window proportionately.
# Window-scale (option '-o scale=m.n[xp.q]') specifies scaling the main
# window at startup. Defaults to 1.0 x 1.0. If between 0.5 and 3.0, it
# changes the size of the main window proportionately.
#
# 'enable-learn-confirmation' can be set to false to disable the prompt that
# the mute-group learn action succeeded. Can be annoying.

[user-interface-settings]

Expand All @@ -101,10 +99,11 @@ dark-theme = false
window-redraw-rate = 40
window-scale = 1
window-scale-y = 1
enable-learn-confirmation = false

# Seq66 separates file PPQN from the Seq66 PPQN. 'default-ppqn'
# specifies the Seq66 PPQN, from 32 to 19200, default = 192.
# 'use-file-ppqn' (recommended) indicates to use file PPQN.
# Seq66 separates file PPQN from the Seq66 PPQN. 'default-ppqn' specifies the
# Seq66 PPQN, from 32 to 19200, default = 192. 'use-file-ppqn' (recommended)
# indicates to use file PPQN.

[user-midi-ppqn]

Expand All @@ -128,23 +127,17 @@ use-file-ppqn = true
# 'bpm-minimum': 0.0 127.0
# 'bpm-maximum': 0.0 127.0
#
# 'convert-to-smf-1' controls if SMF 0 files are split into SMF 1
# track when read.
#
# 'buss-override' sets the output port for all patterns, for testing
# or convenience. Don't save the MIDI file unless you want to save
# the buss value!
#
# 'velocity-override' when adding notes in the pattern editor is set
# via the 'Vol' button. -1 ('Free'), preserves incoming velocity.
#
# 'convert-to-smf-1' controls if SMF 0 files are split into SMF 1 when read.
# 'buss-override' sets the output port for all patterns, for testing, etc.
# This value will be saved if you save the MIDI file!!!
# 'velocity-override' controls adding notes in the pattern editor; see the
# 'Vol' button. -1 ('Free'), preserves incoming velocity.
# 'bpm-precision' (spinner and MIDI control) is 0, 1, or 2.
# 'bpm-step-increment' affects the spinner and MIDI control. For 1
# decimal point, 0.1 is good. For 2, 0.01 is good, 0.05 is faster.
# Set 'bpm-page-increment' larger than the step-increment; used with
# the Page-Up/Page-Down keys in the spinner. BPM minimum/maximum sets
# the range in tempo graphing; defaults to 0.0 to 127.0. Decrease it
# for a magnified view of tempo.
# 'bpm-step-increment' affects the spinner and MIDI control. For 1 decimal,
# 0.1 is good. For 2, 0.01 is good, 0.05 is faster. Set 'bpm-page-increment'
# larger than the step-increment; used with the Page-Up/Page-Down keys in the
# spinner. BPM minimum/maximum sets the range in tempo graphing; defaults to
# 0.0 to 127.0. Decrease it for a magnified view of tempo.

[user-midi-settings]

Expand All @@ -162,29 +155,42 @@ bpm-maximum = 600

# [user-options]
#
# These settings specify -o or --option switch values.
# 'daemonize' is used in seq66cli to indicate the application should
# be run as a service. 'log' specifies a log-file that gets output to
# standard output/error. For no log-file, use "". This option
# also works from the command line: '-o log=filename.log'. The name
# here is used for the no-name '-o log' option.
# These settings specify -o or --option switch values. 'daemonize' is used
# in seq66cli to indicate the application should run as a service. 'log'
# specifies a log-file that gets output to standard output/error. For no
# log-file, use "". This option also works from the command line:
# '-o log=filename.log'.

[user-options]

daemonize = false
log = "/home/user/.config/seq66/seq66.log"
pdf-viewer = ""
browser = ""

# [user-ui-tweaks]
#
# key-height specifies the initial height (before vertical zoom) of
# pattern editor keys. Defaults to 10 pixels, ranges from 6 to 32.
# key-height specifies the initial height (before vertical zoom) of pattern
# editor keys. Defaults to 10 pixels, ranges from 6 to 32.
#
# key-view specifies the default for showing labels for each key:
# 'octave-letters' (default), 'even_letters', 'all-letters',
# 'even-numbers', and 'all-numbers'.
#
# note-resume, if active, causes notes-in-progress to be resumed when
# the pattern is toggled back on.
# note-resume causes notes-in-progress to resume when the pattern toggles on.
#
# If specified, a style-sheet (e.g. 'qseq66.qss') is applied at startup.
# Normally just a base-name, it can contain a file-path to provide a style
# usable in many other applications.
#
# A fingerprint is a condensation of note events in a long track, to reduce
# the time drawing the pattern in the buttons. Ranges from 32 (default) to
# 128. 0 = don't use a fingerprint.
#
# progress-box-width and -height settings change the scaled size of the
# progress box in the live-grid buttons. Width ranges from 0.50 to 1.0, and
# the height from 0.10 to 1.0. If either is 'default', defaults (0.8 x 0.3)
# are used. progress-box-shown controls if the boxes are shown at all.
#
# If specified, a style-sheet (e.g. 'qseq66.qss') is applied at
# startup. Normally just a base-name, it can contain a file-path
Expand Down Expand Up @@ -213,21 +219,22 @@ key-view = octave-letters
note-resume = false
style-sheet-active = false
style-sheet = "flat-rounded.qss"
fingerprint-size = 128
fingerprint-size = 32
progress-box-width = 0.8
progress-box-height = 0.4
progress-box-height = 0.3
progress-box-shown = true
progress-note-min = 0
progress-note-max = 127
lock-main-window = false

# [user-session]
#
# The session manager to use, if any. The 'session' value is 'none'
# (default), 'nsm' (Non/New Session Manager), or 'jack'. 'url' can be
# be set to the value set by nsmd when run by command-line. Set 'url'
# only if running nsmd stand-alone; use the --osc-port number. Seq66
# detects if started in an NSM environment, though. The visibility
# flag is used only by NSM to restore visibility.
# The session manager to use, if any. 'session' is 'none' (default), 'nsm'
# (Non/New Session Manager), or 'jack'. 'url' can be set to the value set by
# nsmd when run by command-line. Set 'url' if running nsmd stand-alone; use
# the --osc-port number. Seq66 detects if started in NSM. The visibility flag
# is used only by NSM to restore visibility. 'copy-config' indicates if the
# existing home configuration is copied to a new NSM session.

[user-session]

Expand All @@ -237,12 +244,12 @@ visibility = true

# [new-pattern-editor]
#
# Setup values for play/recording when a new pattern is opened.
# A new pattern means that the loop has the default name 'Untitled'
# and no events. These values save time during a live recording
# session. The valid values for record-style are 'merge' (default),
# 'overwrite', 'expand', and 'one-shot'. The 'wrap-around' value, if
# true, allows recorded notes to wrap around to the pattern start.
# Setup values for play/recording when a new pattern is opened. A new pattern
# means that the loop has the default name 'Untitled' and no events. These
# values save time during a live recording session. The valid values for
# record-style are 'merge' (default), 'overwrite', 'expand', and 'one-shot'.
# 'wrap-around', if true, allows recorded notes to wrap around to the
# pattern start.

[new-pattern-editor]

Expand Down
3 changes: 2 additions & 1 deletion doc/latex/tex/configuration.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
% \library Documents
% \author Chris Ahlstrom
% \date 2021-01-18
% \update 2023-04-05
% \update 2023-04-17
% \version $Revision$
% \license $XPC_GPL_LICENSE$
%
Expand Down Expand Up @@ -1393,6 +1393,7 @@ \subsubsection{'usr' File / User Interface Settings}
window-redraw-rate = 40
window-scale = 1
window-scale-y = 1
enable-learn-confirmation = true
\end{verbatim}

\texttt{swap-coordinates} allows for an alternate mapping of pattern
Expand Down
19 changes: 18 additions & 1 deletion libseq66/include/cfg/usrsettings.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-03-22
* \updates 2023-04-17
* \license GNU GPLv2 or above
*
* This module defines the following categories of "global" variables that
Expand Down Expand Up @@ -959,6 +959,13 @@ class usrsettings final : public basesettings

gridmode m_grid_mode;

/**
* If true (the default), then a prompt is shown (in the GUI) when
* a mute-group learn operation succeeds.
*/

bool m_enable_learn_confirmation;

public:

usrsettings ();
Expand Down Expand Up @@ -1739,6 +1746,16 @@ class usrsettings final : public basesettings

std::string grid_mode_label (gridmode gm = gridmode::max) const;

bool enable_learn_confirmation () const
{
return m_enable_learn_confirmation;
}

void enable_learn_confirmation (bool flag)
{
m_enable_learn_confirmation = flag;
}

public: // used in main application module and the usrfile class

void progress_note_min_max (int vmin, int vmax);
Expand Down
14 changes: 13 additions & 1 deletion libseq66/src/cfg/usrfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-11-23
* \updates 2023-03-27
* \updates 2023-04-17
* \license GNU GPLv2 or above
*
* Note that the parse function has some code that is not yet enabled.
Expand Down Expand Up @@ -297,6 +297,11 @@ usrfile::parse ()
double scale = get_float(file, tag, "window-scale");
double scaley = get_float(file, tag, "window-scale-y");
usr().window_scale(scale, scaley, true); /* x & y the same */
flag = get_boolean
(
file, tag, "enable-learn-confirmation", 0, true
);
usr().enable_learn_confirmation(flag);
}
usr().normalize(); /* recalculate */

Expand Down Expand Up @@ -714,6 +719,9 @@ usrfile::write ()
"# Window-scale (option '-o scale=m.n[xp.q]') specifies scaling the main\n"
"# window at startup. Defaults to 1.0 x 1.0. If between 0.5 and 3.0, it\n"
"# changes the size of the main window proportionately.\n"
"#\n"
"# 'enable-learn-confirmation' can be set to false to disable the prompt that\n"
"# the mute-group learn action succeeded. Can be annoying.\n"
"\n[user-interface-settings]\n\n"
;
write_boolean(file, "swap-coordinates", usr().swap_coordinates());
Expand All @@ -728,6 +736,10 @@ usrfile::write ()
write_integer(file, "window-redraw-rate", usr().window_redraw_rate());
write_float(file, "window-scale", usr().window_scale());
write_float(file, "window-scale-y", usr().window_scale_y());
write_boolean
(
file, "enable-learn-confirmation", usr().enable_learn_confirmation()
);

/*
* [user-midi-ppqn]
Expand Down
Loading

0 comments on commit 84a6118

Please sign in to comment.