Use labs() for long instead of abs()
[ardour.git] / gtk2_ardour / transport_masters_dialog.h
index 1d20dfee157486af15bae5249c20b1047d2e8b97..695bfc9a9f3e3565350514be600a427d364f1205 100644 (file)
@@ -1,21 +1,20 @@
 /*
-    Copyright (C) 2018 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2018-2019 Paul Davis <paul@linuxaudiosystems.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #ifndef __ardour_gtk_transport_masters_dialog_h__
 #define __ardour_gtk_transport_masters_dialog_h__
@@ -101,6 +100,7 @@ class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
                void update (ARDOUR::Session*, ARDOUR::samplepos_t);
 
                Row (TransportMastersWidget& parent);
+               ~Row ();
 
                struct PortColumns : public Gtk::TreeModel::ColumnRecord {
                        PortColumns() {
@@ -126,8 +126,6 @@ class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
                void prop_change (PBD::PropertyChange);
                void remove_clicked ();
 
-               static gboolean _idle_remove (gpointer arg);
-
                bool name_press (GdkEventButton*);
                void name_edited (std::string, int);
 
@@ -145,10 +143,16 @@ class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
        PBD::ScopedConnection current_connection;
        PBD::ScopedConnection add_connection;
        PBD::ScopedConnection remove_connection;
+       PBD::ScopedConnection engine_running_connection;
 
        void rebuild ();
+       void clear ();
        void current_changed (boost::shared_ptr<ARDOUR::TransportMaster> old_master, boost::shared_ptr<ARDOUR::TransportMaster> new_master);
        void add_master ();
+       void update_usability ();
+
+  public:
+       bool idle_remove (Row*);
 };
 
 class TransportMastersWindow : public ArdourWindow