Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package qpwgraph for openSUSE:Factory 
checked in at 2023-12-12 19:32:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/qpwgraph (Old)
 and      /work/SRC/openSUSE:Factory/.qpwgraph.new.25432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "qpwgraph"

Tue Dec 12 19:32:33 2023 rev:21 rq:1132665 version:0.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/qpwgraph/qpwgraph.changes        2023-11-09 
21:35:03.764143344 +0100
+++ /work/SRC/openSUSE:Factory/.qpwgraph.new.25432/qpwgraph.changes     
2023-12-12 19:33:04.754340906 +0100
@@ -1,0 +2,14 @@
+Tue Dec  5 19:28:42 UTC 2023 - Alexei Sorokin <sor.ale...@meowr.ru>
+
+- Update to version 0.6.1:
+  * Introduce Help > Enable ALSA MIDI runtime option, now
+    permitting to disable the ALSA MIDI/Sequencer graph conveniency
+    on a whim.
+  * Disconnect all pinned connections when patchbay is deactivated,
+    subject to Patchbay > Auto Disconnect option.
+  * Fix a potential port duplication when recycled under the same
+    node and reusing a previous port id.
+  * Don't unpin connections that are manually disconnected, when
+    patchbay is deactivated and auto-pin is off.
+
+-------------------------------------------------------------------

Old:
----
  qpwgraph-v0.6.0.tar.bz2

New:
----
  qpwgraph-v0.6.1.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ qpwgraph.spec ++++++
--- /var/tmp/diff_new_pack.ypPYBR/_old  2023-12-12 19:33:05.234358616 +0100
+++ /var/tmp/diff_new_pack.ypPYBR/_new  2023-12-12 19:33:05.238358763 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           qpwgraph
-Version:        0.6.0
+Version:        0.6.1
 Release:        0
 Summary:        PipeWire Graph Qt GUI Interface
 License:        GPL-2.0-or-later

++++++ qpwgraph-v0.6.0.tar.bz2 -> qpwgraph-v0.6.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/CMakeLists.txt 
new/qpwgraph-v0.6.1/CMakeLists.txt
--- old/qpwgraph-v0.6.0/CMakeLists.txt  2023-11-08 15:40:10.000000000 +0100
+++ new/qpwgraph-v0.6.1/CMakeLists.txt  2023-12-01 22:20:26.000000000 +0100
@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 3.15)
 
 project(qpwgraph
-  VERSION 0.6.0
+  VERSION 0.6.1
   DESCRIPTION "A PipeWire Graph Qt GUI Interface"
   HOMEPAGE_URL "https://gitlab.freedesktop.org/rncbc/qpwgraph";
   LANGUAGES C CXX)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/ChangeLog 
new/qpwgraph-v0.6.1/ChangeLog
--- old/qpwgraph-v0.6.0/ChangeLog       2023-11-08 15:40:10.000000000 +0100
+++ new/qpwgraph-v0.6.1/ChangeLog       2023-12-01 22:20:26.000000000 +0100
@@ -2,6 +2,18 @@
 --------------------------------------------
 
 
+0.6.1  2023-12-01  An End-of-Autumn'23 Release.
+
+- Introduce Help > Enable ALSA MIDI runtime option, now permitting
+  to disable the ALSA MIDI/Sequencer graph conveniency in a whim.
+- Disconnect all pinned connections when patchbay is deactivated,
+  subject to Patchbay > Auto Disconnect option.
+- Fix a potential port duplication when recycled under the same
+  node and reusing a previous port id.
+- Don't unpin connections that are manually disconnected, when
+  patchbay is deactivated and auto-pin is off.
+
+
 0.6.0  2023-11-08  An Autumn'23 Release.
 
 - Improved Patchbay / Exclusive mode scan enforcement.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/debian/changelog 
new/qpwgraph-v0.6.1/debian/changelog
--- old/qpwgraph-v0.6.0/debian/changelog        2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/debian/changelog        2023-12-01 22:20:26.000000000 
+0100
@@ -1,3 +1,9 @@
+qpwgraph (0.6.1-33.1) unstable; urgency=low
+
+  * An end-of-autumn'23 release.
+
+ -- Rui Nuno Capela <rn...@rncbc.org>  Fri,  1 Dec 2023 22:00:00 +0000
+
 qpwgraph (0.6.0-32.1) unstable; urgency=low
 
   * An autumn'23 release.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/qpwgraph-v0.6.0/docs/qpwgraph_patchbay-user_manual.md 
