Ardour  9.0-pre0-582-g084a23a80d
automation_watch.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2017-2019 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include <memory>
23 #include <set>
24 
25 #include <sigc++/signal.h>
26 
27 #include "pbd/pthread_utils.h"
28 #include "pbd/signals.h"
29 
30 #include "ardour/session_handle.h"
31 #include "ardour/types.h"
32 
33 namespace ARDOUR {
34 
35 class AutomationControl;
36 
37 class LIBARDOUR_API AutomationWatch : public sigc::trackable, public ARDOUR::SessionHandlePtr
38 {
39 public:
41 
42  void add_automation_watch (std::shared_ptr<ARDOUR::AutomationControl>);
43  void remove_automation_watch (std::shared_ptr<ARDOUR::AutomationControl>);
46 
47  gint timer ();
48 
49 private:
50  typedef std::set<std::shared_ptr<ARDOUR::AutomationControl> > AutomationWatches;
51  typedef std::map<std::shared_ptr<ARDOUR::AutomationControl>, PBD::ScopedConnection> AutomationConnection;
52 
55 
62  Glib::Threads::Mutex automation_watch_lock;
64 
66  void remove_weak_automation_watch (std::weak_ptr<ARDOUR::AutomationControl>);
67  void thread ();
68 };
69 
70 } /* namespace */
71 
void transport_stop_automation_watches(ARDOUR::samplepos_t)
AutomationWatches automation_watches
AutomationConnection automation_connections
std::set< std::shared_ptr< ARDOUR::AutomationControl > > AutomationWatches
void remove_weak_automation_watch(std::weak_ptr< ARDOUR::AutomationControl >)
void add_automation_watch(std::shared_ptr< ARDOUR::AutomationControl >)
std::map< std::shared_ptr< ARDOUR::AutomationControl >, PBD::ScopedConnection > AutomationConnection
PBD::ScopedConnection transport_connection
void set_session(ARDOUR::Session *)
static AutomationWatch * _instance
void remove_automation_watch(std::shared_ptr< ARDOUR::AutomationControl >)
Glib::Threads::Mutex automation_watch_lock
static AutomationWatch & instance()
#define LIBARDOUR_API
Temporal::samplepos_t samplepos_t