2007-06-29 00:02:58 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2007-2014 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2007-06-29 00:02:58 -04:00
|
|
|
|
|
|
|
#ifndef __ardour_gtk_automation_controller_h__
|
|
|
|
#define __ardour_gtk_automation_controller_h__
|
|
|
|
|
2013-04-30 11:14:06 -04:00
|
|
|
#ifdef YES
|
|
|
|
#undef YES
|
|
|
|
#endif
|
|
|
|
#ifdef NO
|
|
|
|
#undef NO
|
|
|
|
#endif
|
|
|
|
|
2023-02-16 12:59:41 -05:00
|
|
|
#include <memory>
|
2017-07-16 21:48:18 -04:00
|
|
|
|
|
|
|
#include <gtkmm/alignment.h>
|
2009-12-19 15:26:31 -05:00
|
|
|
|
|
|
|
#include "pbd/signals.h"
|
2019-04-18 10:46:44 -04:00
|
|
|
#include "ardour/parameter_descriptor.h"
|
|
|
|
|
2017-07-16 16:13:46 -04:00
|
|
|
#include "widgets/barcontroller.h"
|
2007-06-29 00:02:58 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
class AutomationList;
|
|
|
|
class AutomationControl;
|
|
|
|
}
|
|
|
|
|
2017-07-16 21:48:18 -04:00
|
|
|
namespace Gtk {
|
|
|
|
class Adjustment;
|
|
|
|
class Widget;
|
|
|
|
}
|
|
|
|
|
2017-07-16 16:13:46 -04:00
|
|
|
class AutomationBarController : public ArdourWidgets::BarController {
|
2014-11-29 08:49:03 -05:00
|
|
|
public:
|
2023-02-16 18:33:28 -05:00
|
|
|
AutomationBarController(std::shared_ptr<ARDOUR::AutomationControl> ac,
|
2014-11-29 08:49:03 -05:00
|
|
|
Gtk::Adjustment* adj);
|
|
|
|
~AutomationBarController();
|
|
|
|
private:
|
|
|
|
std::string get_label (double&);
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ARDOUR::AutomationControl> _controllable;
|
2014-11-29 08:49:03 -05:00
|
|
|
};
|
|
|
|
|
2010-02-02 19:52:45 -05:00
|
|
|
/** A BarController which displays the value and allows control of an AutomationControl */
|
2014-11-28 18:40:23 -05:00
|
|
|
class AutomationController : public Gtk::Alignment {
|
2007-06-29 00:02:58 -04:00
|
|
|
public:
|
2023-02-16 18:33:28 -05:00
|
|
|
static std::shared_ptr<AutomationController> create (
|
2014-11-01 23:29:10 -04:00
|
|
|
const Evoral::Parameter& param,
|
|
|
|
const ARDOUR::ParameterDescriptor& desc,
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ARDOUR::AutomationControl> ac,
|
2016-07-03 18:18:45 -04:00
|
|
|
bool use_knob = false);
|
2007-06-29 00:02:58 -04:00
|
|
|
|
|
|
|
~AutomationController();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ARDOUR::AutomationControl> controllable() { return _controllable; }
|
2007-06-30 14:41:50 -04:00
|
|
|
|
2014-11-28 18:40:23 -05:00
|
|
|
void disable_vertical_scroll();
|
|
|
|
|
2007-06-30 14:41:50 -04:00
|
|
|
Gtk::Adjustment* adjustment() { return _adjustment; }
|
2014-11-28 18:40:23 -05:00
|
|
|
Gtk::Widget* widget() { return _widget; }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2017-07-15 14:50:26 -04:00
|
|
|
void display_effective_value ();
|
|
|
|
void automation_state_changed ();
|
2007-06-29 00:02:58 -04:00
|
|
|
void value_adjusted();
|
|
|
|
|
2010-02-02 19:52:45 -05:00
|
|
|
void stop_updating ();
|
|
|
|
|
2007-06-29 00:02:58 -04:00
|
|
|
private:
|
2023-02-16 18:33:28 -05:00
|
|
|
AutomationController (std::shared_ptr<ARDOUR::AutomationControl> ac,
|
2016-07-03 18:18:45 -04:00
|
|
|
Gtk::Adjustment* adj,
|
|
|
|
bool use_knob);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2023-07-26 15:11:52 -04:00
|
|
|
void start_touch(int);
|
|
|
|
void end_touch(int);
|
2017-02-27 22:59:45 -05:00
|
|
|
bool button_press(GdkEventButton*);
|
|
|
|
bool button_release(GdkEventButton*);
|
2007-06-29 00:02:58 -04:00
|
|
|
|
2014-11-03 16:37:19 -05:00
|
|
|
void run_note_select_dialog();
|
2014-11-03 17:29:11 -05:00
|
|
|
void set_ratio(double ratio);
|
|
|
|
void set_freq_beats(double beats);
|
2014-11-03 16:37:19 -05:00
|
|
|
bool on_button_release(GdkEventButton* ev);
|
|
|
|
|
2014-11-28 18:40:23 -05:00
|
|
|
Gtk::Widget* _widget;
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ARDOUR::AutomationControl> _controllable;
|
2007-06-29 00:02:58 -04:00
|
|
|
Gtk::Adjustment* _adjustment;
|
|
|
|
sigc::connection _screen_update_connection;
|
2017-07-15 14:50:26 -04:00
|
|
|
PBD::ScopedConnectionList _changed_connections;
|
2014-11-28 18:40:23 -05:00
|
|
|
bool _ignore_change;
|
2018-07-18 04:55:41 -04:00
|
|
|
bool _grabbed;
|
2007-06-29 00:02:58 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk_automation_controller_h__ */
|