new/qpwgraph-v0.6.1/docs/qpwgraph_patchbay-user_manual.md
--- old/qpwgraph-v0.6.0/docs/qpwgraph_patchbay-user_manual.md   2023-11-08 
15:40:10.000000000 +0100
+++ new/qpwgraph-v0.6.1/docs/qpwgraph_patchbay-user_manual.md   2023-12-01 
22:20:26.000000000 +0100
@@ -6,7 +6,7 @@
 
 The *Activated* button is simply to activate or not the loaded patchbay. The 
patchbay must be activated in order to access all the other functionalities.
 
-If checked, connections stored in the loaded patchbay will be restored. All 
other connections will stay as they were before the load of the patchbay. If 
unchecked, no connection change at all.
+If checked, connections stored in the loaded patchbay will be restored. All 
other connections will stay as they were before the load and activation of the 
patchbay. If and when unchecked, all previously pinned connections will be 
dropped.
 
 ## *Exclusive* button ![Exclusive](../src/images/itemExclusive.png)
 
@@ -24,8 +24,15 @@
 
 ### *Unpin* button ![Unpin](../src/images/itemUnpin.png)
 
-Used to make the connection temporary. The unpinned connection will disappear 
forever if another patchbay is loaded.
+Used to make the connection temporary. The unpinned connection will not be 
dropped if the current patchbay is deactivated.
 
+### Auto Pin option
+
+If checked, all manual connections will be pinned to the current patchbay and 
persistant when activated.
+
+### Auto Disconnect option
+
+If checked, all pinned connections will be automatically disconnected when the 
current patchbay is deactivated.
 
 ---
 Credits: @Lootre (a.k.a. Thomas Lachat).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/rpm/qpwgraph.spec 
new/qpwgraph-v0.6.1/rpm/qpwgraph.spec
--- old/qpwgraph-v0.6.0/rpm/qpwgraph.spec       2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/rpm/qpwgraph.spec       2023-12-01 22:20:26.000000000 
+0100
@@ -16,8 +16,8 @@
 #
 
 %define name    qpwgraph
-%define version 0.6.0
-%define release 32.1
+%define version 0.6.1
+%define release 33.1
 
 %define _prefix        /usr
 
@@ -133,6 +133,8 @@
 
 
 %changelog
+* Sat Dec  2 2023 Rui Nuno Capela <rn...@rncbc.org> 0.6.1
+- An end-of-autumn'23 release.
 * Wed Nov  8 2023 Rui Nuno Capela <rn...@rncbc.org> 0.6.0
 - An autumn'23 release.
 * Fri Sep  8 2023 Rui Nuno Capela <rn...@rncbc.org> 0.5.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/qpwgraph-v0.6.0/src/appdata/org.rncbc.qpwgraph.metainfo.xml 
new/qpwgraph-v0.6.1/src/appdata/org.rncbc.qpwgraph.metainfo.xml
--- old/qpwgraph-v0.6.0/src/appdata/org.rncbc.qpwgraph.metainfo.xml     
2023-11-08 15:40:10.000000000 +0100
+++ new/qpwgraph-v0.6.1/src/appdata/org.rncbc.qpwgraph.metainfo.xml     
2023-12-01 22:20:26.000000000 +0100
@@ -37,7 +37,7 @@
  <developer_name>rncbc aka. Rui Nuno Capela</developer_name>
  <update_contact>rn...@rncbc.org</update_contact>
  <releases>
-  <release version="0.6.0" date="2023-11-08" urgency="low" />
+  <release version="0.6.1" date="2023-12-01" urgency="low" />
  </releases>
  <content_rating type="oars-1.0"/>
 </component>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_canvas.cpp 
new/qpwgraph-v0.6.1/src/qpwgraph_canvas.cpp
--- old/qpwgraph-v0.6.0/src/qpwgraph_canvas.cpp 2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_canvas.cpp 2023-12-01 22:20:26.000000000 
+0100
@@ -69,8 +69,9 @@
        : QGraphicsView(parent), m_state(DragNone), m_item(nullptr),
                m_connect(nullptr), m_rubberband(nullptr),
                m_zoom(1.0), m_zoomrange(false), m_gesture(false),
