Skip to content

Commit

Permalink
Fixed port-map restart and added Esc of paint mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Sep 4, 2023
1 parent 6503d62 commit 4a747b4
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 70 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# README for Seq66 0.99.9 2023-09-02
# README for Seq66 0.99.9 2023-09-04

__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 @@ -82,12 +82,15 @@ Windows, and using a conventional source tarball.
## Recent Changes

* Version 0.99.9:
* Added HTML help files to data/share/doc/info.
* Adding more seqroll keystokes (and HTML help).
* Fixed bug: port-mapping Remap and Restart did not work due to
timing.
* Adding more seqroll keystokes (and HTML help). Enabled Esc to
exit paint mode if not playing.
* Added live-note mapping (needs testing!), refactoring set-record
code.
* Implemented automation for BBT/HMS toggling, FF/Rewind, Undo/Redo,
Play-set Copy/Paste.
* Added HTML help files to data/share/doc/info.
* Version 0.99.8:
* Issue #112: A new pattern now displays in the MIDI controller.
* Issue #114: Adding display of shortcut keys to tool tips.
Expand Down
8 changes: 4 additions & 4 deletions Seq66qt5/seq66qt5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,20 @@ main (int argc, char * argv [])
exit_status = result ? EXIT_SUCCESS : EXIT_FAILURE ;
(void) sm.close_session(msg, result);
if (! result)
break;
break; /* stop infinite loop */

if (seq66::session_close())
{
seq66::session_message("Closing session");
break;
break; /* stop infinite loop */
}
if (seq66::session_restart())
{
seq66::session_message("Reloading session");
seq66::signal_end_restart(); /* stop infinite loop */
seq66::signal_end_restart();
}
else
break;
break; /* stop infinite loop */
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
TO DO for Seq66 0.99.9
Chris Ahlstrom
2019-04-13 to 2023-09-03
2019-04-13 to 2023-09-04

Misc:

