Skip to content

Commit

Permalink
For issue #117, added 'usr' option to enable Esc key to close the pat…
Browse files Browse the repository at this point in the history
…tern editor if play is stopped and not in paint mode.
  • Loading branch information
ahlstromcj committed Oct 7, 2023
1 parent 6e66db5 commit 98269c2
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 91 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# README for Seq66 0.99.10 2023-10-04
# README for Seq66 0.99.10 2023-10-07

__Seq66__: MIDI sequencer/live-looper with a hardware-sampler grid interface;
pattern banks, triggers, and playlists for song management; scale and chord
Expand Down Expand Up @@ -83,6 +83,10 @@ Windows, and using a conventional source tarball.
## Recent Changes

* Version 0.99.10:
* Issue #117 Option to close pattern windows with esc key. Must
be enabled via a 'usr' option first.
* Issue #118 Make virtual ports ports enabled by default. TO DO.
* Issue #119 "Quantized Record Active does not work" fixed.
* Multiple tempo events can be drawn in a line in the data pane.
They can be dragged up and down in the data pane.
* If configured for double-click, can now open or create a pattern
Expand Down
5 changes: 2 additions & 3 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-06
2019-04-13 to 2023-10-07

Misc:

- Issue #117
- Issue #118
- Document and test mute groups. Issues:
- performer: cliear_mute_groups(), reset_mute_groups(), and
Expand Down Expand Up @@ -348,7 +347,7 @@ ISSUES:
different settings... Post processing quantize works as expected (i,e,
Ctrl-A then q)

STATUS: Fixed in the portfix branch. An embarrasing misstep!
STATUS: Fixed in the portfix branch. An embarrassing misstep!

To close as fixed (and remove from TODO):

Expand Down
9 changes: 5 additions & 4 deletions data/linux/qseq66.usr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Seq66 0.99.9 user ('usr') configuration file
#
# /home/usr/.config/seq66/qseq66.usr
# Written 2023-09-22 09:01:45
# Written 2023-10-07 09:01:45
#
# 'usr' file. Edit it and place it in ~/.config/seq66. It allows naming each
# MIDI bus/port, channel, and control code.
Expand Down Expand Up @@ -259,12 +259,13 @@ visibility = true
# is indicated when the loop has the 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', 'one-shot',
# and 'one-shot-reset'.
# 'wrap-around', if true, allows recorded notes to wrap around to the
# pattern start.
# and 'one-shot-reset'. 'wrap-around' allows recorded notes to wrap to the
# pattern start. 'escape-pattern' allows the Esc key to close the pattern
# editor if not playing or in paint mode.

[new-pattern-editor]

escape-pattern = false
armed = false
thru = false
record = false
Expand Down
14 changes: 11 additions & 3 deletions 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-09-27
% \update 2023-10-07
% \version $Revision$
% \license $XPC_GPL_LICENSE$
%
Expand Down Expand Up @@ -218,8 +218,8 @@ \subsection{Command Line}
\label{subsec:configuration_command_line}

Command-line options are well-described in the \textsl{Seq66} "man" page.
Here, we will present a brief note about each option, and, where applicable, a
reference to the corresponding configuration file option.
Here, we will present a brief note about each option, and, where applicable,
a reference to the corresponding configuration file option.
Here is the basic command line:

\begin{verbatim}
Expand Down Expand Up @@ -1758,6 +1758,7 @@ \subsubsection{'usr' File / Additional Options}

\begin{verbatim}
[new-pattern-editor]
escape-pattern = false
armed = false
thru = false
record = false
Expand All @@ -1766,6 +1767,13 @@ \subsubsection{'usr' File / Additional Options}
wrap-around = false
\end{verbatim}

The \texttt{escape-pattern} option applies to an open pattern window.
If enabled, the \texttt{Esc} key can close the pattern window if
patterns are not playing and if not in paint mode. If both are true, then
the first \texttt{Esc} stops playing, the second \texttt{Esc} exits
paint mode, and the third \texttt{Esc} closes the window.
The use must enable this option deliberately.

Also included is a flag to allow notes to wrap around, where the Note On
comes near the end of the pattern, but the Note Off appears before the
Note On.
Expand Down
9 changes: 8 additions & 1 deletion 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-09-22
% \update 2023-10-07
% \version $Revision$
% \license $XPC_GPL_LICENSE$
%
Expand Down Expand Up @@ -1417,6 +1417,13 @@ \subsubsection{Menu / Edit / Preferences}
Still not sure what's wrong with \textsl{Seq66} randomization,
but it is only important if randomizing a large number of times.