-               m_commands(nullptr), m_settings(nullptr), m_patchbay(nullptr),
-               m_patchbay_edit(false), m_patchbay_autopin(true),
+               m_commands(nullptr), m_settings(nullptr),
+               m_patchbay(nullptr), m_patchbay_edit(false),
+               m_patchbay_autopin(true), m_patchbay_autodisconnect(false),
                m_selected_nodes(0), m_repel_overlapping_nodes(false),
                m_edit_item(nullptr), m_editor(nullptr), m_edited(0)
 {
@@ -163,6 +164,19 @@
 }
 
 
+// Patchbay auto-disconnect accessors.
+void qpwgraph_canvas::setPatchbayAutoDisconnect ( bool on )
+{
+       m_patchbay_autodisconnect = on;
+}
+
+
+bool qpwgraph_canvas::isPatchbayAutoDisconnect (void) const
+{
+       return m_patchbay_autodisconnect;
+}
+
+
 // Patchbay edit-mode accessors.
 void qpwgraph_canvas::setPatchbayEdit ( bool on )
 {
@@ -548,7 +562,8 @@
                        connect->setDimmed(true);
        }
 
-       if (m_patchbay && (m_patchbay_autopin || !is_connect))
+       if (m_patchbay && (m_patchbay_autopin
+               || (!is_connect && m_patchbay->isActivated())))
                m_patchbay->connectPorts(port1, port2, is_connect);
 
        if (is_connect)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_canvas.h 
new/qpwgraph-v0.6.1/src/qpwgraph_canvas.h
--- old/qpwgraph-v0.6.0/src/qpwgraph_canvas.h   2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_canvas.h   2023-12-01 22:20:26.000000000 
+0100
@@ -81,6 +81,10 @@
        void setPatchbayAutoPin(bool on);
        bool isPatchbayAutoPin() const;
 
+       // Patchbay auto-disconnect accessors.
+       void setPatchbayAutoDisconnect(bool on);
+       bool isPatchbayAutoDisconnect() const;
+
        // Patchbay edit-mode accessors.
        void setPatchbayEdit(bool on);
        bool isPatchbayEdit() const;
@@ -308,6 +312,7 @@
        qpwgraph_patchbay *m_patchbay;
        bool m_patchbay_edit;
        bool m_patchbay_autopin;
+       bool m_patchbay_autodisconnect;
 
        QList<QGraphicsItem *> m_selected;
        int m_selected_nodes;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_config.cpp 
new/qpwgraph-v0.6.1/src/qpwgraph_config.cpp
--- old/qpwgraph-v0.6.0/src/qpwgraph_config.cpp 2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_config.cpp 2023-12-01 22:20:26.000000000 
+0100
@@ -50,6 +50,7 @@
 static const char *PatchbayActivatedKey = "/Activated";
 static const char *PatchbayExclusiveKey = "/Exclusive";
 static const char *PatchbayAutoPinKey = "/AutoPin";
+static const char *PatchbayAutoDisconnectKey = "/AutoDisconnect";
 static const char *PatchbayRecentFilesKey = "/RecentFiles";
 static const char *PatchbayToolbarKey = "/Toolbar";
 
@@ -58,6 +59,11 @@
 static const char *SystemTrayEnabledKey = "/Enabled";
 #endif
 
+#ifdef CONFIG_ALSA_MIDI
+static const char *AlsaMidiGroup  = "/AlsaMidi";
+static const char *AlsaMidiEnabledKey = "/Enabled";
+#endif
+
 static const char *SessionGroup = "/Session";
 static const char *SessionStartMinimizedKey = "/StartMinimized";
 
@@ -77,7 +83,9 @@
                m_patchbay_activated(false),
                m_patchbay_exclusive(false),
                m_patchbay_autopin(true),
-               m_systray_enabled(true)
+               m_patchbay_autodisconnect(false),
+               m_systray_enabled(true),
+               m_alsaseq_enabled(true)
 {
 }
 
@@ -279,6 +287,17 @@
 }
 
 
+void qpwgraph_config::setPatchbayAutoDisconnect ( bool autodisconnect )
+{
+       m_patchbay_autodisconnect = autodisconnect;
+}
+
+bool qpwgraph_config::isPatchbayAutoDisconnect (void) const
+{
+       return m_patchbay_autodisconnect;
+}
+
+
 void qpwgraph_config::patchbayRecentFiles ( const QString& path )
 {
        // Remove from list if already there (avoid duplicates)
@@ -313,6 +332,17 @@
 }
 
 