- Open t.midi, start playing, stop, then add more notes. They are
way longer than the snap value!
- Fix and test new record/quantize handling, and verify that
MIDI automation of these displays in the pattern editor.
- Add automation for these and add some to nanomap.ctrl:
- Song Pointer
- Transpose Song
- Make sure we have record-toggle automation!
- Make sure metronome buttons etc. still work.
- There are many "TODOs" in the automation slots.
- Document better all of the keys on the seqroll, etc. Add a
context/focus-sensitive Help / Keyboard menu
- Document better all of the keys on the perfroll, etc.
- Make the performer get/put_settings() functions robust.
- Randomizing seems to have a negative bias (after many repeats).
- Add a feature to start playback when the first note comes
Expand Down
10 changes: 4 additions & 6 deletions data/samples/nanomap.ctrl
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,16 @@ keyboard-layout = qwerty
68 "0xe7" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Note-map
69 "0xe8" [ 0 0x90 12 1 127 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # BBT/HMS
70 "0xe9" [ 0 0x90 14 1 127 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # LR Loop
71 "0xea" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Undo Record
72 "0xeb" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Redo Record
71 "0xea" [ 0 0x90 16 1 127 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Undo
72 "0xeb" [ 0 0x90 17 1 127 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Redo
73 "0xec" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Transpose Song
74 "0xed" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Copy Set
75 "0xee" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Paste Set
76 "0xef" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Toggle Tracks
77 "0x8c" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Sets Normal
78 "0x8d" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Sets Auto
79 "0x8e" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Sets Additive
80 "0x8f" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # All Sets
77 "0xf0" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Sets Normal
78 "0xf1" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Sets Auto
79 "0xf2" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # Sets Additive
80 "0xf3" [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] [ 0 0x00 0 0 0 ] # All Sets

[midi-control-out-settings]

Expand Down
2 changes: 1 addition & 1 deletion data/share/doc/info/common_keys.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</tr>
<tr>
<td>Exit painting mode</td>
<td>x</rd>
<td>x (or Esc if not playing)</rd>
</tr>
</table>
</body>
Expand Down
4 changes: 3 additions & 1 deletion doc/latex/tex/pattern_editor.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-08-27
% \update 2023-09-04
% \version $Revision$
% \license $XPC_GPL_LICENSE$
%
Expand Down Expand Up @@ -59,8 +59,10 @@ \section{Pattern Editor}
\index{mouse!left-click-drag}
left-click-drag to add multiple notes as the mouse moves.
\index{keys!x}
\index{keys!Esc}
Press or release the right mouse button, or press
\texttt{x} to "eXit" or "eXscape" from paint mode.
\texttt{Esc} also exits paint mode if the pattern is not playing.
Another option is to press the "finger" button to toggle between note-entry
and note-selection.
Third, notes are drawn only with the length selected by the "notes" button
Expand Down
4 changes: 2 additions & 2 deletions doc/latex/tex/song_editor.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-04-22
% \update 2023-09-04
% \version $Revision$
% \license $XPC_GPL_LICENSE$
%
Expand Down Expand Up @@ -539,7 +539,7 @@ \subsubsection{Song Editor / Song Roll / Layout}
make sure that the performance editor piano roll has the
keyboard focus by \textsl{left-clicking} in it, then press the
\texttt{p} key to enter the paint mode, and
\texttt{x} escape it.
\texttt{x} (or \texttt{Esc} if not playing) to escape it.
See \sectionref{subsubsec:song_editor_song_roll_keystrokes}.

\index{zoom}
Expand Down
4 changes: 2 additions & 2 deletions libseq66/include/os/daemonize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* \file daemonize.hpp
* \author Chris Ahlstrom
* \date 2005-07-03 to 2007-08-21 (from xpc-suite project)
* \updates 2023-05-08
* \updates 2023-09-04
* \license GNU GPLv2 or above
*
* Daemonization of POSIX C Wrapper (PSXC) library
Expand Down Expand Up @@ -133,7 +133,7 @@ extern std::string get_parent_process_name ();
* determine what to do.
*/

extern void session_setup ();
extern bool session_setup (bool earlyexit = false);
extern bool session_close ();
extern bool session_save ();
extern bool session_restart ();
Expand Down
4 changes: 2 additions & 2 deletions libseq66/src/ctrl/keycontainer.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-18
* \updates 2023-08-12
* \updates 2023-09-03
* \license GNU GPLv2 or above
*
*/
Expand Down Expand Up @@ -229,7 +229,7 @@ keycontainer::add_automation (const keycontrol & op)
else
{
std::cerr
<< "Duplicate mute slot #" << std::setw(3) << keyslot
<< "Duplicate automation slot #" << std::setw(3) << keyslot
<< " : '" << keyname << "'" << std::endl
;
}
Expand Down
64 changes: 40 additions & 24 deletions libseq66/src/os/daemonize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* \library seq66 application (from PSXC library)
* \author Chris Ahlstrom
* \date 2005-07-03 to 2007-08-21 (pre-Sequencer24/64)
* \updates 2023-05-27
* \updates 2023-09-04
* \license GNU GPLv2 or above
*
* Daemonization module of the POSIX C Wrapper (PSXC) library
Expand All @@ -31,18 +31,16 @@
* daemon. There are large differences between POSIX daemons and Win32
* services. Thus, this module is mostly Linux/POSIX-specific.
*
* ca 2023-03-22:
* Updating daemonize(). Instead of calling exit on error, it now
* returns the error code; the return value is now int instead of
* uint32_t, and uint32_t is now mode_t to reflect the return type of
* umask(2). Note that digging reveals that mode_t is an unsigned 32-bit
* type anyway.
*
* Updating daemonize(). Instead of calling exit on error, it now
* returns the error code; the return value is now int instead of
* uint32_t, and uint32_t is now mode_t to reflect the return type of
* umask(2). Note that digging reveals that mode_t is an unsigned 32-bit
* type anyway.
*
* We also calls fork() again to insure that the application is not
* the session leader, and implement the "flags" parameters; both steps
* are described in Michael Kerrisk's book, "The Linux Programming
* Interface", 2010.
* We also calls fork() again to insure that the application is not
* the session leader, and implement the "flags" parameters; both steps
* are described in Michael Kerrisk's book, "The Linux Programming
* Interface", 2010.
*
* Questions:
*
Expand Down Expand Up @@ -634,18 +632,31 @@ session_handler (int sig)

/**
* Sets up the application to intercept SIGINT, SIGTERM, and SIGUSR1.
*
* \param earlyexit
* It turns out that the test for the need to remap ports occurs
* (in Seq66} before this function is called. We don't want to continue
* to run in this case.
*
* \return
* Returns true if the application can continue.
*/

void
session_setup ()
bool
session_setup (bool earlyexit)
{
struct sigaction action;
memset(&action, 0, sizeof action);
action.sa_handler = session_handler;
sg_needs_close = sg_needs_save = sg_restart = false;
sigaction(SIGINT, &action, NULL); /* SIGINT is 2 */
sigaction(SIGTERM, &action, NULL); /* SIGTERM is 15 */
sigaction(SIGUSR1, &action, NULL); /* SIGUSR1 is 10 */
bool result = ! earlyexit;
if (result)
{
struct sigaction action;
memset(&action, 0, sizeof action);
action.sa_handler = session_handler;
sg_needs_close = sg_needs_save = sg_restart = false;
sigaction(SIGINT, &action, NULL); /* SIGINT is 2 */
sigaction(SIGTERM, &action, NULL); /* SIGTERM is 15 */
sigaction(SIGUSR1, &action, NULL); /* SIGUSR1 is 10 */
}
return result;
}

/**
Expand Down Expand Up @@ -755,10 +766,15 @@ get_parent_process_name ()
* --------------------------------------------------------------------------
*/

void
session_setup ()
bool
session_setup (bool earlyexit)
{
sg_needs_close = sg_needs_save = sg_restart = false;
bool result = ! earlyexit;
if (result)
{
sg_needs_close = sg_needs_save = sg_restart = false;
}
return result;
}

bool
Expand Down
4 changes: 2 additions & 2 deletions libseq66/src/play/performer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3780,8 +3780,8 @@ performer::move_tick (midipulse ticks, bool dontreset)
curtick += ticks;
if (curtick < 0)
curtick = 0;
// else if (curtick > m_max_tick)
// curtick = m_max_tick;
else if (curtick > m_max_extent)
curtick = m_max_extent; /* but can change!! */
}
else
curtick = get_left_tick(); /* get_star_tick()? */
Expand Down
6 changes: 3 additions & 3 deletions libseq66/src/sessions/smanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ namespace seq66
static std::string s_port_error_msg
{
"Check MIDI Clock & MIDI Input tabs for unavailable/missing ports. "
"Make sure the loaded MIDI tune is not using such ports. "
"Use the remap/restart button if not, or change the global output port "
"Make sure the MIDI tune is not using such ports. "
"Click 'Remap and restart' or change the global output ports "
"for the tune."
};

static std::string s_port_update_msg
{
"There are more real ports than mapped ports. "
"Use the remap/restart button to recreate the maps or edit "
"Click 'Remap and restart' to recreate the maps or edit "
"them in the 'rc' file."
};

Expand Down
8 changes: 1 addition & 7 deletions seq_qt5/src/qperfeditframe64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,7 @@ qperfeditframe64::qperfeditframe64

/*
* The width of the qperfroll is based on its sizeHint(), which is based
* on the maximum trigger in all of the sequences in all sets. At the
* moment, we're not sure how to deal with this, so the grow button is
* hidden.
*
* ui->btnGrow->hide();
* qt_set_icon(right_xpm, ui->btnGrow);
* ui->btnGrow->setEnabled(false);
* on the maximum trigger in all of the sequences in all sets.
*/

connect(ui->btnGrow, SIGNAL(clicked(bool)), this, SLOT(grow()));
Expand Down
7 changes: 6 additions & 1 deletion seq_qt5/src/qperfroll.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-01-01
* \updates 2023-02-27
* \updates 2023-09-04
* \license GNU GPLv2 or above
*
* This class represents the central piano-roll user-interface area of the
Expand Down Expand Up @@ -662,6 +662,11 @@ qperfroll::keyPressEvent (QKeyEvent * event)
handled = true;
start_playing();
}
else if (event->key() == Qt::Key_Escape)
{
handled = true;
set_adding(false);
}
else if (event->key() == Qt::Key_P)
{
handled = true;
Expand Down
8 changes: 5 additions & 3 deletions seq_qt5/src/qseditoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-01-01
* \updates 2023-08-25
* \updates 2023-09-04
* \license GNU GPLv2 or above
*
* This version is located in Edit / Preferences.
Expand Down Expand Up @@ -2180,8 +2180,10 @@ qseditoptions::cancel ()
void
qseditoptions::apply ()
{
m_backup_rc = rc();
m_backup_usr = usr();
/*
* backup() useless at this point, 'cause we're outa here!
*/

state_unchanged();
signal_for_restart(); /* warnprint("Session reload request"); */
}
Expand Down
6 changes: 5 additions & 1 deletion seq_qt5/src/qseqeditframe64.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-06-15
* \updates 2023-09-02
* \updates 2023-09-04
* \license GNU GPLv2 or above
*
* The data pane is the drawing-area below the seqedit's event area, and
Expand Down Expand Up @@ -1185,6 +1185,10 @@ qseqeditframe64::keyPressEvent (QKeyEvent * event)
{
start_playing();
}
else if (key == Qt::Key_Escape)
{
m_seqroll->set_adding(false);
}
else if (isctrl)
{
bool isshift = bool(event->modifiers() & Qt::ShiftModifier);
Expand Down
Loading

0 comments on commit 4a747b4

Please sign in to comment.