trigger_ui: move old triggerui implementation into slot_properties where it is used

This commit is contained in:
Ben Loftis 2021-12-30 10:25:00 -06:00
parent c45b95a823
commit 133b51922a
6 changed files with 539 additions and 513 deletions

View file

@ -19,21 +19,13 @@
#ifndef __ardour_gtk_trigger_ui_h__
#define __ardour_gtk_trigger_ui_h__
#include "gtkmm/colorselection.h"
#include "ardour/triggerbox.h"
#include "widgets/ardour_button.h"
#include "widgets/slider_controller.h"
#include "widgets/frame.h"
namespace ArdourWidgets {
class ArdourButton;
class HSliderController;
}
class TriggerPropertiesBox;
class RegionPropertiesBox;
class RegionOperationsBox;
class ClipEditorBox;
class TriggerUI
{
public:
@ -49,6 +41,13 @@ public:
static std::string quantize_length_to_string (Temporal::BBT_Offset const &);
static std::string launch_style_to_string (ARDOUR::Trigger::LaunchStyle);
static std::vector<std::string> follow_strings;
static std::string longest_follow;
static std::vector<std::string> quantize_strings;
static std::string longest_quantize;
static std::vector<std::string> launch_strings;
static std::string longest_launch;
private:
void trigger_changed (PBD::PropertyChange); //calls on_trigger_changed to subclasses
@ -86,76 +85,6 @@ protected:
PBD::ScopedConnectionList trigger_connections;
};
class SlotPropertyTable : public TriggerUI, public Gtk::Table
{
public:
SlotPropertyTable ();
~SlotPropertyTable ();
Glib::RefPtr<Gtk::SizeGroup> _follow_size_group;
ArdourWidgets::ArdourButton _color_button;
ArdourWidgets::ArdourButton _load_button;
ArdourWidgets::ArdourButton _follow_action_button;
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;
Gtk::Adjustment _follow_count_adjustment;
Gtk::SpinButton _follow_count_spinner;
ArdourWidgets::ArdourDropdown _follow_left;
ArdourWidgets::ArdourDropdown _follow_right;
ArdourWidgets::ArdourButton _legato_button;
ArdourWidgets::ArdourDropdown _quantize_button;
ArdourWidgets::ArdourDropdown _launch_style_button;
void set_quantize (Temporal::BBT_Offset);
void set_launch_style (ARDOUR::Trigger::LaunchStyle);
void set_follow_action (ARDOUR::Trigger::FollowAction, uint64_t);
void on_trigger_changed (PBD::PropertyChange);
bool follow_action_button_event (GdkEvent*);
bool legato_button_event (GdkEvent*);
void follow_count_event ();
void probability_adjusted ();
void velocity_adjusted ();
};
class SlotPropertyWidget : public Gtk::VBox
{
public:
SlotPropertyWidget ();
void set_trigger (ARDOUR::TriggerReference tr) const { ui->set_trigger(tr); }
private:
SlotPropertyTable* ui;
};
/* XXX probably for testing only */
class SlotPropertyWindow : public Gtk::Window
{
public:
SlotPropertyWindow (ARDOUR::TriggerReference);
bool on_key_press_event (GdkEventKey*);
bool on_key_release_event (GdkEventKey*);
TriggerPropertiesBox *_trig_box;
RegionOperationsBox *_ops_box;
ClipEditorBox *_trim_box;
};
#endif /* __ardour_gtk_trigger_ui_h__ */