2021-11-29 17:30:34 -05:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2021 Ben Loftis <ben@harrisonconsoles.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 __slot_properties_box_h__
|
|
|
|
#define __slot_properties_box_h__
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/label.h>
|
2021-12-30 11:25:00 -05:00
|
|
|
#include "gtkmm/sizegroup.h"
|
2021-11-29 17:30:34 -05:00
|
|
|
#include <gtkmm/table.h>
|
|
|
|
|
|
|
|
#include "ardour/ardour.h"
|
|
|
|
#include "ardour/session_handle.h"
|
|
|
|
|
|
|
|
#include "widgets/ardour_button.h"
|
2021-12-30 11:25:00 -05:00
|
|
|
#include "widgets/slider_controller.h"
|
|
|
|
#include "widgets/ardour_dropdown.h"
|
2021-11-29 17:30:34 -05:00
|
|
|
|
|
|
|
#include "gtkmm2ext/cairo_packer.h"
|
|
|
|
|
2021-12-30 11:25:00 -05:00
|
|
|
#include "trigger_ui.h"
|
|
|
|
|
2021-11-29 17:30:34 -05:00
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
class Location;
|
|
|
|
}
|
|
|
|
|
2021-12-30 11:25:00 -05:00
|
|
|
namespace ArdourWidgets {
|
|
|
|
class ArdourButton;
|
|
|
|
class HSliderController;
|
|
|
|
}
|
|
|
|
|
|
|
|
class TriggerPropertiesBox;
|
|
|
|
class RegionPropertiesBox;
|
|
|
|
class RegionOperationsBox;
|
|
|
|
class ClipEditorBox;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2022-01-14 11:06:49 -05:00
|
|
|
Gtk::Table _trigger_table;
|
|
|
|
Gtk::Table _launch_table;
|
|
|
|
Gtk::Table _follow_table;
|
|
|
|
|
2021-12-30 11:25:00 -05:00
|
|
|
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;
|
|
|
|
|
2022-01-14 11:06:49 -05:00
|
|
|
Gtk::Adjustment _follow_length_adjustment;
|
|
|
|
Gtk::SpinButton _follow_length_spinner;
|
|
|
|
|
2021-12-30 11:25:00 -05:00
|
|
|
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);
|
|
|
|
|
2021-12-30 13:10:50 -05:00
|
|
|
void on_trigger_changed (PBD::PropertyChange const& );
|
2021-12-30 11:25:00 -05:00
|
|
|
|
|
|
|
bool follow_action_button_event (GdkEvent*);
|
|
|
|
bool legato_button_event (GdkEvent*);
|
|
|
|
void follow_count_event ();
|
2022-01-14 11:06:49 -05:00
|
|
|
void follow_length_event ();
|
2021-12-30 11:25:00 -05:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
2021-11-29 17:30:34 -05:00
|
|
|
|
|
|
|
class SlotPropertiesBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SlotPropertiesBox ();
|
|
|
|
~SlotPropertiesBox ();
|
|
|
|
|
|
|
|
void set_session (ARDOUR::Session*);
|
|
|
|
|
2021-12-24 16:13:36 -05:00
|
|
|
void set_slot (ARDOUR::TriggerReference);
|
2021-11-29 17:30:34 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
Gtk::Table table;
|
|
|
|
|
|
|
|
Gtk::Label _header_label;
|
|
|
|
|
2021-12-30 10:05:24 -05:00
|
|
|
SlotPropertyWidget* _triggerwidget;
|
2021-11-29 17:30:34 -05:00
|
|
|
};
|
|
|
|
|
2021-12-30 11:25:00 -05:00
|
|
|
/* 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;
|
|
|
|
};
|
2021-11-29 17:30:34 -05:00
|
|
|
#endif /* __multi_region_properties_box_h__ */
|