From 8da1af2be4f99d39e79321a290bf6ad3f1e69b61 Mon Sep 17 00:00:00 2001 From: Chris Ahlstrom Date: Tue, 19 Dec 2023 07:58:29 -0500 Subject: [PATCH] Added better detection of FreeBSD for issue #124. --- INSTALL | 14 ++++- configure | 2 +- configure.ac | 8 ++- configure.help | 10 ++-- data/midi/colours.midi | Bin 7400 -> 7400 bytes include/config.h.in | 2 +- libseq66/include/seq66_platform_macros.h | 36 +++++++----- libseq66/src/play/performer.cpp | 70 +++++++++++++---------- libseq66/src/seq66_features.cpp | 13 +++-- seq_qt5/src/qslivegrid.cpp | 6 +- 10 files changed, 101 insertions(+), 60 deletions(-) diff --git a/INSTALL b/INSTALL index 61c0febf1..4853a4242 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,6 @@ INSTALL for Seq66 v. 0.99.12 and above Chris Ahlstrom -2015-09-10 to 2023-12-15 +2015-09-10 to 2023-12-18 Getting Seq66 requires building the code or going to "sequencer64-packages/seq66" on GitHub to get an installation package. The @@ -105,6 +105,18 @@ Clang Compiler: One might need to make symbolic links to the desired versions of these compiler, for example clang-16 and clang++-16. +FreeBSD: + + Although one user reported that "./configure" worked fine, on a FreeBSD + virtual machine, we first had to install autoconf, automake, pkgconf, and + gmake. Also had to edit the generated libtool script to change + the version from 2.4.7 to 2.4.6 to fool the build. The command needed to + configure was the following, including the command to make the code. + + $ ./configure --with-alsa-prefix=/usr/local/lib + --with-alsa-inc-prefix=/usr/local/include + $ sh -c 'gmake >make.log 2>&1' + Qt and Command-Line Merged Build: Per package-manager request, one can build and install both qseq66 and diff --git a/configure b/configure index e82057680..179b3b681 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 0.96. +# From configure.ac Revision: 0.99. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Seq66 0.99.12. # diff --git a/configure.ac b/configure.ac index 1729b1e2a..86fe19536 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl \file configure.ac dnl \library Seq66 dnl \author Chris Ahlstrom dnl \date 2018-11-09 -dnl \update 2023-12-16 +dnl \update 2023-12-18 dnl \version $Revision$ dnl \license $XPC_SUITE_GPL_LICENSE$ dnl @@ -20,7 +20,7 @@ dnl dnl --------------------------------------------------------------------------- AC_PREREQ([2.69]) -AC_REVISION($Revision: 0.96$) +AC_REVISION($Revision: 0.99$) AC_INIT([Seq66],[0.99.12],[ahlstromcj@gmail.com]) AC_CONFIG_AUX_DIR([aux-files]) AC_CONFIG_MACRO_DIR([m4]) @@ -122,6 +122,8 @@ ac_build_os="'$(uname -srm)'" dnl Get the value of /etc/issue.net and remove new lines. Note that dnl the CLIENT_NAME macro is always "seq66" and is used as part of dnl the installation sub-directories. +dnl +dnl Is there a way to do this for FreeBSD??? For now see seq66_features.cpp. AC_DEFINE_UNQUOTED(APP_BUILD_OS, ["$ac_build_os"], "OS/kernel where build was done") AC_DEFINE_UNQUOTED( @@ -532,7 +534,7 @@ dnl automatically for us. AH_TOP( -#define VERSION_DATE_SHORT "2023-12-16" +#define VERSION_DATE_SHORT "2023-12-18" #define API_VERSION "0.99" #define VERSION "0.99.12" diff --git a/configure.help b/configure.help index 91f5adb3c..f1bb44926 100644 --- a/configure.help +++ b/configure.help @@ -1,4 +1,4 @@ -`configure' configures Seq66 0.98.10 to adapt to many kinds of systems. +`configure' configures Seq66 0.99.12 to adapt to many kinds of systems. Usage: ./configure [OPTION]... [VAR=VALUE]... @@ -88,10 +88,11 @@ Optional Features: --enable-port-refresh Enable JACK port refresh support --disable-nsm Disable NSM support --enable-both Enable Qt and command-line builds + --enable-alsatopology Force to use the Alsa topology library --disable-alsatest Do not try to compile and run a test Alsa program --disable-rtmidi Disable rtmidi MIDI engine - --disable-qt Disable Qt5 user-interface --enable-cli Enable rtmidi command-line build + --disable-qt Disable Qt5 user-interface --enable-portmidi Enable portmidi build) --enable-coverage=(no/yes) Turn on a test-coverage build (default=no) --enable-profile=(no/yes/gprof/prof) Turn on profiling builds (default=no, yes=gprof) @@ -111,7 +112,8 @@ Optional Packages: --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) - --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) + --with-alsa-inc-prefix=PFX + Prefix where include libraries are (optional) --with-x use the X Window System Some influential environment variables: @@ -124,10 +126,10 @@ Some influential environment variables: you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags + CPP C preprocessor CXXCPP C++ preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. - CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path diff --git a/data/midi/colours.midi b/data/midi/colours.midi index 09b7652986eb2ff2493b4c8c34dacec65ce608a8..8922d1182b5221984d558019a0cdd274c62dc6a2 100644 GIT binary patch delta 209 zcmW;8xedZF7=Y3IfC)F@3P;kqqez`APDDFX?!JFU(Sb)k>#z3E&r#JLN|N2Pr zjz1}U5OgE7V>A=g3e^--HkLfh(9O{<&@54}P^~d#yUZWeM6_g2 + * Copyright (C) 2013-2023 Chris Ahlstrom * * We need a uniform way to specify OS and compiler features without * littering the code with macros from disparate compilers. Put all @@ -51,6 +51,7 @@ * - Platform macros (in the absense of Windows, Linux macros): * - SEQ66_PLATFORM_WINDOWS * - SEQ66_PLATFORM_LINUX + * - SEQ66_PLATFORM_FREEBSD * - SEQ66_PLATFORM_MACOSX * - SEQ66_PLATFORM_UNIX * - Architecture size macros: @@ -99,8 +100,10 @@ * conformance, many defined it to 1. Ancient news! */ +#undef SEQ66_MING_OR_WINDOWS #undef SEQ66_PLATFORM_WINDOWS #undef SEQ66_PLATFORM_LINUX +#undef SEQ66_PLATFORM_FREEBSD #undef SEQ66_PLATFORM_MACOSX #undef SEQ66_PLATFORM_UNIX #undef SEQ66_PLATFORM_32_BIT @@ -108,7 +111,6 @@ #undef SEQ66_PLATFORM_DEBUG #undef SEQ66_PLATFORM_RELEASE #undef SEQ66_PLATFORM_MSVC -#undef SEQ66_MING_OR_WINDOWS #undef SEQ66_PLATFORM_GNU #undef SEQ66_PLATFORM_XSI #undef SEQ66_PLATFORM_MINGW @@ -138,10 +140,18 @@ #endif #endif +/** + * FreeBSD macros. + */ + +#if defined __FreeBSD__ +#define SEQ66_PLATFORM_FREEBSD +#define SEQ66_PLATFORM_UNIX +#endif + /** * Provides a "Linux" macro, in case the environment doesn't provide it. - * This macro is defined if not already defined and XXXXXX is - * encountered. + * This macro is defined if not already defined. */ #if defined Linux /* defined by nar-maven-plugin */ @@ -154,15 +164,7 @@ #endif #if defined SEQ66_PLATFORM_LINUX - -#if ! defined POSIX -#define POSIX /* defined for legacy code purposes */ -#endif - #define SEQ66_PLATFORM_UNIX -#define SEQ66_PLATFORM_POSIX_API -#define SEQ66_PLATFORM_PTHREADS - #endif /* SEQ66_PLATFORM_LINUX */ /** @@ -184,6 +186,14 @@ #define SEQ66_PLATFORM_UNIX #endif +#if defined SEQ66_PLATFORM_UNIX +#define SEQ66_PLATFORM_POSIX_API +#define SEQ66_PLATFORM_PTHREADS +#if ! defined POSIX +#define POSIX /* defined for legacy code purposes */ +#endif +#endif + /** * Provides macros that mean 32-bit, and only 32-bit Windows. For * example, in Windows, _WIN32 is defined for both 32- and 64-bit diff --git a/libseq66/src/play/performer.cpp b/libseq66/src/play/performer.cpp index 99ec31bcb..d2b95838c 100644 --- a/libseq66/src/play/performer.cpp +++ b/libseq66/src/play/performer.cpp @@ -24,7 +24,7 @@ * \library seq66 application * \author Chris Ahlstrom and others * \date 2018-11-12 - * \updates 2023-12-10 + * \updates 2023-12-18 * \license GNU GPLv2 or above * * Also read the comments in the Seq64 version of this module, perform. @@ -6686,9 +6686,9 @@ performer::set_keep_queue (bool activate) { automation::action a = activate ? automation::action::on : automation::action::off; - - // (void) set_ctrl_status(a, automation::ctrlstatus::keep_queue); - +#if defined SEQ66_PLATFORM_DEBUG + printf("set_keep_queue(%s)\n", activate ? "on" : "off"); +#endif (void) set_ctrl_status(a, automation::ctrlstatus::queue); } @@ -7086,9 +7086,7 @@ performer::sequence_playing_toggle (seq::number seqno) } /** - * Needs some work! Using the grid-mode for solo, a weird bug. Works when - * paused here in the debugger, but not in real time. - * + * Needs some work! Using the grid-mode for solo. * This mode can only be turned off by selecting another grid-mode. */ @@ -7102,30 +7100,28 @@ performer::replace_for_solo (seq::number seqno, bool queued) automation::ctrlstatus cs = automation::ctrlstatus::replace; if (queued) { - cs = automation::ctrlstatus::queue | automation::ctrlstatus::replace; + cs = automation::ctrlstatus::queue | + automation::ctrlstatus::replace; } - + if (seqno == m_solo_seqno) /* user toggle of slot */ { - if (seqno == m_solo_seqno) /* user toggle of slot */ - { - (void) set_ctrl_status /* restores snapshot */ - ( - automation::action::off, cs - ); - m_solo_seqno = seq::unassigned(); /* clear_snapshot() */ - } - else - { - (void) set_ctrl_status /* saves snapshot */ - ( - automation::action::on, cs - ); - if (s->muted()) - s->toggle_playing(get_tick(), resume_note_ons()); + (void) set_ctrl_status /* restores snapshot */ + ( + automation::action::off, cs + ); + m_solo_seqno = seq::unassigned(); /* clear_snapshot() */ + } + else + { + (void) set_ctrl_status /* saves snapshot */ + ( + automation::action::on, cs + ); + if (s->muted()) + s->toggle_playing(get_tick(), resume_note_ons()); - off_sequences(seqno); /* off all but seqno */ - m_solo_seqno = seqno; - } + off_sequences(seqno); /* off all but seqno */ + m_solo_seqno = seqno; } notify_trigger_change(seq::all(), change::no); announce_sequence(s, set_mapper().seq_to_offset(*s)); @@ -8023,9 +8019,9 @@ performer::loop_control else if (gm == gridmode::remove) result = remove_sequence(seqno); else if (gm == gridmode::thru) - result = set_thru(seqno, false, true); /* true = toggle */ + result = set_thru(seqno, false, true); /* true=toggle */ else if (gm == gridmode::solo) - result = replace_for_solo(seqno); + result = replace_for_solo(seqno, true); /* 2023-12-17 */ else if (gm == gridmode::cut) result = cut_sequence(seqno); else if (gm == gridmode::double_length) @@ -10080,11 +10076,25 @@ performer::set_grid_mode (gridmode gm) { if (gm < gridmode::max) { +#if defined SOLO_KEEP_QUEUE + gridmode oldmode = usr().grid_mode(); +#endif usr().grid_mode(gm); if (gm != gridmode::record) { usr().record_mode(alteration::none); usr().grid_record_style(recordstyle::merge); +#if defined SOLO_KEEP_QUEUE + if (gm == gridmode::solo) /* ca 2023-12-18 */ + { + set_keep_queue(true); + } + else if (oldmode == gridmode::solo) + { + set_keep_queue(false); + } +#else +#endif } notify_automation_change(automation::slot::grid_loop); } diff --git a/libseq66/src/seq66_features.cpp b/libseq66/src/seq66_features.cpp index a58e008b1..790a41b93 100644 --- a/libseq66/src/seq66_features.cpp +++ b/libseq66/src/seq66_features.cpp @@ -25,7 +25,7 @@ * \library seq66 application * \author Chris Ahlstrom * \date 2017-03-12 - * \updates 2023-12-06 + * \updates 2023-12-18 * \license GNU GPLv2 or above * * The first part of this file defines a couple of global structure @@ -59,19 +59,24 @@ namespace seq66 */ #if defined SEQ66_PLATFORM_WINDOWS -static std::string s_app_build_os = "Windows 10"; /* FIXME */ +static std::string s_app_build_os = "Windows 10"; /* FIXME */ static std::string s_app_build_issue = "Microsoft Windows"; #endif #if defined SEQ66_PLATFORM_MACOSX -static std::string s_app_build_os = "MacOSX"; /* FIXME */ +static std::string s_app_build_os = "MacOSX"; /* FIXME */ static std::string s_app_build_issue = "Apple MacOSX"; #endif -#if defined SEQ66_PLATFORM_UNIX +#if defined SEQ66_PLATFORM_UNIX /* Linux? */ static std::string s_app_build_os = SEQ66_APP_BUILD_OS; +#if defined SEQ66_PLATFORM_FREEBSD +static std::string s_app_build_issue = "FreeBSD"; /* FIXME */ +#else static std::string s_app_build_issue = SEQ66_APP_BUILD_ISSUE; #endif +#endif + static std::string s_pane_focus; static std::string s_alsa_version; diff --git a/seq_qt5/src/qslivegrid.cpp b/seq_qt5/src/qslivegrid.cpp index 8e3174645..a30462b12 100644 --- a/seq_qt5/src/qslivegrid.cpp +++ b/seq_qt5/src/qslivegrid.cpp @@ -303,9 +303,9 @@ qslivegrid::set_grid_mode () * Populate the combo box from grid_loop, grid_record, and, as implemented * more automation::slot::grid_xxxxx values up to grid_double. * - * ca 2023-09-30 - * Added a new grid mode, grid_mutes, which is in proper order in the gridmode - * enumeration, but implemented by an automation slot replacing reserved_46. + * Added a new grid mode, grid_mutes, which is in proper order in the + * gridmode enumeration, but implemented by an automation slot replacing + * reserved_46. */ void