+void qpwgraph_config::setAlsaMidiEnabled ( bool enabled )
+{
+       m_alsaseq_enabled = enabled;
+}
+
+bool qpwgraph_config::isAlsaMidiEnabled (void) const
+{
+       return m_alsaseq_enabled;
+}
+
+
 void qpwgraph_config::setSessionStartMinimized ( bool start_minimized )
 {
        m_settings->beginGroup(SessionGroup);
@@ -345,6 +375,12 @@
        m_settings->endGroup();
 #endif
 
+#ifdef CONFIG_ALSA_MIDI
+       m_settings->beginGroup(AlsaMidiGroup);
+       m_alsaseq_enabled = m_settings->value(AlsaMidiEnabledKey, 
true).toBool();
+       m_settings->endGroup();
+#endif
+
        m_settings->beginGroup(PatchbayGroup);
        m_patchbay_toolbar = m_settings->value(PatchbayToolbarKey, 
true).toBool();
        m_patchbay_dir = m_settings->value(PatchbayDirKey).toString();
@@ -352,6 +388,7 @@
        m_patchbay_activated = m_settings->value(PatchbayActivatedKey, 
false).toBool();
        m_patchbay_exclusive = m_settings->value(PatchbayExclusiveKey, 
false).toBool();
        m_patchbay_autopin = m_settings->value(PatchbayAutoPinKey, 
true).toBool();
+       m_patchbay_autodisconnect = 
m_settings->value(PatchbayAutoDisconnectKey, false).toBool();
        m_patchbay_recentfiles = 
m_settings->value(PatchbayRecentFilesKey).toStringList();
        m_settings->endGroup();
 
@@ -408,6 +445,12 @@
        m_settings->endGroup();
 #endif
 
+#ifdef CONFIG_ALSA_MIDI
+       m_settings->beginGroup(AlsaMidiGroup);
+       m_settings->setValue(AlsaMidiEnabledKey, m_alsaseq_enabled);
+       m_settings->endGroup();
+#endif
+
        m_settings->beginGroup(PatchbayGroup);
        m_settings->setValue(PatchbayToolbarKey, m_patchbay_toolbar);
        m_settings->setValue(PatchbayDirKey, m_patchbay_dir);
@@ -415,6 +458,7 @@
        m_settings->setValue(PatchbayActivatedKey, m_patchbay_activated);
        m_settings->setValue(PatchbayExclusiveKey, m_patchbay_exclusive);
        m_settings->setValue(PatchbayAutoPinKey, m_patchbay_autopin);
+       m_settings->setValue(PatchbayAutoDisconnectKey, 
m_patchbay_autodisconnect);
        m_settings->setValue(PatchbayRecentFilesKey, m_patchbay_recentfiles);
        m_settings->endGroup();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_config.h 
new/qpwgraph-v0.6.1/src/qpwgraph_config.h
--- old/qpwgraph-v0.6.0/src/qpwgraph_config.h   2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_config.h   2023-12-01 22:20:26.000000000 
+0100
@@ -95,12 +95,18 @@
        void setPatchbayAutoPin(bool autopin);
        bool isPatchbayAutoPin() const;
 
+       void setPatchbayAutoDisconnect(bool autodisconnect);
+       bool isPatchbayAutoDisconnect() const;
+
        void patchbayRecentFiles(const QString& path);
        const QStringList& patchbayRecentFiles() const;
 
        void setSystemTrayEnabled(bool enabled);
        bool isSystemTrayEnabled() const;
 
+       void setAlsaMidiEnabled(bool enabled);
+       bool isAlsaMidiEnabled() const;
+
        void setSessionStartMinimized(bool start_minimized);
        bool isSessionStartMinimized() const;
 
@@ -131,9 +137,11 @@
        bool        m_patchbay_activated;
        bool        m_patchbay_exclusive;
        bool        m_patchbay_autopin;
+       bool        m_patchbay_autodisconnect;
        QStringList m_patchbay_recentfiles;
 
        bool        m_systray_enabled;
+       bool        m_alsaseq_enabled;
 };
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_form.cpp 
new/qpwgraph-v0.6.1/src/qpwgraph_form.cpp
--- old/qpwgraph-v0.6.0/src/qpwgraph_form.cpp   2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_form.cpp   2023-12-01 22:20:26.000000000 
+0100
@@ -107,11 +107,7 @@
        m_ui.graphCanvas->setSettings(m_config->settings());
 
        m_pipewire = new qpwgraph_pipewire(m_ui.graphCanvas);
-#ifdef CONFIG_ALSA_MIDI
-       m_alsamidi = new qpwgraph_alsamidi(m_ui.graphCanvas);
-#else
        m_alsamidi = nullptr;
