triggerbox (UI): shared ptrs for everyone, plus indirect references to Triggers from TriggerEntry
This commit is contained in:
parent
f69180c8ee
commit
c18d175f55
|
@ -402,7 +402,7 @@ AudioClipEditor::drop_waves ()
|
|||
}
|
||||
|
||||
void
|
||||
AudioClipEditor::set_region (boost::shared_ptr<AudioRegion> r, Trigger* t)
|
||||
AudioClipEditor::set_region (boost::shared_ptr<AudioRegion> r, TriggerPtr t)
|
||||
{
|
||||
drop_waves ();
|
||||
|
||||
|
@ -595,7 +595,7 @@ AudioClipEditorBox::zoom_out_click ()
|
|||
}
|
||||
|
||||
void
|
||||
AudioClipEditorBox::set_region (boost::shared_ptr<Region> r, Trigger* t)
|
||||
AudioClipEditorBox::set_region (boost::shared_ptr<Region> r, TriggerPtr t)
|
||||
{
|
||||
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (r);
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "ardour/ardour.h"
|
||||
#include "ardour/session_handle.h"
|
||||
#include "ardour/triggerbox.h"
|
||||
#include "ardour/types.h"
|
||||
|
||||
#include "gtkmm2ext/actions.h"
|
||||
|
@ -69,7 +70,7 @@ public:
|
|||
ClipEditorBox () {}
|
||||
~ClipEditorBox () {}
|
||||
|
||||
virtual void set_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Trigger*) = 0;
|
||||
virtual void set_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::TriggerPtr) = 0;
|
||||
|
||||
static void init ();
|
||||
static void register_clip_editor_actions (Gtkmm2ext::Bindings*);
|
||||
|
@ -91,7 +92,7 @@ public:
|
|||
AudioClipEditor ();
|
||||
~AudioClipEditor ();
|
||||
|
||||
void set_region (boost::shared_ptr<ARDOUR::AudioRegion>, ARDOUR::Trigger*);
|
||||
void set_region (boost::shared_ptr<ARDOUR::AudioRegion>, ARDOUR::TriggerPtr);
|
||||
void on_size_allocate (Gtk::Allocation&);
|
||||
|
||||
double sample_to_pixel (ARDOUR::samplepos_t);
|
||||
|
@ -124,12 +125,12 @@ private:
|
|||
units_per_pixel = 1;
|
||||
}
|
||||
|
||||
void set_trigger (ARDOUR::Trigger* t) { trigger = t; }
|
||||
void set_trigger (ARDOUR::TriggerPtr t) { trigger = t; }
|
||||
|
||||
void get_marks (std::vector<ArdourCanvas::Ruler::Mark>& marks, int64_t lower, int64_t upper, int maxchars) const;
|
||||
|
||||
private:
|
||||
ARDOUR::Trigger* trigger;
|
||||
ARDOUR::TriggerPtr trigger;
|
||||
|
||||
};
|
||||
|
||||
|
@ -202,7 +203,7 @@ public:
|
|||
AudioClipEditorBox ();
|
||||
~AudioClipEditorBox ();
|
||||
|
||||
void set_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Trigger*);
|
||||
void set_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::TriggerPtr);
|
||||
void region_changed (const PBD::PropertyChange& what_changed);
|
||||
|
||||
private:
|
||||
|
|
|
@ -168,9 +168,9 @@ AudioTriggerPropertiesBox::set_session (Session* s)
|
|||
}
|
||||
|
||||
void
|
||||
AudioTriggerPropertiesBox::set_trigger (ARDOUR::Trigger* t)
|
||||
AudioTriggerPropertiesBox::set_trigger (ARDOUR::TriggerPtr t)
|
||||
{
|
||||
ARDOUR::AudioTrigger* audio_trigger = dynamic_cast<ARDOUR::AudioTrigger*> (t);
|
||||
boost::shared_ptr<ARDOUR::AudioTrigger> audio_trigger = boost::dynamic_pointer_cast<ARDOUR::AudioTrigger> (t);
|
||||
|
||||
if (!audio_trigger) {
|
||||
return;
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
TriggerPropertiesBox () {}
|
||||
~TriggerPropertiesBox () {}
|
||||
|
||||
virtual void set_trigger (ARDOUR::Trigger*) = 0;
|
||||
virtual void set_trigger (ARDOUR::TriggerPtr) = 0;
|
||||
};
|
||||
|
||||
class AudioTriggerPropertiesBox : public TriggerPropertiesBox
|
||||
|
@ -46,7 +46,7 @@ public:
|
|||
AudioTriggerPropertiesBox ();
|
||||
~AudioTriggerPropertiesBox ();
|
||||
|
||||
void set_trigger (ARDOUR::Trigger*);
|
||||
void set_trigger (ARDOUR::TriggerPtr);
|
||||
|
||||
void set_session (ARDOUR::Session*);
|
||||
|
||||
|
@ -58,7 +58,7 @@ protected:
|
|||
Gtk::Label _header_label;
|
||||
|
||||
private:
|
||||
ARDOUR::AudioTrigger* _trigger;
|
||||
boost::shared_ptr<ARDOUR::AudioTrigger> _trigger;
|
||||
|
||||
Gtk::Table _table;
|
||||
Gtk::Label _abpm_label;
|
||||
|
|
|
@ -113,7 +113,7 @@ MidiClipEditorBox::set_session (Session* s)
|
|||
}
|
||||
|
||||
void
|
||||
MidiClipEditorBox::set_region (boost::shared_ptr<Region> r, Trigger* t)
|
||||
MidiClipEditorBox::set_region (boost::shared_ptr<Region> r, TriggerPtr t)
|
||||
{
|
||||
set_session (&r->session ());
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
|
||||
void set_session (ARDOUR::Session*);
|
||||
|
||||
void set_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Trigger*);
|
||||
void set_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::TriggerPtr);
|
||||
void region_changed (const PBD::PropertyChange& what_changed);
|
||||
|
||||
private:
|
||||
|
|
|
@ -79,9 +79,9 @@ MidiTriggerPropertiesBox::~MidiTriggerPropertiesBox ()
|
|||
}
|
||||
|
||||
void
|
||||
MidiTriggerPropertiesBox::set_trigger (ARDOUR::Trigger* t)
|
||||
MidiTriggerPropertiesBox::set_trigger (ARDOUR::TriggerPtr t)
|
||||
{
|
||||
ARDOUR::MIDITrigger* midi_trigger = dynamic_cast<ARDOUR::MIDITrigger*> (t);
|
||||
boost::shared_ptr<ARDOUR::MIDITrigger> midi_trigger = boost::dynamic_pointer_cast<ARDOUR::MIDITrigger> (t);
|
||||
|
||||
if (!midi_trigger) {
|
||||
return;
|
||||
|
|
|
@ -32,12 +32,12 @@ public:
|
|||
MidiTriggerPropertiesBox ();
|
||||
~MidiTriggerPropertiesBox ();
|
||||
|
||||
void set_trigger (ARDOUR::Trigger*);
|
||||
void set_trigger (ARDOUR::TriggerPtr);
|
||||
|
||||
private:
|
||||
void trigger_changed (const PBD::PropertyChange& what_changed);
|
||||
|
||||
ARDOUR::MIDITrigger* _trigger;
|
||||
boost::shared_ptr<ARDOUR::MIDITrigger> _trigger;
|
||||
|
||||
Gtk::Label _header_label;
|
||||
ArdourWidgets::ArdourButton _patch_enable_button;
|
||||
|
|
|
@ -63,7 +63,7 @@ SelectionPropertiesBox::SelectionPropertiesBox ()
|
|||
/* Time Info, for Range selections ToDo: range operations*/
|
||||
_time_info_box = new TimeInfoBox ("EditorTimeInfo", true);
|
||||
pack_start(*_time_info_box, false, false, 0);
|
||||
|
||||
|
||||
/* Region ops (mute/unmute), for multiple-Region selections */
|
||||
_mregions_prop_box = new MultiRegionPropertiesBox ();
|
||||
pack_start(*_mregions_prop_box, false, false, 0);
|
||||
|
@ -85,12 +85,12 @@ SelectionPropertiesBox::SelectionPropertiesBox ()
|
|||
/* AUDIO Region ops (reverse, normalize), for only-audio selections */
|
||||
_audio_ops_box = new AudioRegionOperationsBox ();
|
||||
pack_start(*_audio_ops_box, false, false, 0);
|
||||
|
||||
|
||||
|
||||
/* SLOT properties, for Trigger slot selections */
|
||||
_slot_prop_box = new SlotPropertiesBox ();
|
||||
pack_start(*_slot_prop_box, false, false, 0);
|
||||
|
||||
|
||||
|
||||
/* watch for any change in our selection, so we can show an appropriate property editor */
|
||||
Editor::instance().get_selection().TracksChanged.connect (sigc::mem_fun (*this, &SelectionPropertiesBox::selection_changed));
|
||||
|
@ -169,7 +169,7 @@ SelectionPropertiesBox::selection_changed ()
|
|||
} else {
|
||||
_header_label.set_text(_("Selection Properties (ESC = Deselect All)"));
|
||||
}
|
||||
|
||||
|
||||
if (!selection.time.empty()) {
|
||||
_time_info_box->show();
|
||||
}
|
||||
|
@ -203,13 +203,13 @@ SelectionPropertiesBox::selection_changed ()
|
|||
if (found_audio_regions && ! found_midi_regions) {
|
||||
_audio_ops_box->show();
|
||||
}
|
||||
|
||||
|
||||
boost::shared_ptr<ARDOUR::Region> selected_region = boost::shared_ptr<ARDOUR::Region>();
|
||||
|
||||
if (!selection.triggers.empty()) {
|
||||
TriggerSelection ts = selection.triggers;
|
||||
TriggerEntry* entry = *ts.begin();
|
||||
Trigger* slot = &entry->trigger();
|
||||
TriggerPtr slot = entry->trigger();
|
||||
|
||||
//slot properties incl "Follow Actions"
|
||||
_slot_prop_box->set_slot(slot);
|
||||
|
@ -220,7 +220,7 @@ SelectionPropertiesBox::selection_changed ()
|
|||
selected_region = (*(selection.regions.begin()))->region();
|
||||
}
|
||||
|
||||
if (selected_region) {
|
||||
if (selected_region) {
|
||||
//region properties
|
||||
if (selected_region->data_type() == DataType::MIDI) {
|
||||
_midi_prop_box->set_region(selected_region);
|
||||
|
|
|
@ -74,7 +74,7 @@ SlotPropertiesBox::set_session (Session* s)
|
|||
}
|
||||
|
||||
void
|
||||
SlotPropertiesBox::set_slot (Trigger* t)
|
||||
SlotPropertiesBox::set_slot (TriggerPtr t)
|
||||
{
|
||||
_triggerwidget->set_trigger (t);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
|
||||
void set_session (ARDOUR::Session*);
|
||||
|
||||
void set_slot (ARDOUR::Trigger*);
|
||||
void set_slot (ARDOUR::TriggerPtr);
|
||||
|
||||
private:
|
||||
Gtk::Table table;
|
||||
|
|
|
@ -491,7 +491,7 @@ TriggerMaster::prop_change (PropertyChange const& change)
|
|||
|
||||
std::string text;
|
||||
|
||||
ARDOUR::Trigger* trigger = _triggerbox->currently_playing ();
|
||||
ARDOUR::TriggerPtr trigger = _triggerbox->currently_playing ();
|
||||
if (!trigger) {
|
||||
name_text->set (text);
|
||||
_loopster->hide ();
|
||||
|
|
|
@ -347,7 +347,7 @@ TriggerPage::selection_changed ()
|
|||
if (!selection.triggers.empty ()) {
|
||||
TriggerSelection ts = selection.triggers;
|
||||
TriggerEntry* entry = *ts.begin ();
|
||||
Trigger* slot = &entry->trigger ();
|
||||
TriggerPtr slot = entry->trigger ();
|
||||
|
||||
_slot_prop_box.set_slot (slot);
|
||||
_slot_prop_box.show ();
|
||||
|
|
|
@ -219,7 +219,7 @@ TriggerUI::~TriggerUI ()
|
|||
}
|
||||
|
||||
void
|
||||
TriggerUI::set_trigger (ARDOUR::Trigger* t)
|
||||
TriggerUI::set_trigger (ARDOUR::TriggerPtr t)
|
||||
{
|
||||
trigger = t;
|
||||
|
||||
|
@ -447,7 +447,7 @@ TriggerWidget::TriggerWidget ()
|
|||
|
||||
/* ------------ */
|
||||
|
||||
TriggerWindow::TriggerWindow (Trigger* slot)
|
||||
TriggerWindow::TriggerWindow (TriggerPtr slot)
|
||||
{
|
||||
set_title (string_compose (_("Trigger: %1"), slot->name()));
|
||||
|
||||
|
|
|
@ -39,10 +39,10 @@ class TriggerUI : public Gtk::Table //, public sigc::trackable
|
|||
TriggerUI ();
|
||||
~TriggerUI ();
|
||||
|
||||
void set_trigger (ARDOUR::Trigger*);
|
||||
void set_trigger (ARDOUR::TriggerPtr);
|
||||
|
||||
private:
|
||||
ARDOUR::Trigger* trigger;
|
||||
ARDOUR::TriggerPtr trigger;
|
||||
|
||||
ArdourWidgets::ArdourButton _follow_action_button;
|
||||
|
||||
|
@ -90,7 +90,7 @@ class TriggerWidget : public Gtk::VBox
|
|||
{
|
||||
public:
|
||||
TriggerWidget ();
|
||||
void set_trigger (ARDOUR::Trigger* t) const {ui->set_trigger(t);}
|
||||
void set_trigger (ARDOUR::TriggerPtr t) const {ui->set_trigger(t);}
|
||||
|
||||
private:
|
||||
TriggerUI* ui;
|
||||
|
@ -101,7 +101,7 @@ class TriggerWidget : public Gtk::VBox
|
|||
class TriggerWindow : public Gtk::Window
|
||||
{
|
||||
public:
|
||||
TriggerWindow (ARDOUR::Trigger*);
|
||||
TriggerWindow (ARDOUR::TriggerPtr);
|
||||
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
bool on_key_release_event (GdkEventKey*);
|
||||
|
|
|
@ -55,27 +55,33 @@ using namespace ArdourCanvas;
|
|||
using namespace Gtkmm2ext;
|
||||
using namespace PBD;
|
||||
|
||||
TriggerEntry::TriggerEntry (Item* item, ARDOUR::Trigger& t)
|
||||
TriggerEntry::TriggerEntry (Item* item, TriggerReference tr)
|
||||
: ArdourCanvas::Rectangle (item)
|
||||
, _trigger (t)
|
||||
, tref (tr)
|
||||
{
|
||||
set_layout_sensitive (true); // why???
|
||||
|
||||
name = string_compose ("trigger %1", _trigger.index ());
|
||||
name = string_compose ("trigger %1", tref.slot);
|
||||
|
||||
set_outline (false);
|
||||
|
||||
play_button = new ArdourCanvas::Rectangle (this);
|
||||
play_button->set_outline (false);
|
||||
play_button->set_fill (true);
|
||||
play_button->name = string_compose ("playbutton %1", _trigger.index ());
|
||||
play_button->name = string_compose ("playbutton %1", tref.slot);
|
||||
play_button->show ();
|
||||
|
||||
<<<<<<< HEAD
|
||||
follow_button = new ArdourCanvas::Rectangle (this);
|
||||
follow_button->set_outline (false);
|
||||
follow_button->set_fill (true);
|
||||
follow_button->name = ("slot_selector_button");
|
||||
follow_button->show ();
|
||||
=======
|
||||
play_shape = new ArdourCanvas::Polygon (play_button);
|
||||
play_shape->name = string_compose ("playshape %1", tref.slot);
|
||||
play_shape->show ();
|
||||
>>>>>>> ea5651295d (triggerbox (UI): shared ptrs for everyone, plus indirect references to Triggers from TriggerEntry)
|
||||
|
||||
name_button = new ArdourCanvas::Rectangle (this);
|
||||
name_button->set_outline (true);
|
||||
|
@ -91,8 +97,8 @@ TriggerEntry::TriggerEntry (Item* item, ARDOUR::Trigger& t)
|
|||
UIConfiguration::instance ().ParameterChanged.connect (sigc::mem_fun (*this, &TriggerEntry::ui_parameter_changed));
|
||||
set_default_colors ();
|
||||
|
||||
_trigger.PropertyChanged.connect (trigger_prop_connection, MISSING_INVALIDATOR, boost::bind (&TriggerEntry::prop_change, this, _1), gui_context ());
|
||||
dynamic_cast<Stripable*> (_trigger.box ().owner ())->presentation_info ().Change.connect (owner_prop_connection, MISSING_INVALIDATOR, boost::bind (&TriggerEntry::owner_prop_change, this, _1), gui_context ());
|
||||
trigger()->PropertyChanged.connect (trigger_prop_connection, MISSING_INVALIDATOR, boost::bind (&TriggerEntry::prop_change, this, _1), gui_context ());
|
||||
dynamic_cast<Stripable*> (tref.box.owner ())->presentation_info ().Change.connect (owner_prop_connection, MISSING_INVALIDATOR, boost::bind (&TriggerEntry::owner_prop_change, this, _1), gui_context ());
|
||||
|
||||
PropertyChange changed;
|
||||
changed.add (ARDOUR::Properties::name);
|
||||
|
@ -340,7 +346,7 @@ TriggerEntry::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Conte
|
|||
|
||||
render_children (area, context);
|
||||
|
||||
if (_trigger.scene_isolated ()) {
|
||||
if (trigger()->scene_isolated ()) {
|
||||
/* left shadow */
|
||||
context->set_identity_matrix ();
|
||||
context->translate (self.x0, self.y0 - 0.5);
|
||||
|
@ -353,7 +359,7 @@ TriggerEntry::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Conte
|
|||
context->set_identity_matrix ();
|
||||
}
|
||||
|
||||
if (_trigger.index () == 1) {
|
||||
if (tref.slot == 1) {
|
||||
/* drop-shadow at top */
|
||||
Cairo::RefPtr<Cairo::LinearGradient> drop_shadow_pattern = Cairo::LinearGradient::create (0.0, 0.0, 0.0, 6 * scale);
|
||||
drop_shadow_pattern->add_color_stop_rgba (0, 0, 0, 0, 0.7);
|
||||
|
@ -361,7 +367,7 @@ TriggerEntry::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Conte
|
|||
context->set_source (drop_shadow_pattern);
|
||||
context->rectangle (0, 0, width, 6 * scale);
|
||||
context->fill ();
|
||||
} else if (_trigger.index () % 2 == 0) {
|
||||
} else if (tref.slot % 2 == 0) {
|
||||
/* line at top */
|
||||
context->set_identity_matrix ();
|
||||
context->translate (self.x0, self.y0 - 0.5);
|
||||
|
@ -381,12 +387,12 @@ TriggerEntry::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Conte
|
|||
}
|
||||
|
||||
/* follow-action icon */
|
||||
if (_trigger.region ()) {
|
||||
if (trigger()->region ()) {
|
||||
context->set_identity_matrix ();
|
||||
context->translate (self.x0, self.y0 - 0.5);
|
||||
context->translate (width - height, 0); // right side of the widget
|
||||
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground"));
|
||||
draw_follow_icon (context, _trigger.follow_action (0), height, scale);
|
||||
draw_follow_icon (context, trigger()->follow_action (0), height, scale);
|
||||
context->set_identity_matrix ();
|
||||
}
|
||||
}
|
||||
|
@ -395,8 +401,8 @@ void
|
|||
TriggerEntry::prop_change (PropertyChange const& change)
|
||||
{
|
||||
if (change.contains (ARDOUR::Properties::name)) {
|
||||
if (_trigger.region ()) {
|
||||
name_text->set (short_version (_trigger.name (), 16));
|
||||
if (trigger()->region ()) {
|
||||
name_text->set (short_version (trigger()->name (), 16));
|
||||
} else {
|
||||
name_text->set ("");
|
||||
}
|
||||
|
@ -422,7 +428,7 @@ TriggerEntry::set_default_colors ()
|
|||
name_button->set_fill_color (UIConfiguration::instance ().color ("theme:bg"));
|
||||
name_button->set_outline_color (UIConfiguration::instance ().color ("theme:bg"));
|
||||
follow_button->set_fill_color (UIConfiguration::instance ().color ("theme:bg"));
|
||||
if ((_trigger.index () / 2) % 2 == 0) {
|
||||
if ((tref.slot / 2) % 2 == 0) {
|
||||
set_fill_color (HSV (fill_color ()).darker (0.15).color ());
|
||||
play_button->set_fill_color (HSV (fill_color ()).darker (0.15).color ());
|
||||
name_button->set_fill_color (HSV (fill_color ()).darker (0.15).color ());
|
||||
|
@ -534,7 +540,7 @@ TriggerBoxUI::trigger_scene (int32_t n)
|
|||
void
|
||||
TriggerBoxUI::build ()
|
||||
{
|
||||
Trigger* t;
|
||||
TriggerPtr t;
|
||||
uint64_t n = 0;
|
||||
|
||||
// clear_items (true);
|
||||
|
@ -546,7 +552,7 @@ TriggerBoxUI::build ()
|
|||
if (!t) {
|
||||
break;
|
||||
}
|
||||
TriggerEntry* te = new TriggerEntry (this, *t);
|
||||
TriggerEntry* te = new TriggerEntry (this, TriggerReference (_triggerbox, n));
|
||||
|
||||
_slots.push_back (te);
|
||||
|
||||
|
@ -651,7 +657,7 @@ TriggerBoxUI::play_button_event (GdkEvent* ev, uint64_t n)
|
|||
case GDK_BUTTON_PRESS:
|
||||
switch (ev->button.button) {
|
||||
case 1:
|
||||
_slots[n]->trigger ().bang ();
|
||||
_slots[n]->trigger()->bang ();
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
@ -660,9 +666,9 @@ TriggerBoxUI::play_button_event (GdkEvent* ev, uint64_t n)
|
|||
case GDK_BUTTON_RELEASE:
|
||||
switch (ev->button.button) {
|
||||
case 1:
|
||||
if (_slots[n]->trigger ().launch_style () == Trigger::Gate ||
|
||||
_slots[n]->trigger ().launch_style () == Trigger::Repeat) {
|
||||
_slots[n]->trigger ().unbang ();
|
||||
if (_slots[n]->trigger()->launch_style () == Trigger::Gate ||
|
||||
_slots[n]->trigger()->launch_style () == Trigger::Repeat) {
|
||||
_slots[n]->trigger()->unbang ();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
|
@ -925,7 +931,7 @@ TriggerBoxUI::toggle_trigger_isolated (uint64_t n)
|
|||
return;
|
||||
}
|
||||
|
||||
Trigger* trigger = _triggerbox.trigger (n);
|
||||
TriggerPtr trigger = _triggerbox.trigger (n);
|
||||
trigger->set_scene_isolated (!trigger->scene_isolated ());
|
||||
}
|
||||
|
||||
|
@ -933,7 +939,7 @@ void
|
|||
TriggerBoxUI::clear_trigger (uint64_t n)
|
||||
{
|
||||
#if 0 // XXX
|
||||
Trigger* trigger = _triggerbox.trigger (n);
|
||||
TriggerPtr trigger = _triggerbox.trigger (n);
|
||||
trigger->clear_trigger();
|
||||
#endif
|
||||
}
|
||||
|
@ -941,7 +947,7 @@ TriggerBoxUI::clear_trigger (uint64_t n)
|
|||
void
|
||||
TriggerBoxUI::edit_trigger (uint64_t n)
|
||||
{
|
||||
Trigger* trigger = _triggerbox.trigger (n);
|
||||
TriggerPtr trigger = _triggerbox.trigger (n);
|
||||
TriggerWindow* tw = static_cast<TriggerWindow*> (trigger->ui ());
|
||||
|
||||
if (!tw) {
|
||||
|
|
|
@ -45,15 +45,25 @@ namespace ArdourCanvas
|
|||
class Polygon;
|
||||
}
|
||||
|
||||
class TriggerReference
|
||||
{
|
||||
public:
|
||||
TriggerReference (ARDOUR::TriggerBox& b, uint32_t s) : box (b), slot (s) {}
|
||||
boost::shared_ptr<ARDOUR::Trigger> trigger() const { return box.trigger (slot); }
|
||||
|
||||
ARDOUR::TriggerBox& box;
|
||||
uint32_t slot;
|
||||
};
|
||||
|
||||
class TriggerEntry : public ArdourCanvas::Rectangle
|
||||
{
|
||||
public:
|
||||
TriggerEntry (ArdourCanvas::Item* item, ARDOUR::Trigger&);
|
||||
TriggerEntry (ArdourCanvas::Item* item, TriggerReference rf);
|
||||
~TriggerEntry ();
|
||||
|
||||
ARDOUR::Trigger& trigger () const
|
||||
boost::shared_ptr<ARDOUR::Trigger> trigger () const
|
||||
{
|
||||
return _trigger;
|
||||
return tref.trigger();
|
||||
}
|
||||
|
||||
ArdourCanvas::Rectangle* play_button;
|
||||
|
@ -74,7 +84,7 @@ public:
|
|||
void set_default_colors ();
|
||||
|
||||
private:
|
||||
ARDOUR::Trigger& _trigger;
|
||||
TriggerReference tref;
|
||||
double _poly_size;
|
||||
double _poly_margin;
|
||||
|
||||
|
|
Loading…
Reference in New Issue