2021-09-07 00:59:52 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Paul Davis <paul@linuxaudiosystems.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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ardour_gtk_trigger_ui_h__
|
|
|
|
#define __ardour_gtk_trigger_ui_h__
|
|
|
|
|
|
|
|
#include "ardour/triggerbox.h"
|
2021-12-14 11:40:25 -05:00
|
|
|
#include "widgets/ardour_button.h"
|
|
|
|
#include "widgets/slider_controller.h"
|
2021-09-07 00:59:52 -04:00
|
|
|
|
2021-09-10 15:05:19 -04:00
|
|
|
namespace ArdourWidgets {
|
|
|
|
class ArdourButton;
|
2021-11-30 13:14:19 -05:00
|
|
|
class HSliderController;
|
2021-09-10 15:05:19 -04:00
|
|
|
}
|
2021-09-07 00:59:52 -04:00
|
|
|
|
2021-12-15 19:08:15 -05:00
|
|
|
class TriggerPropertiesBox;
|
2021-12-02 11:50:19 -05:00
|
|
|
class RegionPropertiesBox;
|
|
|
|
class RegionOperationsBox;
|
2021-12-09 21:45:25 -05:00
|
|
|
class ClipEditorBox;
|
2021-12-02 11:50:19 -05:00
|
|
|
|
2021-11-30 13:14:19 -05:00
|
|
|
class TriggerUI : public Gtk::Table //, public sigc::trackable
|
2021-09-07 00:59:52 -04:00
|
|
|
{
|
|
|
|
public:
|
2021-11-30 13:14:19 -05:00
|
|
|
TriggerUI ();
|
2021-09-07 00:59:52 -04:00
|
|
|
~TriggerUI ();
|
|
|
|
|
2021-12-21 15:38:22 -05:00
|
|
|
void set_trigger (ARDOUR::TriggerPtr);
|
2021-11-29 20:21:04 -05:00
|
|
|
|
2021-09-07 00:59:52 -04:00
|
|
|
private:
|
2021-12-21 15:38:22 -05:00
|
|
|
ARDOUR::TriggerPtr trigger;
|
2021-09-07 00:59:52 -04:00
|
|
|
|
2021-12-14 11:40:25 -05:00
|
|
|
ArdourWidgets::ArdourButton _follow_action_button;
|
2021-12-14 10:36:43 -05:00
|
|
|
|
2021-12-14 14:10:47 -05:00
|
|
|
Gtk::Adjustment _velocity_adjustment;
|
|
|
|
ArdourWidgets::HSliderController _velocity_slider;
|
|
|
|
|
|
|
|
Gtk::Label _left_probability_label;
|
|
|
|
Gtk::Label _right_probability_label;
|
|
|
|
Gtk::Adjustment _follow_probability_adjustment;
|
|
|
|
ArdourWidgets::HSliderController _follow_probability_slider;
|
2021-12-14 10:36:43 -05:00
|
|
|
|
|
|
|
Gtk::Adjustment _follow_count_adjustment;
|
|
|
|
Gtk::SpinButton _follow_count_spinner;
|
|
|
|
|
2021-12-14 11:40:25 -05:00
|
|
|
ArdourWidgets::ArdourDropdown _follow_left;
|
|
|
|
ArdourWidgets::ArdourDropdown _follow_right;
|
2021-09-07 00:59:52 -04:00
|
|
|
|
2021-12-14 11:40:25 -05:00
|
|
|
ArdourWidgets::ArdourButton _legato_button;
|
2021-09-07 00:59:52 -04:00
|
|
|
|
2021-12-14 11:40:25 -05:00
|
|
|
ArdourWidgets::ArdourDropdown _quantize_button;
|
2021-10-01 20:38:42 -04:00
|
|
|
|
2021-12-14 11:40:25 -05:00
|
|
|
ArdourWidgets::ArdourDropdown _launch_style_button;
|
2021-09-10 15:05:19 -04:00
|
|
|
|
2021-09-29 20:01:19 -04:00
|
|
|
void set_quantize (Temporal::BBT_Offset);
|
2021-10-01 20:38:42 -04:00
|
|
|
void set_launch_style (ARDOUR::Trigger::LaunchStyle);
|
|
|
|
|
2021-09-28 19:45:58 -04:00
|
|
|
void trigger_changed (PBD::PropertyChange);
|
|
|
|
|
|
|
|
bool follow_action_button_event (GdkEvent*);
|
2021-10-02 20:36:14 -04:00
|
|
|
bool legato_button_event (GdkEvent*);
|
2021-12-14 10:36:43 -05:00
|
|
|
void follow_count_event ();
|
2021-09-28 19:45:58 -04:00
|
|
|
|
2021-12-14 14:10:47 -05:00
|
|
|
void probability_adjusted ();
|
|
|
|
void velocity_adjusted ();
|
|
|
|
|
2021-09-28 19:45:58 -04:00
|
|
|
PBD::ScopedConnectionList trigger_connections;
|
2021-09-10 15:05:19 -04:00
|
|
|
|
|
|
|
static std::string follow_action_to_string (ARDOUR::Trigger::FollowAction);
|
|
|
|
static ARDOUR::Trigger::FollowAction string_to_follow_action (std::string const &);
|
2021-09-29 20:01:19 -04:00
|
|
|
static std::string quantize_length_to_string (Temporal::BBT_Offset const &);
|
2021-10-01 20:38:42 -04:00
|
|
|
static std::string launch_style_to_string (ARDOUR::Trigger::LaunchStyle);
|
2021-09-07 00:59:52 -04:00
|
|
|
};
|
|
|
|
|
2021-11-30 13:14:19 -05:00
|
|
|
class TriggerWidget : public Gtk::VBox
|
2021-09-07 00:59:52 -04:00
|
|
|
{
|
|
|
|
public:
|
2021-11-29 20:21:04 -05:00
|
|
|
TriggerWidget ();
|
2021-12-21 15:38:22 -05:00
|
|
|
void set_trigger (ARDOUR::TriggerPtr t) const {ui->set_trigger(t);}
|
2021-09-07 00:59:52 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
TriggerUI* ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* XXX probably for testing only */
|
|
|
|
|
|
|
|
class TriggerWindow : public Gtk::Window
|
|
|
|
{
|
|
|
|
public:
|
2021-12-21 15:38:22 -05:00
|
|
|
TriggerWindow (ARDOUR::TriggerPtr);
|
2021-09-07 00:59:52 -04:00
|
|
|
|
|
|
|
bool on_key_press_event (GdkEventKey*);
|
|
|
|
bool on_key_release_event (GdkEventKey*);
|
2021-12-02 11:50:19 -05:00
|
|
|
|
2021-12-15 19:08:15 -05:00
|
|
|
TriggerPropertiesBox *_trig_box;
|
2021-12-02 11:50:19 -05:00
|
|
|
RegionOperationsBox *_ops_box;
|
2021-12-09 21:45:25 -05:00
|
|
|
ClipEditorBox *_trim_box;
|
2021-09-07 00:59:52 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk_trigger_ui_h__ */
|