Ardour  9.0-pre0-582-g084a23a80d
automation_controller.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2014 David Robillard <d@drobilla.net>
3  * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #pragma once
23 
24 #ifdef YES
25 #undef YES
26 #endif
27 #ifdef NO
28 #undef NO
29 #endif
30 
31 #include <memory>
32 
33 #include <gtkmm/alignment.h>
34 
35 #include "pbd/signals.h"
37 
38 #include "widgets/barcontroller.h"
39 
40 namespace ARDOUR {
41  class Session;
42  class AutomationList;
43  class AutomationControl;
44 }
45 
46 namespace Gtk {
47  class Adjustment;
48  class Widget;
49 }
50 
52 public:
53  AutomationBarController(std::shared_ptr<ARDOUR::AutomationControl> ac,
54  Gtk::Adjustment* adj);
56 private:
57  std::string get_label (double&);
58  std::shared_ptr<ARDOUR::AutomationControl> _controllable;
59 };
60 
63 public:
64  static std::shared_ptr<AutomationController> create (
65  const Evoral::Parameter& param,
66  const ARDOUR::ParameterDescriptor& desc,
67  std::shared_ptr<ARDOUR::AutomationControl> ac,
68  bool use_knob = false);
69 
71 
72  std::shared_ptr<ARDOUR::AutomationControl> controllable() { return _controllable; }
73 
75 
77  Gtk::Widget* widget() { return _widget; }
78 
82 
83  void stop_updating ();
84 
85 private:
86  AutomationController (std::shared_ptr<ARDOUR::AutomationControl> ac,
87  Gtk::Adjustment* adj,
88  bool use_knob);
89 
90  void start_touch(int);
91  void end_touch(int);
94 
96  void set_ratio(double ratio);
97  void set_freq_beats(double beats);
99 
101  std::shared_ptr<ARDOUR::AutomationControl> _controllable;
103  sigc::connection _screen_update_connection;
106  bool _grabbed;
107 };
108 
109 
std::string get_label(double &)
AutomationBarController(std::shared_ptr< ARDOUR::AutomationControl > ac, Gtk::Adjustment *adj)
std::shared_ptr< ARDOUR::AutomationControl > _controllable
sigc::connection _screen_update_connection
AutomationController(std::shared_ptr< ARDOUR::AutomationControl > ac, Gtk::Adjustment *adj, bool use_knob)
bool button_press(GdkEventButton *)
Gtk::Adjustment * _adjustment
bool on_button_release(GdkEventButton *ev)
std::shared_ptr< ARDOUR::AutomationControl > controllable()
Gtk::Adjustment * adjustment()
void set_ratio(double ratio)
void display_effective_value()
void disable_vertical_scroll()
static std::shared_ptr< AutomationController > create(const Evoral::Parameter &param, const ARDOUR::ParameterDescriptor &desc, std::shared_ptr< ARDOUR::AutomationControl > ac, bool use_knob=false)
std::shared_ptr< ARDOUR::AutomationControl > _controllable
void set_freq_beats(double beats)
void automation_state_changed()
PBD::ScopedConnectionList _changed_connections
bool button_release(GdkEventButton *)
Definition: ardour_ui.h:188