-#endif
 
        m_pipewire_changed = 0;
        m_alsamidi_changed = 0;
@@ -202,13 +198,7 @@
                        SIGNAL(changed()),
                        SLOT(pipewire_changed()));
        }
-#ifdef CONFIG_ALSA_MIDI
-       if (m_alsamidi) {
-               QObject::connect(m_alsamidi,
-                       SIGNAL(changed()),
-                       SLOT(alsamidi_changed()));
-       }
-#endif
+
        QObject::connect(m_ui.graphCanvas,
                SIGNAL(added(qpwgraph_node *)),
                SLOT(added(qpwgraph_node *)));
@@ -287,6 +277,9 @@
        QObject::connect(m_ui.patchbayAutoPinAction,
                SIGNAL(toggled(bool)),
                SLOT(patchbayAutoPin(bool)));
+       QObject::connect(m_ui.patchbayAutoDisconnectAction,
+               SIGNAL(toggled(bool)),
+               SLOT(patchbayAutoDisconnect(bool)));
 
        QObject::connect(m_ui.patchbayEditAction,
                SIGNAL(toggled(bool)),
@@ -435,13 +428,25 @@
 #ifdef CONFIG_SYSTEM_TRAY
        m_ui.helpMenu->insertAction(
                m_ui.helpAboutAction, m_ui.helpSystemTrayAction);
+#ifndef CONFIG_ALSA_MIDI
        m_ui.helpMenu->insertSeparator(
                m_ui.helpAboutAction);
+#endif
        QObject::connect(m_ui.helpSystemTrayAction,
                SIGNAL(triggered(bool)),
                SLOT(helpSystemTray(bool)));
 #endif
 
+#ifdef CONFIG_ALSA_MIDI
+       m_ui.helpMenu->insertAction(
+               m_ui.helpAboutAction, m_ui.helpAlsaMidiAction);
+       m_ui.helpMenu->insertSeparator(
+               m_ui.helpAboutAction);
+       QObject::connect(m_ui.helpAlsaMidiAction,
+                SIGNAL(triggered(bool)),
+                SLOT(helpAlsaMidi(bool)));
+#endif
+
        QObject::connect(m_ui.helpAboutAction,
                SIGNAL(triggered(bool)),
                SLOT(helpAbout()));
@@ -637,8 +642,7 @@
        qpwgraph_patchbay *patchbay = m_ui.graphCanvas->patchbay();
        if (patchbay) {
                patchbay->setActivated(on);
-               if (on)
-                       patchbay->scan();
+               patchbay->scan();
        }
 
        stabilize();
@@ -650,7 +654,7 @@
        qpwgraph_patchbay *patchbay = m_ui.graphCanvas->patchbay();
        if (patchbay) {
                patchbay->setExclusive(on);
-               if (on)
+               if (patchbay->isActivated())
                        patchbay->scan();
        }
 
@@ -690,6 +694,14 @@
 }
 
 
+void qpwgraph_form::patchbayAutoDisconnect ( bool on )
+{
+       m_ui.graphCanvas->setPatchbayAutoDisconnect(on);
+
+       stabilize();
+}
+
+
 // Main menu slots.
 void qpwgraph_form::viewMenubar ( bool on )
 {
@@ -854,6 +866,33 @@
 }
 
 
+void qpwgraph_form::helpAlsaMidi ( bool on )
+{
+#ifdef CONFIG_ALSA_MIDI
+       if (on && m_alsamidi == nullptr) {
+               m_alsamidi = new qpwgraph_alsamidi(m_ui.graphCanvas);
+               QObject::connect(
+                       m_alsamidi, SIGNAL(changed()),
+                       this, SLOT(alsamidi_changed()));
+               ++m_alsamidi_changed;
+       }
+       else
+       if (!on && m_alsamidi) {
+               m_alsamidi->clearItems();
+               QObject::disconnect(
+                       m_alsamidi, SIGNAL(changed()),
+                       this, SLOT(alsamidi_changed()));
+               delete m_alsamidi;
+               m_alsamidi = nullptr;
+       }
+#else
+       (void) on;
+#endif
+
+       stabilize();
+}
+
+
 void qpwgraph_form::helpAbout (void)
 {
        static const QString title = PROJECT_NAME;
@@ -1119,7 +1158,7 @@
 
        if (nchanged > 0) {
                qpwgraph_patchbay *patchbay = m_ui.graphCanvas->patchbay();
-               if (patchbay)
+               if (patchbay && patchbay->isActivated())
                        patchbay->scan();
                stabilize();
        }
@@ -1195,6 +1234,10 @@
        m_zoom_slider->setValue(zoom_value);
        m_zoom_spinbox->blockSignals(is_spinbox_blocked);
        m_zoom_slider->blockSignals(is_slider_blocked);
+
+#ifdef CONFIG_ALSA_MIDI
+       m_ui.viewColorsAlsaMidiAction->setEnabled(m_alsamidi != nullptr);
+#endif
 }
 
 
