mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
triggerbox (UI): shared ptrs for everyone, plus indirect references to Triggers from TriggerEntry
This commit is contained in:
parent
f69180c8ee
commit
c18d175f55
17 changed files with 79 additions and 62 deletions
|
|
@ -402,7 +402,7 @@ AudioClipEditor::drop_waves ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClipEditor::set_region (boost::shared_ptr<AudioRegion> r, Trigger* t)
|
AudioClipEditor::set_region (boost::shared_ptr<AudioRegion> r, TriggerPtr t)
|
||||||
{
|
{
|
||||||
drop_waves ();
|
drop_waves ();
|
||||||
|
|
||||||
|
|
@ -595,7 +595,7 @@ AudioClipEditorBox::zoom_out_click ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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);
|
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (r);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "ardour/ardour.h"
|
#include "ardour/ardour.h"
|
||||||
#include "ardour/session_handle.h"
|
#include "ardour/session_handle.h"
|
||||||
|
#include "ardour/triggerbox.h"
|
||||||
#include "ardour/types.h"
|
#include "ardour/types.h"
|
||||||
|
|
||||||
#include "gtkmm2ext/actions.h"
|
#include "gtkmm2ext/actions.h"
|
||||||
|
|
@ -69,7 +70,7 @@ public:
|
||||||
ClipEditorBox () {}
|
ClipEditorBox () {}
|
||||||
~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 init ();
|
||||||
static void register_clip_editor_actions (Gtkmm2ext::Bindings*);
|
static void register_clip_editor_actions (Gtkmm2ext::Bindings*);
|
||||||
|
|
@ -91,7 +92,7 @@ public:
|
||||||
AudioClipEditor ();
|
AudioClipEditor ();
|
||||||
~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&);
|
void on_size_allocate (Gtk::Allocation&);
|
||||||
|
|
||||||
double sample_to_pixel (ARDOUR::samplepos_t);
|
double sample_to_pixel (ARDOUR::samplepos_t);
|
||||||
|
|
@ -124,12 +125,12 @@ private:
|
||||||
units_per_pixel = 1;
|
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;
|
void get_marks (std::vector<ArdourCanvas::Ruler::Mark>& marks, int64_t lower, int64_t upper, int maxchars) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARDOUR::Trigger* trigger;
|
ARDOUR::TriggerPtr trigger;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -202,7 +203,7 @@ public:
|
||||||
AudioClipEditorBox ();
|
AudioClipEditorBox ();
|
||||||
~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);
|
void region_changed (const PBD::PropertyChange& what_changed);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -168,9 +168,9 @@ AudioTriggerPropertiesBox::set_session (Session* s)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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) {
|
if (!audio_trigger) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public:
|
||||||
TriggerPropertiesBox () {}
|
TriggerPropertiesBox () {}
|
||||||
~TriggerPropertiesBox () {}
|
~TriggerPropertiesBox () {}
|
||||||
|
|
||||||
virtual void set_trigger (ARDOUR::Trigger*) = 0;
|
virtual void set_trigger (ARDOUR::TriggerPtr) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AudioTriggerPropertiesBox : public TriggerPropertiesBox
|
class AudioTriggerPropertiesBox : public TriggerPropertiesBox
|
||||||
|
|
@ -46,7 +46,7 @@ public:
|
||||||
AudioTriggerPropertiesBox ();
|
AudioTriggerPropertiesBox ();
|
||||||
~AudioTriggerPropertiesBox ();
|
~AudioTriggerPropertiesBox ();
|
||||||
|
|
||||||
void set_trigger (ARDOUR::Trigger*);
|
void set_trigger (ARDOUR::TriggerPtr);
|
||||||
|
|
||||||
void set_session (ARDOUR::Session*);
|
void set_session (ARDOUR::Session*);
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ protected:
|
||||||
Gtk::Label _header_label;
|
Gtk::Label _header_label;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARDOUR::AudioTrigger* _trigger;
|
boost::shared_ptr<ARDOUR::AudioTrigger> _trigger;
|
||||||
|
|
||||||
Gtk::Table _table;
|
Gtk::Table _table;
|
||||||
Gtk::Label _abpm_label;
|
Gtk::Label _abpm_label;
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ MidiClipEditorBox::set_session (Session* s)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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 ());
|
set_session (&r->session ());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public:
|
||||||
|
|
||||||
void set_session (ARDOUR::Session*);
|
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);
|
void region_changed (const PBD::PropertyChange& what_changed);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,9 @@ MidiTriggerPropertiesBox::~MidiTriggerPropertiesBox ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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) {
|
if (!midi_trigger) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,12 @@ public:
|
||||||
MidiTriggerPropertiesBox ();
|
MidiTriggerPropertiesBox ();
|
||||||
~MidiTriggerPropertiesBox ();
|
~MidiTriggerPropertiesBox ();
|
||||||
|
|
||||||
void set_trigger (ARDOUR::Trigger*);
|
void set_trigger (ARDOUR::TriggerPtr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void trigger_changed (const PBD::PropertyChange& what_changed);
|
void trigger_changed (const PBD::PropertyChange& what_changed);
|
||||||
|
|
||||||
ARDOUR::MIDITrigger* _trigger;
|
boost::shared_ptr<ARDOUR::MIDITrigger> _trigger;
|
||||||
|
|
||||||
Gtk::Label _header_label;
|
Gtk::Label _header_label;
|
||||||
ArdourWidgets::ArdourButton _patch_enable_button;
|
ArdourWidgets::ArdourButton _patch_enable_button;
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ SelectionPropertiesBox::selection_changed ()
|
||||||
if (!selection.triggers.empty()) {
|
if (!selection.triggers.empty()) {
|
||||||
TriggerSelection ts = selection.triggers;
|
TriggerSelection ts = selection.triggers;
|
||||||
TriggerEntry* entry = *ts.begin();
|
TriggerEntry* entry = *ts.begin();
|
||||||
Trigger* slot = &entry->trigger();
|
TriggerPtr slot = entry->trigger();
|
||||||
|
|
||||||
//slot properties incl "Follow Actions"
|
//slot properties incl "Follow Actions"
|
||||||
_slot_prop_box->set_slot(slot);
|
_slot_prop_box->set_slot(slot);
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ SlotPropertiesBox::set_session (Session* s)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SlotPropertiesBox::set_slot (Trigger* t)
|
SlotPropertiesBox::set_slot (TriggerPtr t)
|
||||||
{
|
{
|
||||||
_triggerwidget->set_trigger (t);
|
_triggerwidget->set_trigger (t);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ public:
|
||||||
|
|
||||||
void set_session (ARDOUR::Session*);
|
void set_session (ARDOUR::Session*);
|
||||||
|
|
||||||
void set_slot (ARDOUR::Trigger*);
|
void set_slot (ARDOUR::TriggerPtr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Gtk::Table table;
|
Gtk::Table table;
|
||||||
|
|
|
||||||
|
|
@ -491,7 +491,7 @@ TriggerMaster::prop_change (PropertyChange const& change)
|
||||||
|
|
||||||
std::string text;
|
std::string text;
|
||||||
|
|
||||||
ARDOUR::Trigger* trigger = _triggerbox->currently_playing ();
|
ARDOUR::TriggerPtr trigger = _triggerbox->currently_playing ();
|
||||||
if (!trigger) {
|
if (!trigger) {
|
||||||
name_text->set (text);
|
name_text->set (text);
|
||||||
_loopster->hide ();
|
_loopster->hide ();
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ TriggerPage::selection_changed ()
|
||||||
if (!selection.triggers.empty ()) {
|
if (!selection.triggers.empty ()) {
|
||||||
TriggerSelection ts = selection.triggers;
|
TriggerSelection ts = selection.triggers;
|
||||||
TriggerEntry* entry = *ts.begin ();
|
TriggerEntry* entry = *ts.begin ();
|
||||||
Trigger* slot = &entry->trigger ();
|
TriggerPtr slot = entry->trigger ();
|
||||||
|
|
||||||
_slot_prop_box.set_slot (slot);
|
_slot_prop_box.set_slot (slot);
|
||||||
_slot_prop_box.show ();
|
_slot_prop_box.show ();
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ TriggerUI::~TriggerUI ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TriggerUI::set_trigger (ARDOUR::Trigger* t)
|
TriggerUI::set_trigger (ARDOUR::TriggerPtr t)
|
||||||
{
|
{
|
||||||
trigger = 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()));
|
set_title (string_compose (_("Trigger: %1"), slot->name()));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ class TriggerUI : public Gtk::Table //, public sigc::trackable
|
||||||
TriggerUI ();
|
TriggerUI ();
|
||||||
~TriggerUI ();
|
~TriggerUI ();
|
||||||
|
|
||||||
void set_trigger (ARDOUR::Trigger*);
|
void set_trigger (ARDOUR::TriggerPtr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARDOUR::Trigger* trigger;
|
ARDOUR::TriggerPtr trigger;
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton _follow_action_button;
|
ArdourWidgets::ArdourButton _follow_action_button;
|
||||||
|
|
||||||
|
|
@ -90,7 +90,7 @@ class TriggerWidget : public Gtk::VBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TriggerWidget ();
|
TriggerWidget ();
|
||||||
void set_trigger (ARDOUR::Trigger* t) const {ui->set_trigger(t);}
|
void set_trigger (ARDOUR::TriggerPtr t) const {ui->set_trigger(t);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TriggerUI* ui;
|
TriggerUI* ui;
|
||||||
|
|
@ -101,7 +101,7 @@ class TriggerWidget : public Gtk::VBox
|
||||||
class TriggerWindow : public Gtk::Window
|
class TriggerWindow : public Gtk::Window
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TriggerWindow (ARDOUR::Trigger*);
|
TriggerWindow (ARDOUR::TriggerPtr);
|
||||||
|
|
||||||
bool on_key_press_event (GdkEventKey*);
|
bool on_key_press_event (GdkEventKey*);
|
||||||
bool on_key_release_event (GdkEventKey*);
|
bool on_key_release_event (GdkEventKey*);
|
||||||
|
|
|
||||||
|
|
@ -55,27 +55,33 @@ using namespace ArdourCanvas;
|
||||||
using namespace Gtkmm2ext;
|
using namespace Gtkmm2ext;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
TriggerEntry::TriggerEntry (Item* item, ARDOUR::Trigger& t)
|
TriggerEntry::TriggerEntry (Item* item, TriggerReference tr)
|
||||||
: ArdourCanvas::Rectangle (item)
|
: ArdourCanvas::Rectangle (item)
|
||||||
, _trigger (t)
|
, tref (tr)
|
||||||
{
|
{
|
||||||
set_layout_sensitive (true); // why???
|
set_layout_sensitive (true); // why???
|
||||||
|
|
||||||
name = string_compose ("trigger %1", _trigger.index ());
|
name = string_compose ("trigger %1", tref.slot);
|
||||||
|
|
||||||
set_outline (false);
|
set_outline (false);
|
||||||
|
|
||||||
play_button = new ArdourCanvas::Rectangle (this);
|
play_button = new ArdourCanvas::Rectangle (this);
|
||||||
play_button->set_outline (false);
|
play_button->set_outline (false);
|
||||||
play_button->set_fill (true);
|
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 ();
|
play_button->show ();
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
follow_button = new ArdourCanvas::Rectangle (this);
|
follow_button = new ArdourCanvas::Rectangle (this);
|
||||||
follow_button->set_outline (false);
|
follow_button->set_outline (false);
|
||||||
follow_button->set_fill (true);
|
follow_button->set_fill (true);
|
||||||
follow_button->name = ("slot_selector_button");
|
follow_button->name = ("slot_selector_button");
|
||||||
follow_button->show ();
|
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 = new ArdourCanvas::Rectangle (this);
|
||||||
name_button->set_outline (true);
|
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));
|
UIConfiguration::instance ().ParameterChanged.connect (sigc::mem_fun (*this, &TriggerEntry::ui_parameter_changed));
|
||||||
set_default_colors ();
|
set_default_colors ();
|
||||||
|
|
||||||
_trigger.PropertyChanged.connect (trigger_prop_connection, MISSING_INVALIDATOR, boost::bind (&TriggerEntry::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*> (_trigger.box ().owner ())->presentation_info ().Change.connect (owner_prop_connection, MISSING_INVALIDATOR, boost::bind (&TriggerEntry::owner_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;
|
PropertyChange changed;
|
||||||
changed.add (ARDOUR::Properties::name);
|
changed.add (ARDOUR::Properties::name);
|
||||||
|
|
@ -340,7 +346,7 @@ TriggerEntry::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Conte
|
||||||
|
|
||||||
render_children (area, context);
|
render_children (area, context);
|
||||||
|
|
||||||
if (_trigger.scene_isolated ()) {
|
if (trigger()->scene_isolated ()) {
|
||||||
/* left shadow */
|
/* left shadow */
|
||||||
context->set_identity_matrix ();
|
context->set_identity_matrix ();
|
||||||
context->translate (self.x0, self.y0 - 0.5);
|
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 ();
|
context->set_identity_matrix ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_trigger.index () == 1) {
|
if (tref.slot == 1) {
|
||||||
/* drop-shadow at top */
|
/* drop-shadow at top */
|
||||||
Cairo::RefPtr<Cairo::LinearGradient> drop_shadow_pattern = Cairo::LinearGradient::create (0.0, 0.0, 0.0, 6 * scale);
|
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);
|
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->set_source (drop_shadow_pattern);
|
||||||
context->rectangle (0, 0, width, 6 * scale);
|
context->rectangle (0, 0, width, 6 * scale);
|
||||||
context->fill ();
|
context->fill ();
|
||||||
} else if (_trigger.index () % 2 == 0) {
|
} else if (tref.slot % 2 == 0) {
|
||||||
/* line at top */
|
/* line at top */
|
||||||
context->set_identity_matrix ();
|
context->set_identity_matrix ();
|
||||||
context->translate (self.x0, self.y0 - 0.5);
|
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 */
|
/* follow-action icon */
|
||||||
if (_trigger.region ()) {
|
if (trigger()->region ()) {
|
||||||
context->set_identity_matrix ();
|
context->set_identity_matrix ();
|
||||||
context->translate (self.x0, self.y0 - 0.5);
|
context->translate (self.x0, self.y0 - 0.5);
|
||||||
context->translate (width - height, 0); // right side of the widget
|
context->translate (width - height, 0); // right side of the widget
|
||||||
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground"));
|
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 ();
|
context->set_identity_matrix ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -395,8 +401,8 @@ void
|
||||||
TriggerEntry::prop_change (PropertyChange const& change)
|
TriggerEntry::prop_change (PropertyChange const& change)
|
||||||
{
|
{
|
||||||
if (change.contains (ARDOUR::Properties::name)) {
|
if (change.contains (ARDOUR::Properties::name)) {
|
||||||
if (_trigger.region ()) {
|
if (trigger()->region ()) {
|
||||||
name_text->set (short_version (_trigger.name (), 16));
|
name_text->set (short_version (trigger()->name (), 16));
|
||||||
} else {
|
} else {
|
||||||
name_text->set ("");
|
name_text->set ("");
|
||||||
}
|
}
|
||||||
|
|
@ -422,7 +428,7 @@ TriggerEntry::set_default_colors ()
|
||||||
name_button->set_fill_color (UIConfiguration::instance ().color ("theme:bg"));
|
name_button->set_fill_color (UIConfiguration::instance ().color ("theme:bg"));
|
||||||
name_button->set_outline_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"));
|
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 ());
|
set_fill_color (HSV (fill_color ()).darker (0.15).color ());
|
||||||
play_button->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 ());
|
name_button->set_fill_color (HSV (fill_color ()).darker (0.15).color ());
|
||||||
|
|
@ -534,7 +540,7 @@ TriggerBoxUI::trigger_scene (int32_t n)
|
||||||
void
|
void
|
||||||
TriggerBoxUI::build ()
|
TriggerBoxUI::build ()
|
||||||
{
|
{
|
||||||
Trigger* t;
|
TriggerPtr t;
|
||||||
uint64_t n = 0;
|
uint64_t n = 0;
|
||||||
|
|
||||||
// clear_items (true);
|
// clear_items (true);
|
||||||
|
|
@ -546,7 +552,7 @@ TriggerBoxUI::build ()
|
||||||
if (!t) {
|
if (!t) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
TriggerEntry* te = new TriggerEntry (this, *t);
|
TriggerEntry* te = new TriggerEntry (this, TriggerReference (_triggerbox, n));
|
||||||
|
|
||||||
_slots.push_back (te);
|
_slots.push_back (te);
|
||||||
|
|
||||||
|
|
@ -651,7 +657,7 @@ TriggerBoxUI::play_button_event (GdkEvent* ev, uint64_t n)
|
||||||
case GDK_BUTTON_PRESS:
|
case GDK_BUTTON_PRESS:
|
||||||
switch (ev->button.button) {
|
switch (ev->button.button) {
|
||||||
case 1:
|
case 1:
|
||||||
_slots[n]->trigger ().bang ();
|
_slots[n]->trigger()->bang ();
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -660,9 +666,9 @@ TriggerBoxUI::play_button_event (GdkEvent* ev, uint64_t n)
|
||||||
case GDK_BUTTON_RELEASE:
|
case GDK_BUTTON_RELEASE:
|
||||||
switch (ev->button.button) {
|
switch (ev->button.button) {
|
||||||
case 1:
|
case 1:
|
||||||
if (_slots[n]->trigger ().launch_style () == Trigger::Gate ||
|
if (_slots[n]->trigger()->launch_style () == Trigger::Gate ||
|
||||||
_slots[n]->trigger ().launch_style () == Trigger::Repeat) {
|
_slots[n]->trigger()->launch_style () == Trigger::Repeat) {
|
||||||
_slots[n]->trigger ().unbang ();
|
_slots[n]->trigger()->unbang ();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
|
@ -925,7 +931,7 @@ TriggerBoxUI::toggle_trigger_isolated (uint64_t n)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Trigger* trigger = _triggerbox.trigger (n);
|
TriggerPtr trigger = _triggerbox.trigger (n);
|
||||||
trigger->set_scene_isolated (!trigger->scene_isolated ());
|
trigger->set_scene_isolated (!trigger->scene_isolated ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -933,7 +939,7 @@ void
|
||||||
TriggerBoxUI::clear_trigger (uint64_t n)
|
TriggerBoxUI::clear_trigger (uint64_t n)
|
||||||
{
|
{
|
||||||
#if 0 // XXX
|
#if 0 // XXX
|
||||||
Trigger* trigger = _triggerbox.trigger (n);
|
TriggerPtr trigger = _triggerbox.trigger (n);
|
||||||
trigger->clear_trigger();
|
trigger->clear_trigger();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -941,7 +947,7 @@ TriggerBoxUI::clear_trigger (uint64_t n)
|
||||||
void
|
void
|
||||||
TriggerBoxUI::edit_trigger (uint64_t n)
|
TriggerBoxUI::edit_trigger (uint64_t n)
|
||||||
{
|
{
|
||||||
Trigger* trigger = _triggerbox.trigger (n);
|
TriggerPtr trigger = _triggerbox.trigger (n);
|
||||||
TriggerWindow* tw = static_cast<TriggerWindow*> (trigger->ui ());
|
TriggerWindow* tw = static_cast<TriggerWindow*> (trigger->ui ());
|
||||||
|
|
||||||
if (!tw) {
|
if (!tw) {
|
||||||
|
|
|
||||||
|
|
@ -45,15 +45,25 @@ namespace ArdourCanvas
|
||||||
class Polygon;
|
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
|
class TriggerEntry : public ArdourCanvas::Rectangle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TriggerEntry (ArdourCanvas::Item* item, ARDOUR::Trigger&);
|
TriggerEntry (ArdourCanvas::Item* item, TriggerReference rf);
|
||||||
~TriggerEntry ();
|
~TriggerEntry ();
|
||||||
|
|
||||||
ARDOUR::Trigger& trigger () const
|
boost::shared_ptr<ARDOUR::Trigger> trigger () const
|
||||||
{
|
{
|
||||||
return _trigger;
|
return tref.trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArdourCanvas::Rectangle* play_button;
|
ArdourCanvas::Rectangle* play_button;
|
||||||
|
|
@ -74,7 +84,7 @@ public:
|
||||||
void set_default_colors ();
|
void set_default_colors ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARDOUR::Trigger& _trigger;
|
TriggerReference tref;
|
||||||
double _poly_size;
|
double _poly_size;
|
||||||
double _poly_margin;
|
double _poly_margin;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue