Skip to content

Commit

Permalink
Fixed another bug in port-map restart.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Sep 4, 2023
1 parent 4a747b4 commit 734018f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
7 changes: 6 additions & 1 deletion libseq66/include/play/performer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-11-12
* \updates 2023-09-03
* \updates 2023-09-04
* \license GNU GPLv2 or above
*
* The main player! Coordinates sets, patterns, mutes, playlists, you name
Expand Down Expand Up @@ -2698,6 +2698,11 @@ class performer
return m_port_map_error;
}

void clear_port_map_error () const
{
m_port_map_error = false; /* mutable */
}

void store_io_maps_and_restart () const;
bool store_io_maps ();
void clear_io_maps ();
Expand Down
14 changes: 6 additions & 8 deletions libseq66/src/play/performer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* \library seq66 application
* \author Chris Ahlstrom and others
* \date 2018-11-12
* \updates 2023-09-03
* \updates 2023-09-04
* \license GNU GPLv2 or above
*
* Also read the comments in the Seq64 version of this module, perform.
Expand Down Expand Up @@ -1000,9 +1000,7 @@ performer::store_io_maps_and_restart () const
performer * ncperf = const_cast<performer *>(this);
bool ok = ncperf->store_io_maps();
if (ok)
{
signal_for_restart();
}
}

bussbyte
Expand Down Expand Up @@ -1108,8 +1106,8 @@ performer::is_input_system_port (bussbyte bus) const
bool
performer::new_ports_available () const
{
bool result = not_nullptr(master_bus());
if (result)
bool result = false;
if (not_nullptr(master_bus()))
{
const mastermidibus * mbus = master_bus();
bool new_outputs = false;
Expand All @@ -1129,7 +1127,7 @@ performer::new_ports_available () const
int realbuses = mbus->get_num_in_buses();
new_inputs = mappedbuses < realbuses;
}
result = new_outputs || new_inputs;
m_port_map_error = result = new_outputs || new_inputs;
}
return result;
}
Expand Down Expand Up @@ -3337,9 +3335,9 @@ performer::launch (int ppqn)
std::string msg =
"Some ports now missing. "
"Remap if that is fine. "
"OK preserves thise map. "
"OK preserves this map. "
"Exit to edit the 'rc' file directly. "
"Suppress this message in Preferences/Display."
"Suppress this message in Preferences / Display."
;

m_port_map_error = true; /* mutable boolean */
Expand Down
10 changes: 6 additions & 4 deletions seq_qt5/src/qt5nsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ qt5nsmanager::close_session (std::string & msg, bool ok)
bool
qt5nsmanager::run ()
{
bool restart = perf()->port_map_error() || perf()->new_ports_available();
bool restart = perf()->port_map_error(); // || perf()->new_ports_available();
if (session_setup(restart)) /* need an early exit? */
{
int exit_status = m_application.exec(); /* run main window loop */
Expand Down Expand Up @@ -339,10 +339,10 @@ qt5nsmanager::show_message
else
{
std::string text = tag + ": " + msg;
bool prompt_for_restart =
perf()->port_map_error() || perf()->new_ports_available();
bool prompt = perf()->port_map_error() ||
perf()->new_ports_available();

bool yes = m_window->show_error_box_ex(text, prompt_for_restart);
bool yes = m_window->show_error_box_ex(text, prompt);
if (yes)
{
/*
Expand All @@ -353,6 +353,8 @@ qt5nsmanager::show_message

perf()->store_io_maps_and_restart();
}
else
perf()->clear_port_map_error();
}
}
}
Expand Down

0 comments on commit 734018f

Please sign in to comment.