@@ -1242,7 +1285,9 @@
 
        m_ui.graphCanvas->patchbayEdit();
 
-       patchbay->scan();
+       if (patchbay->isActivated())
+               patchbay->scan();
+
        return true;
 }
 
@@ -1556,12 +1601,15 @@
                const bool is_activated = m_config->isPatchbayActivated();
                const bool is_exclusive = m_config->isPatchbayExclusive();
                const bool is_autopin = m_config->isPatchbayAutoPin();
+               const bool is_autodisconnect = 
m_config->isPatchbayAutoDisconnect();
                m_ui.patchbayActivatedAction->setChecked(is_activated);
                m_ui.patchbayExclusiveAction->setChecked(is_exclusive);
                m_ui.patchbayAutoPinAction->setChecked(is_autopin);
+               
m_ui.patchbayAutoDisconnectAction->setChecked(is_autodisconnect);
                patchbay->setActivated(is_activated);
                patchbay->setExclusive(is_exclusive);
                m_ui.graphCanvas->setPatchbayAutoPin(is_autopin);
+               m_ui.graphCanvas->setPatchbayAutoDisconnect(is_autodisconnect);
        }
 
        m_ui.viewMenubarAction->setChecked(m_config->isMenubar());
@@ -1625,6 +1673,13 @@
        m_ui.helpSystemTrayAction->setChecked(is_systray_enabled);
        helpSystemTray(is_systray_enabled);
 #endif
+
+#ifdef CONFIG_ALSA_MIDI
+       const bool is_alsa_midi
+               = m_config->isAlsaMidiEnabled();
+       m_ui.helpAlsaMidiAction->setChecked(is_alsa_midi);
+       helpAlsaMidi(is_alsa_midi);
+#endif
 }
 
 
@@ -1646,6 +1701,7 @@
        m_config->setMenubar(m_ui.MenuBar->isVisible());
 
        m_config->setPatchbayAutoPin(m_ui.patchbayAutoPinAction->isChecked());
+       
m_config->setPatchbayAutoDisconnect(m_ui.patchbayAutoDisconnectAction->isChecked());
        
m_config->setPatchbayExclusive(m_ui.patchbayExclusiveAction->isChecked());
        
m_config->setPatchbayActivated(m_ui.patchbayActivatedAction->isChecked());
        m_config->setPatchbayPath(m_patchbay_path);
@@ -1655,6 +1711,10 @@
        m_config->setSystemTrayEnabled(m_ui.helpSystemTrayAction->isChecked());
 #endif
 
+#ifdef CONFIG_ALSA_MIDI
+       m_config->setAlsaMidiEnabled(m_ui.helpAlsaMidiAction->isChecked());
+#endif
+
        m_config->saveState(this);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_form.h 
new/qpwgraph-v0.6.1/src/qpwgraph_form.h
--- old/qpwgraph-v0.6.0/src/qpwgraph_form.h     2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_form.h     2023-12-01 22:20:26.000000000 
+0100
@@ -114,6 +114,7 @@
        void patchbayUnpin();
 
        void patchbayAutoPin(bool on);
+       void patchbayAutoDisconnect(bool on);
 
        // Main menu slots.
        void viewMenubar(bool on);
@@ -138,6 +139,7 @@
        void viewConnectThroughNodes(bool on);
 
        void helpSystemTray(bool on);
+       void helpAlsaMidi(bool on);
 
        void helpAbout();
        void helpAboutQt();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_form.ui 
new/qpwgraph-v0.6.1/src/qpwgraph_form.ui
--- old/qpwgraph-v0.6.0/src/qpwgraph_form.ui    2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_form.ui    2023-12-01 22:20:26.000000000 
+0100
@@ -88,6 +88,7 @@
     <addaction name="separator"/>
     <addaction name="separator"/>
     <addaction name="patchbayAutoPinAction"/>
+    <addaction name="patchbayAutoDisconnectAction"/>
    </widget>
    <widget class="QMenu" name="editMenu">
     <property name="title">
