fix a bad transition in the transportFSM.
[ardour.git] / libs / ardour / midi_clock_slave.cc
index a6d0af2c1f8c2e1c5e147dc71a364e320aa7fb0a..cf2c84c03450bb988016ba553d2750eb54b215ef 100644 (file)
@@ -1,22 +1,26 @@
 /*
-    Copyright (C) 2008 Paul Davis
-    Author: Hans Baier
-
-    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) 2008-2013 Hans Baier <hansfbaier@googlemail.com>
+ * Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
+ * Copyright (C) 2009-2019 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2012-2013 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2013-2018 John Emmas <john@creativepost.co.uk>
+ * Copyright (C) 2015-2016 Nick Mainsbridge <mainsbridge@gmail.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.
+ */
 
 #include <cmath>
 #include <errno.h>
@@ -54,9 +58,6 @@ MIDIClock_TransportMaster::MIDIClock_TransportMaster (std::string const & name,
        , _running (false)
        , _bpm (0)
 {
-       if ((_port = create_midi_port (string_compose ("%1 in", name))) == 0) {
-               throw failed_constructor();
-       }
 }
 
 MIDIClock_TransportMaster::~MIDIClock_TransportMaster()
@@ -71,6 +72,14 @@ MIDIClock_TransportMaster::init ()
        current.reset ();
 }
 
+void
+MIDIClock_TransportMaster::create_port ()
+{
+       if ((_port = create_midi_port (string_compose ("%1 in", _name))) == 0) {
+               throw failed_constructor();
+       }
+}
+
 void
 MIDIClock_TransportMaster::set_session (Session *session)
 {
@@ -298,7 +307,7 @@ MIDIClock_TransportMaster::reset (bool with_position)
        if (with_position) {
                current.update (_session->transport_sample(), 0, 0);
        } else {
-               current.update (0, 0, 0);
+               current.reset ();
        }
 
        _running = false;