diff --git a/Seq66qt5/seq66qt5.cpp b/Seq66qt5/seq66qt5.cpp index 06f7c3cc..2cb02204 100644 --- a/Seq66qt5/seq66qt5.cpp +++ b/Seq66qt5/seq66qt5.cpp @@ -103,11 +103,7 @@ main (int argc, char * argv []) #endif QApplication app(argc, argv); /* main application object */ -#if defined USE_NEW_CODE - seq66::smanager::app_info(argv[0], true); -#else - seq66::set_app_path(argv[0]); /* log for future usage */ -#endif + seq66::smanager::app_info(argv[0]); /* instead of set_app_path() */ #if defined USE_RING_BUFFER_TEST && defined SEQ66_PLATFORM_DEBUG if (! seq66::run_ring_test()) diff --git a/libseq66/include/seq66_features.hpp b/libseq66/include/seq66_features.hpp index 54a644e8..cde59a68 100644 --- a/libseq66/include/seq66_features.hpp +++ b/libseq66/include/seq66_features.hpp @@ -28,7 +28,7 @@ * \library seq66 application * \author Chris Ahlstrom * \date 2018-11-24 - * \updates 2023-11-05 + * \updates 2023-11-06 * \license GNU GPLv2 or above * * Provides some useful functions for displaying information about the @@ -52,7 +52,7 @@ * *undefined*. */ -#define SEQ66_IMMEDIATE_LOG_FILE +#undef SEQ66_IMMEDIATE_LOG_FILE /* * This is the main namespace of Seq66. Do not attempt to diff --git a/libseq66/include/sessions/clinsmanager.hpp b/libseq66/include/sessions/clinsmanager.hpp index 4f2cdd18..db5748a8 100644 --- a/libseq66/include/sessions/clinsmanager.hpp +++ b/libseq66/include/sessions/clinsmanager.hpp @@ -28,7 +28,7 @@ * \library clinsmanager application * \author Chris Ahlstrom * \date 2020-08-31 - * \updates 2023-03-28 + * \updates 2024-11-06 * \license GNU GPLv2 or above * * Provides a base class that can be used to manage the command-line version @@ -102,7 +102,9 @@ class clinsmanager : public smanager public: clinsmanager (const std::string & caps = c_cli_nsm_capabilities); - virtual ~clinsmanager (); + clinsmanager (const clinsmanager &) = delete; + clinsmanager & operator = (const clinsmanager &) = delete; + virtual ~clinsmanager () = default; #if defined SEQ66_NSM_SUPPORT nsmclient * nsm_client () diff --git a/libseq66/include/sessions/smanager.hpp b/libseq66/include/sessions/smanager.hpp index 8bfac0fe..71ab45de 100644 --- a/libseq66/include/sessions/smanager.hpp +++ b/libseq66/include/sessions/smanager.hpp @@ -28,7 +28,7 @@ * \library seq66 application * \author Chris Ahlstrom * \date 2020-05-30 - * \updates 2023-11-05 + * \updates 2024-11-06 * \license GNU GPLv2 or above * * This class provides a process for starting, running, restarting, and @@ -135,7 +135,7 @@ class smanager smanager (const std::string & caps = ""); smanager (const smanager &) = delete; - smanager & operator =(const smanager &) = delete; + smanager & operator = (const smanager &) = delete; virtual ~smanager (); static void app_info (const std::string arg0, bool is_cli = false); diff --git a/libseq66/src/sessions/clinsmanager.cpp b/libseq66/src/sessions/clinsmanager.cpp index 6b98095a..5eadbff0 100644 --- a/libseq66/src/sessions/clinsmanager.cpp +++ b/libseq66/src/sessions/clinsmanager.cpp @@ -25,7 +25,7 @@ * \library clinsmanager application * \author Chris Ahlstrom * \date 2020-08-31 - * \updates 2023-08-29 + * \updates 2024-11-06 * \license GNU GPLv2 or above * * This object also works if there is no session manager in the build. It @@ -105,11 +105,6 @@ clinsmanager::clinsmanager (const std::string & caps) : get_and_set_build_issue(); } -clinsmanager::~clinsmanager () -{ - // no code -} - /** * Detects if the 'usr' file defines usage of NSM and a valid URL for the * nsmd daemon, or, if not, is there an NSM URL in the environment. Also, if diff --git a/libseq66/src/sessions/smanager.cpp b/libseq66/src/sessions/smanager.cpp index 13d2bf5f..206d8f34 100644 --- a/libseq66/src/sessions/smanager.cpp +++ b/libseq66/src/sessions/smanager.cpp @@ -166,6 +166,8 @@ void smanager::app_info (const std::string arg0, bool is_cli) { set_app_name(SEQ66_APP_NAME); /* set at ./configure time */ + set_app_path(arg0); /* log for future usage */ + set_arg_0(arg0); /* issue #131 */ if (is_cli) { /* @@ -174,7 +176,6 @@ smanager::app_info (const std::string arg0, bool is_cli) * seq66::usr().app_is_headless(true); // conflated with cli */ - seq66::set_app_path(arg0); /* log for future usage */ set_app_cli(true); /* the default is false */ set_app_type(SEQ66_APP_TYPE); /* e.g. "qt5" vs "cli" */ set_client_name("seq66cli"); /* change from configure */ @@ -284,6 +285,8 @@ smanager::main_settings (int argc, char * argv []) { int optionindex = (-1); bool sessionmodified = false; + if (rc().alt_session()) // issue #131 + { /* * Check for a session, either defined by the environment variable @@ -291,6 +294,7 @@ smanager::main_settings (int argc, char * argv []) * latter can override the first. */ +#if 0 // commented out for issue #131 if (! rc().alt_session()) { std::string sesstag = cmdlineopts::env_session_tag(); @@ -299,6 +303,7 @@ smanager::main_settings (int argc, char * argv []) } if (rc().alt_session()) { +#endif /* * The name 'sessions.rc' is a bit more accurate. */ @@ -328,6 +333,9 @@ smanager::main_settings (int argc, char * argv []) return false; } } +#if 0 // comment out for issue #131 + } +#endif } /* diff --git a/libsessions/src/nsm/nsmbase.cpp b/libsessions/src/nsm/nsmbase.cpp index 22e85376..5c7f003e 100644 --- a/libsessions/src/nsm/nsmbase.cpp +++ b/libsessions/src/nsm/nsmbase.cpp @@ -25,7 +25,7 @@ * \library seq66 application * \author Chris Ahlstrom * \date 2020-03-07 - * \updates 2024-11-05 + * \updates 2024-11-06 * \license GNU GPLv2 or above * * nsmbase is an Non Session Manager (NSM) OSC client helper. The NSM API @@ -127,26 +127,38 @@ static lo_timetag s_lo_timetag = { 0, 1 }; #include "nsm/nsmbase.hpp" /* seq66::nsmbase class */ #include "nsm/nsmmessagesex.hpp" /* seq66::nsm new message functions */ +#define NSM_API_VERSION_MAJOR 1 +#define NSM_API_VERSION_MINOR 0 + +/* + * Do not document a namespace; it breaks Doxygen. + */ + +namespace seq66 +{ + /* * Define in seq66_features.hpp only for trouble-shooting, especially under a * session manager. */ #if defined SEQ66_IMMEDIATE_LOG_FILE -#define FORCE_VERBOSE true -#else -#define FORCE_VERBOSE false -#endif -#define NSM_API_VERSION_MAJOR 1 -#define NSM_API_VERSION_MINOR 0 +bool +verbose_send () +{ + return true; +} -/* - * Do not document a namespace; it breaks Doxygen. - */ +#else -namespace seq66 +bool +verbose_send () { + return rc().verbose(); +} + +#endif /** * A handler for the /reply message. @@ -1016,11 +1028,19 @@ nsmbase::send_from ) { int result = (-1); - if (s3.empty()) + if (s1.empty()) + { + result = lo_send_from + ( + m_lo_address, m_lo_server, LO_TT_IMMEDIATE_2, + message.c_str(), pattern.c_str() + ); + } + else { if (s2.empty()) { - result = lo_send_from /* e.g. "/nsm/client/is_clean" "" */ + result = lo_send_from ( m_lo_address, m_lo_server, LO_TT_IMMEDIATE_2, message.c_str(), pattern.c_str(), s1.c_str() @@ -1028,12 +1048,13 @@ nsmbase::send_from } else { - if (s1.empty()) + if (s3.empty()) { result = lo_send_from ( m_lo_address, m_lo_server, LO_TT_IMMEDIATE_2, - message.c_str(), pattern.c_str() + message.c_str(), pattern.c_str(), + s1.c_str(), s2.c_str() ); } else @@ -1042,23 +1063,14 @@ nsmbase::send_from ( m_lo_address, m_lo_server, LO_TT_IMMEDIATE_2, message.c_str(), pattern.c_str(), - s1.c_str(), s2.c_str() + s1.c_str(), s2.c_str(), s3.c_str() ); } } } - else - { - result = lo_send_from - ( - m_lo_address, m_lo_server, LO_TT_IMMEDIATE_2, - message.c_str(), pattern.c_str(), - s1.c_str(), s2.c_str(), s3.c_str() - ); - } if (result != (-1)) { - if (rc().verbose() || FORCE_VERBOSE) + if (verbose_send()) { std::string msg = "OSC message sent " + message + pattern; session_message(msg); @@ -1264,7 +1276,7 @@ outgoing_msg const std::string & data ) { - if (rc().verbose() || FORCE_VERBOSE) + if (verbose_send()) { std::string text = msgsnprintf ( diff --git a/seq_qt5/include/qt5nsmanager.hpp b/seq_qt5/include/qt5nsmanager.hpp index 882da279..cd1142b2 100644 --- a/seq_qt5/include/qt5nsmanager.hpp +++ b/seq_qt5/include/qt5nsmanager.hpp @@ -28,7 +28,7 @@ * \library qt5nsmanager application * \author Chris Ahlstrom * \date 2020-03-15 - * \updates 2023-05-31 + * \updates 2024-11-06 * \license GNU GPLv2 or above * * This is an attempt to change from the hoary old (or, as H.P. Lovecraft @@ -70,12 +70,15 @@ class qt5nsmanager : public QObject, public clinsmanager public: + qt5nsmanager () = delete; qt5nsmanager ( QApplication & app, QObject * parent = nullptr, const std::string & caps = c_qt5_nsm_capabilities ); + qt5nsmanager (const qt5nsmanager &) = delete; + qt5nsmanager & operator = (const qt5nsmanager &) = delete; virtual ~qt5nsmanager (); virtual bool close_session (std::string & msg, bool ok = true) override; diff --git a/seq_qt5/src/qt5nsmanager.cpp b/seq_qt5/src/qt5nsmanager.cpp index 49b6f8db..7f36004e 100644 --- a/seq_qt5/src/qt5nsmanager.cpp +++ b/seq_qt5/src/qt5nsmanager.cpp @@ -25,7 +25,7 @@ * \library qt5nsmanager application * \author Chris Ahlstrom * \date 2020-03-15 - * \updates 2023-11-05 + * \updates 2023-11-06 * \license GNU GPLv2 or above * * Duty now for the future! Join the Smart Patrol! @@ -210,7 +210,9 @@ qt5nsmanager::create_window () clid += rc().jack_session(); /* UUID alone */ } } +#if 0 // see version 0.99.7 else /* 2023-11-05 */ +#endif { if (rc().alt_session()) { @@ -219,13 +221,11 @@ qt5nsmanager::create_window () tag += "]"; session_manager_name(tag); } -#if 0 // this seems wwrong, test it!!! - if (have_uuid) + if (have_uuid) /* wrong ??? */ { clid += "/"; clid += rc().jack_session(); /* UUID alone */ } -#endif } } m_window->session_manager(manager_name()); @@ -305,6 +305,7 @@ qt5nsmanager::run () if (session_setup(restart)) /* need an early exit? */ { int exit_status = m_application.exec(); /* run main window loop */ + status_message("Early exit flagged by session setup"); return exit_status == EXIT_SUCCESS; } else