@@ -481,6 +482,23 @@
     <string/>
    </property>
   </action>
+  <action name="patchbayAutoDisconnectAction">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Auto &amp;Disconnect</string>
+   </property>
+   <property name="toolTip">
+    <string>Auto disconnect on deactivate</string>
+   </property>
+   <property name="statusTip">
+    <string>Auto disconnect on deactivate current patchbay</string>
+   </property>
+   <property name="shortcut">
+    <string/>
+   </property>
+  </action>
   <action name="graphQuitAction">
    <property name="text">
     <string>&amp;Quit</string>
@@ -1045,6 +1063,26 @@
    </property>
    <property name="shortcut">
     <string/>
+   </property>
+  </action>
+  <action name="helpAlsaMidiAction">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>&amp;Enable ALSA MIDI</string>
+   </property>
+   <property name="iconText">
+    <string>ALSA MIDI</string>
+   </property>
+   <property name="toolTip">
+    <string>ALSA MIDI</string>
+   </property>
+   <property name="statusTip">
+    <string>Enable ALSA MIDI</string>
+   </property>
+   <property name="shortcut">
+    <string/>
    </property>
   </action>
   <action name="helpAboutAction">
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_patchbay.cpp 
new/qpwgraph-v0.6.1/src/qpwgraph_patchbay.cpp
--- old/qpwgraph-v0.6.0/src/qpwgraph_patchbay.cpp       2023-11-08 
15:40:10.000000000 +0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_patchbay.cpp       2023-12-01 
22:20:26.000000000 +0100
@@ -226,9 +226,6 @@
 // Execute and apply rules to graph.
 bool qpwgraph_patchbay::scan (void)
 {
-       if (!m_activated)
-               return false;
-
        if (m_canvas == nullptr)
                return false;
 
@@ -282,7 +279,7 @@
                                                item->port_type);
                                if (port2 == nullptr)
                                        continue;
-                               if (m_exclusive) {
+                               if (m_activated && m_exclusive) {
                                        foreach (qpwgraph_connect *connect12, 
port1->connects()) {
                                                qpwgraph_port *port12 = 
connect12->port2();
                                                if (port12 == nullptr)
@@ -323,8 +320,20 @@
                                                }
                                        }
                                }
-                               if (!port1->findConnect(port2))
+                               qpwgraph_connect *connect12 = 
port1->findConnect(port2);
+                               if (connect12 == nullptr && m_activated)
                                        m_canvas->emitConnected(port1, port2);
+                               else
+                               if (!m_activated && 
m_canvas->isPatchbayAutoDisconnect()) {
+                                       const Item item12(
+                                               node1->nodeType(),
+                                               port1->portType(),
+                                               node1->nodeName(),
+                                               port1->portName(),
+                                               node2->nodeName(),
+                                               port2->portName());
+                                       disconnects.insert(item12, connect12);
+                               }
                        }
                }
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_pipewire.cpp 
new/qpwgraph-v0.6.1/src/qpwgraph_pipewire.cpp
--- old/qpwgraph-v0.6.0/src/qpwgraph_pipewire.cpp       2023-11-08 
15:40:10.000000000 +0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_pipewire.cpp       2023-12-01 
22:20:26.000000000 +0100
@@ -931,7 +931,7 @@
 
 // PipeWire node:port finder and creator if not existing.
 bool qpwgraph_pipewire::findNodePort (
-       uint32_t node_id, uint32_t port_id,  qpwgraph_item::Mode port_mode,
+       uint node_id, uint port_id,  qpwgraph_item::Mode port_mode,
        qpwgraph_node **node, qpwgraph_port **port, bool add_new )
 {
        Node *n = findNode(node_id);
@@ -964,7 +964,7 @@
                }
        }
 