The second section, not shown, is \textbf{Additional 'usr' Options}.
It contains only one option at present,
\textbf{Escape Can Close Pattern Editor}.
If set (the default is false), then the \texttt{Esc}
key can not only stop playing and exit paint mode, but
can also close the pattern window.

\paragraph{Menu / Edit / Preferences / Session}
\label{paragraph:menu_edit_preferences_session}

Expand Down
16 changes: 14 additions & 2 deletions 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-09-30
* \updates 2023-10-07
* \license GNU GPLv2 or above
*
* This module defines the following categories of "global" variables that
Expand Down Expand Up @@ -939,9 +939,11 @@ class usrsettings final : public basesettings
/**
* [new-pattern-editor]
*
* A new feature, in progress.
* Options for a pattern that is newly-created, plus a new option to let
* the Esc key close a pattern editor window.
*/

bool m_escape_pattern;
bool m_new_pattern_armed;
bool m_new_pattern_thru;
bool m_new_pattern_record;
Expand Down Expand Up @@ -1716,6 +1718,11 @@ class usrsettings final : public basesettings
* New-pattern options
*/

bool escape_pattern () const
{
return m_escape_pattern;
}

bool new_pattern_armed () const
{
return m_new_pattern_armed;
Expand Down Expand Up @@ -1973,6 +1980,11 @@ class usrsettings final : public basesettings
m_session_url = value;
}

void escape_pattern (bool flag)
{
m_escape_pattern = flag;
}

void new_pattern_armed (bool flag)
{
m_new_pattern_armed = flag;
Expand Down
11 changes: 7 additions & 4 deletions 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-09-29
* \updates 2023-10-07
* \license GNU GPLv2 or above
*
* Note that the parse function has some code that is not yet enabled.
Expand Down Expand Up @@ -495,6 +495,8 @@ usrfile::parse ()
usr().session_visibility(flag);

tag = "[new-pattern-editor]";
flag = get_boolean(file, tag, "escape-pattern");
usr().escape_pattern(flag);
flag = get_boolean(file, tag, "armed");
usr().new_pattern_armed(flag);
flag = get_boolean(file, tag, "thru");
Expand Down Expand Up @@ -986,11 +988,12 @@ usrfile::write ()
"# is indicated when the loop has the name 'Untitled' and no events. These\n"
"# values save time during a live recording session. The valid values for\n"
"# record-style are 'merge' (default), 'overwrite', 'expand', 'one-shot', \n"
"# and 'one-shot-reset'.\n"
"# 'wrap-around', if true, allows recorded notes to wrap around to the\n"
"# pattern start.\n"
"# and 'one-shot-reset'. 'wrap-around' allows recorded notes to wrap to the\n"
"# pattern start. 'escape-pattern' allows the Esc key to close the pattern\n"
"# editor if not playing or in paint mode.\n"
"\n[new-pattern-editor]\n\n"
;
write_boolean(file, "escape-pattern", usr().escape_pattern());
write_boolean(file, "armed", usr().new_pattern_armed());
write_boolean(file, "thru", usr().new_pattern_thru());
write_boolean(file, "record", usr().new_pattern_record());
Expand Down
4 changes: 3 additions & 1 deletion libseq66/src/cfg/usrsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-09-23
* \updates 2023-09-30
* \updates 2023-10-07
* \license GNU GPLv2 or above
*
* Note that this module also sets the remaining legacy global variables, so
Expand Down Expand Up @@ -411,6 +411,7 @@ usrsettings::usrsettings () :
m_session_url (),
m_in_nsm_session (false),
m_session_visibility (true),
m_escape_pattern (false),
m_new_pattern_armed (false),
m_new_pattern_thru (false),
m_new_pattern_record (false),
Expand Down Expand Up @@ -510,6 +511,7 @@ usrsettings::set_defaults ()
m_session_url.clear();
m_in_nsm_session = false;
m_session_visibility = true;
m_escape_pattern = false;
m_new_pattern_armed = false;
m_new_pattern_thru = false;
m_new_pattern_record = false;
Expand Down
3 changes: 2 additions & 1 deletion libseq66/src/play/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4095,7 +4095,8 @@ sequence::stream_event (event & ev)
ev.note_velocity(m_rec_vol); /* modify incoming */

/*
* See USE_OLD_CODE below. We need to do this here, not there.
* See USE_OLD_CODE below. We need to do this here, not
* there. Fixes issue #119.
*/

if (alter_recording() && ev.is_note())
Expand Down
Loading

0 comments on commit 98269c2

Please sign in to comment.