2008-06-02 21:41:35 +00:00
|
|
|
/*
|
2019-08-03 04:40:09 +02:00
|
|
|
* Copyright (C) 2006 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
|
* Copyright (C) 2017-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.
|
|
|
|
|
*/
|
2008-06-02 21:41:35 +00:00
|
|
|
|
2017-07-17 04:55:52 +02:00
|
|
|
#ifndef _WIDGETS_BINDING_PROXY_
|
|
|
|
|
#define _WIDGETS_BINDING_PROXY_
|
2008-06-02 21:41:35 +00:00
|
|
|
|
2023-02-16 10:59:41 -07:00
|
|
|
#include <memory>
|
2008-06-02 21:41:35 +00:00
|
|
|
#include <string>
|
2013-10-17 11:26:01 -04:00
|
|
|
|
2012-05-14 17:18:48 +00:00
|
|
|
#include "pbd/signals.h"
|
2008-06-02 21:41:35 +00:00
|
|
|
|
2024-10-19 15:54:24 +02:00
|
|
|
#include "gdk/gdkevents.h"
|
|
|
|
|
|
2017-07-17 04:55:52 +02:00
|
|
|
#include "widgets/visibility.h"
|
2013-10-17 11:26:01 -04:00
|
|
|
|
2008-06-02 21:41:35 +00:00
|
|
|
namespace PBD {
|
|
|
|
|
class Controllable;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 04:55:52 +02:00
|
|
|
namespace ArdourWidgets {
|
|
|
|
|
class PopUp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace ArdourWidgets {
|
|
|
|
|
|
|
|
|
|
class LIBWIDGETS_API BindingProxy : public sigc::trackable
|
2008-06-02 21:41:35 +00:00
|
|
|
{
|
2017-07-17 04:55:52 +02:00
|
|
|
public:
|
2023-02-16 16:33:28 -07:00
|
|
|
BindingProxy (std::shared_ptr<PBD::Controllable>);
|
2008-12-08 16:07:28 +00:00
|
|
|
BindingProxy ();
|
2008-06-02 21:41:35 +00:00
|
|
|
virtual ~BindingProxy();
|
2015-10-05 16:17:49 +02:00
|
|
|
|
2008-06-02 21:41:35 +00:00
|
|
|
void set_bind_button_state (guint button, guint statemask);
|
|
|
|
|
|
2014-08-28 10:31:57 -05:00
|
|
|
static bool is_bind_action (GdkEventButton *);
|
2008-06-02 21:41:35 +00:00
|
|
|
bool button_press_handler (GdkEventButton *);
|
|
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<PBD::Controllable> get_controllable() const { return controllable; }
|
|
|
|
|
void set_controllable (std::shared_ptr<PBD::Controllable>);
|
2008-06-02 21:41:35 +00:00
|
|
|
|
2017-07-17 04:55:52 +02:00
|
|
|
protected:
|
|
|
|
|
ArdourWidgets::PopUp* prompter;
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<PBD::Controllable> controllable;
|
2015-10-05 16:17:49 +02:00
|
|
|
|
2014-08-28 10:31:57 -05:00
|
|
|
static guint bind_button;
|
|
|
|
|
static guint bind_statemask;
|
2015-10-05 16:17:49 +02:00
|
|
|
|
2012-05-14 17:18:48 +00:00
|
|
|
PBD::ScopedConnection learning_connection;
|
2017-07-30 02:40:45 +02:00
|
|
|
PBD::ScopedConnection _controllable_going_away_connection;
|
2008-06-02 21:41:35 +00:00
|
|
|
void learning_finished ();
|
|
|
|
|
bool prompter_hiding (GdkEventAny *);
|
|
|
|
|
};
|
|
|
|
|
|
2017-07-17 04:55:52 +02:00
|
|
|
}
|
|
|
|
|
|
2008-06-02 21:41:35 +00:00
|
|
|
#endif
|