-       if (*node && m_recycled.value(qpwgraph_node::NodeIdKey(*node), nullptr))
+       if (*node && m_recycled_nodes.value(qpwgraph_node::NodeIdKey(*node), 
nullptr))
                return false;
 
        if (*node && n->node_changed) {
@@ -975,6 +975,9 @@
        if (*node)
                *port = (*node)->findPort(port_id, port_mode, port_type);
 
+       if (*port && m_recycled_ports.value(qpwgraph_port::PortIdKey(*port), 
nullptr))
+               return false;
+
        if (add_new && *node == nullptr) {
                QString node_name = n->node_name;
                if ((p->port_flags & Port::Physical) == Port::None) {
@@ -1089,7 +1092,8 @@
        //
        qpwgraph_sect::resetItems(qpwgraph_pipewire::nodeType());
 
-       m_recycled.clear();
+       m_recycled_nodes.clear();
+       m_recycled_ports.clear();
 }
 
 
@@ -1107,7 +1111,8 @@
        //
        qpwgraph_sect::clearItems(qpwgraph_pipewire::nodeType());
 
-       m_recycled.clear();
+       m_recycled_nodes.clear();
+       m_recycled_ports.clear();
 }
 
 
@@ -1290,6 +1295,8 @@
        uint port_type,
        uint port_flags )
 {
+       recyclePort(port_id, node_id, port_mode, port_type);
+
        Node *node = findNode(node_id);
        if (node == nullptr)
                return nullptr;
@@ -1373,26 +1380,38 @@
 }
 
 
-// Special node recycler...
-void qpwgraph_pipewire::recycleNode (
-       uint node_id, qpwgraph_item::Mode node_mode )
+// Special node finder...
+qpwgraph_node *qpwgraph_pipewire::findNode (
+       uint node_id, qpwgraph_item::Mode node_mode ) const
 {
        const uint node_type = qpwgraph_pipewire::nodeType();
        qpwgraph_node *node = qpwgraph_sect::findNode(node_id, node_mode, 
node_type);
        if (node == nullptr)
                node = qpwgraph_sect::findNode(node_id, qpwgraph_item::Duplex, 
node_type);
+
+       return node;
+}
+
+
+// Special node recycler...
+void qpwgraph_pipewire::recycleNode (
+       uint node_id, qpwgraph_item::Mode node_mode )
+{
+       qpwgraph_node *node = findNode(node_id, node_mode);
+       if (node)
+               m_recycled_nodes.insert(qpwgraph_node::NodeIdKey(node), node);
+}
+
+
+// Special port recycler...
+void qpwgraph_pipewire::recyclePort (
+       uint port_id, uint node_id, qpwgraph_item::Mode port_mode, uint 
port_type )
+{
+       qpwgraph_node *node = findNode(node_id, port_mode);
        if (node) {
-               m_recycled.insert(qpwgraph_node::NodeIdKey(node), node);
-       #if 0
-               for (qpwgraph_port *port : node->ports()) {
-                       if (port->portMode() & qpwgraph_item::Output) {
-                               for (qpwgraph_connect *connect : 
port->connects()) {
-                                       connect->setMarked(false);
-                                       connect->disconnect();
-                               }
-                       }
-               }
-       #endif
+               qpwgraph_port *port = node->findPort(port_id, port_mode, 
port_type);
+               if (port)
+                       m_recycled_ports.insert(qpwgraph_port::PortIdKey(port), 
port);
        }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/qpwgraph-v0.6.0/src/qpwgraph_pipewire.h 
new/qpwgraph-v0.6.1/src/qpwgraph_pipewire.h
--- old/qpwgraph-v0.6.0/src/qpwgraph_pipewire.h 2023-11-08 15:40:10.000000000 
+0100
+++ new/qpwgraph-v0.6.1/src/qpwgraph_pipewire.h 2023-12-01 22:20:26.000000000 
+0100
@@ -135,11 +135,17 @@
 
        // PipeWire node:port finder and creator if not existing.
        bool findNodePort(
-               uint32_t node_id, uint32_t port_id, qpwgraph_item::Mode 
port_mode,
+               uint node_id, uint port_id, qpwgraph_item::Mode port_mode,
                qpwgraph_node **node, qpwgraph_port **port, bool add_new);
 
-       // Special node recycler...
-       void recycleNode(uint node_id, qpwgraph_item::Mode node_mode);
+       // Special node finder...
+       qpwgraph_node *findNode(uint node_id, qpwgraph_item::Mode node_mode) 
const;
+
+       // Special node/port recycler...
+       void recycleNode(
+               uint node_id, qpwgraph_item::Mode node_mode);
+       void recyclePort(
+               uint port_id, uint node_id, qpwgraph_item::Mode port_mode, uint 
port_type);
 
 private:
 
@@ -150,7 +156,8 @@
        QHash<uint, Object *> m_objectids;
        QList<Object *> m_objects;
 
-       qpwgraph_node::NodeIds m_recycled;
+       qpwgraph_node::NodeIds m_recycled_nodes;
+       qpwgraph_port::PortIds m_recycled_ports;
 
        // Callback sanity mutex.
        QMutex m_mutex1;

Reply via email to