mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Do not dynamically allocate persistent widgets
This commit is contained in:
parent
be7882d7a7
commit
e5d40e86e7
2 changed files with 49 additions and 83 deletions
|
|
@ -37,15 +37,7 @@
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
|
|
||||||
#include "audio_region_operations_box.h"
|
|
||||||
#include "audio_region_properties_box.h"
|
|
||||||
#include "midi_clip_editor.h"
|
|
||||||
#include "midi_region_operations_box.h"
|
|
||||||
#include "midi_region_properties_box.h"
|
|
||||||
#include "slot_properties_box.h"
|
|
||||||
|
|
||||||
#include "cuebox_ui.h"
|
#include "cuebox_ui.h"
|
||||||
#include "trigger_master.h"
|
|
||||||
#include "trigger_page.h"
|
#include "trigger_page.h"
|
||||||
#include "trigger_strip.h"
|
#include "trigger_strip.h"
|
||||||
#include "ui_config.h"
|
#include "ui_config.h"
|
||||||
|
|
@ -64,6 +56,7 @@ using namespace std;
|
||||||
TriggerPage::TriggerPage ()
|
TriggerPage::TriggerPage ()
|
||||||
: Tabbable (_content, _("Trigger Drom"), X_("trigger"))
|
: Tabbable (_content, _("Trigger Drom"), X_("trigger"))
|
||||||
, _master_widget (32, 16.)
|
, _master_widget (32, 16.)
|
||||||
|
, _master (_master_widget.root ())
|
||||||
{
|
{
|
||||||
load_bindings ();
|
load_bindings ();
|
||||||
register_actions ();
|
register_actions ();
|
||||||
|
|
@ -75,44 +68,30 @@ TriggerPage::TriggerPage ()
|
||||||
|
|
||||||
CueBoxWidget* cue_box = manage (new CueBoxWidget (32, TriggerBox::default_triggers_per_box * 16.));
|
CueBoxWidget* cue_box = manage (new CueBoxWidget (32, TriggerBox::default_triggers_per_box * 16.));
|
||||||
_slot_area_box.pack_start (*cue_box, Gtk::PACK_SHRINK);
|
_slot_area_box.pack_start (*cue_box, Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
_master = new CueMaster (_master_widget.root ());
|
|
||||||
_slot_area_box.pack_start (_master_widget, Gtk::PACK_SHRINK);
|
_slot_area_box.pack_start (_master_widget, Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
_midi_prop_box = new MidiRegionPropertiesBox ();
|
|
||||||
_slot_prop_box = new SlotPropertiesBox ();
|
|
||||||
|
|
||||||
_audio_prop_box = new AudioRegionPropertiesBox ();
|
|
||||||
_midi_prop_box = new MidiRegionPropertiesBox ();
|
|
||||||
|
|
||||||
_audio_ops_box = new AudioRegionOperationsBox ();
|
|
||||||
_midi_ops_box = new MidiRegionOperationsBox ();
|
|
||||||
|
|
||||||
_audio_trim_box = new AudioClipEditorBox ();
|
|
||||||
_midi_trim_box = new MidiClipEditorBox ();
|
|
||||||
|
|
||||||
Gtk::Table* table = manage (new Gtk::Table);
|
Gtk::Table* table = manage (new Gtk::Table);
|
||||||
table->set_homogeneous (false);
|
table->set_homogeneous (false);
|
||||||
table->set_spacings (8);
|
table->set_spacings (8);
|
||||||
table->set_border_width (8);
|
table->set_border_width (8);
|
||||||
|
|
||||||
int col = 0;
|
int col = 0;
|
||||||
table->attach (*_slot_prop_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
table->attach (_slot_prop_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
|
|
||||||
col = 1;
|
col = 1;
|
||||||
table->attach (*_audio_prop_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
table->attach (_audio_prop_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
col++;
|
col++;
|
||||||
table->attach (*_audio_trim_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
table->attach (_audio_trim_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
col++;
|
col++;
|
||||||
table->attach (*_audio_ops_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
table->attach (_audio_ops_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
col++;
|
col++;
|
||||||
|
|
||||||
col = 1; /* audio and midi boxen share the same table locations; shown and hidden depending on region type */
|
col = 1; /* audio and midi boxen share the same table locations; shown and hidden depending on region type */
|
||||||
table->attach (*_midi_prop_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
table->attach (_midi_prop_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
col++;
|
col++;
|
||||||
table->attach (*_midi_trim_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
table->attach (_midi_trim_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
col++;
|
col++;
|
||||||
table->attach (*_midi_ops_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
table->attach (_midi_ops_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
col++;
|
col++;
|
||||||
|
|
||||||
_parameter_box.pack_start (*table);
|
_parameter_box.pack_start (*table);
|
||||||
|
|
@ -175,18 +154,6 @@ TriggerPage::TriggerPage ()
|
||||||
|
|
||||||
TriggerPage::~TriggerPage ()
|
TriggerPage::~TriggerPage ()
|
||||||
{
|
{
|
||||||
delete _master;
|
|
||||||
|
|
||||||
delete _slot_prop_box;
|
|
||||||
|
|
||||||
delete _audio_ops_box;
|
|
||||||
delete _midi_ops_box;
|
|
||||||
|
|
||||||
delete _audio_prop_box;
|
|
||||||
delete _midi_prop_box;
|
|
||||||
|
|
||||||
delete _audio_trim_box;
|
|
||||||
delete _midi_trim_box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtk::Window*
|
Gtk::Window*
|
||||||
|
|
@ -266,15 +233,15 @@ TriggerPage::set_session (Session* s)
|
||||||
|
|
||||||
initial_track_display ();
|
initial_track_display ();
|
||||||
|
|
||||||
_slot_prop_box->set_session (s);
|
_slot_prop_box.set_session (s);
|
||||||
|
|
||||||
_audio_prop_box->set_session (s);
|
_audio_prop_box.set_session (s);
|
||||||
_audio_ops_box->set_session (s);
|
_audio_ops_box.set_session (s);
|
||||||
_audio_trim_box->set_session (s);
|
_audio_trim_box.set_session (s);
|
||||||
|
|
||||||
_midi_prop_box->set_session (s);
|
_midi_prop_box.set_session (s);
|
||||||
_midi_ops_box->set_session (s);
|
_midi_ops_box.set_session (s);
|
||||||
_midi_trim_box->set_session (s);
|
_midi_trim_box.set_session (s);
|
||||||
|
|
||||||
update_title ();
|
update_title ();
|
||||||
start_updating ();
|
start_updating ();
|
||||||
|
|
@ -346,15 +313,15 @@ TriggerPage::selection_changed ()
|
||||||
{
|
{
|
||||||
Selection& selection (Editor::instance ().get_selection ());
|
Selection& selection (Editor::instance ().get_selection ());
|
||||||
|
|
||||||
_slot_prop_box->hide ();
|
_slot_prop_box.hide ();
|
||||||
|
|
||||||
_audio_ops_box->hide ();
|
_audio_ops_box.hide ();
|
||||||
_audio_prop_box->hide ();
|
_audio_prop_box.hide ();
|
||||||
_audio_trim_box->hide ();
|
_audio_trim_box.hide ();
|
||||||
|
|
||||||
_midi_ops_box->hide ();
|
_midi_ops_box.hide ();
|
||||||
_midi_prop_box->hide ();
|
_midi_prop_box.hide ();
|
||||||
_midi_trim_box->hide ();
|
_midi_trim_box.hide ();
|
||||||
|
|
||||||
_parameter_box.hide ();
|
_parameter_box.hide ();
|
||||||
|
|
||||||
|
|
@ -363,23 +330,23 @@ TriggerPage::selection_changed ()
|
||||||
TriggerEntry* entry = *ts.begin ();
|
TriggerEntry* entry = *ts.begin ();
|
||||||
Trigger* slot = &entry->trigger ();
|
Trigger* slot = &entry->trigger ();
|
||||||
|
|
||||||
_slot_prop_box->set_slot (slot);
|
_slot_prop_box.set_slot (slot);
|
||||||
_slot_prop_box->show ();
|
_slot_prop_box.show ();
|
||||||
if (slot->region ()) {
|
if (slot->region ()) {
|
||||||
if (slot->region ()->data_type () == DataType::AUDIO) {
|
if (slot->region ()->data_type () == DataType::AUDIO) {
|
||||||
_audio_prop_box->set_region (slot->region ());
|
_audio_prop_box.set_region (slot->region ());
|
||||||
_audio_trim_box->set_region (slot->region ());
|
_audio_trim_box.set_region (slot->region ());
|
||||||
|
|
||||||
_audio_prop_box->show ();
|
_audio_prop_box.show ();
|
||||||
_audio_trim_box->show ();
|
_audio_trim_box.show ();
|
||||||
_audio_ops_box->show ();
|
_audio_ops_box.show ();
|
||||||
} else {
|
} else {
|
||||||
_midi_prop_box->set_region (slot->region ());
|
_midi_prop_box.set_region (slot->region ());
|
||||||
_midi_trim_box->set_region (slot->region ());
|
_midi_trim_box.set_region (slot->region ());
|
||||||
|
|
||||||
_midi_prop_box->show ();
|
_midi_prop_box.show ();
|
||||||
_midi_trim_box->show ();
|
_midi_trim_box.show ();
|
||||||
_midi_ops_box->show ();
|
_midi_ops_box.show ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_parameter_box.show ();
|
_parameter_box.show ();
|
||||||
|
|
|
||||||
|
|
@ -29,18 +29,17 @@
|
||||||
#include "widgets/pane.h"
|
#include "widgets/pane.h"
|
||||||
#include "widgets/tabbable.h"
|
#include "widgets/tabbable.h"
|
||||||
|
|
||||||
|
#include "audio_region_operations_box.h"
|
||||||
|
#include "audio_region_properties_box.h"
|
||||||
#include "fitted_canvas_widget.h"
|
#include "fitted_canvas_widget.h"
|
||||||
|
#include "midi_clip_editor.h"
|
||||||
|
#include "midi_region_operations_box.h"
|
||||||
|
#include "midi_region_properties_box.h"
|
||||||
|
#include "slot_properties_box.h"
|
||||||
#include "trigger_clip_picker.h"
|
#include "trigger_clip_picker.h"
|
||||||
|
#include "trigger_master.h"
|
||||||
|
|
||||||
class TriggerStrip;
|
class TriggerStrip;
|
||||||
class CueMaster;
|
|
||||||
class SlotPropertiesBox;
|
|
||||||
class AudioRegionPropertiesBox;
|
|
||||||
class MidiRegionPropertiesBox;
|
|
||||||
class AudioRegionOperationsBox;
|
|
||||||
class MidiRegionOperationsBox;
|
|
||||||
class AudioClipEditorBox;
|
|
||||||
class MidiClipEditorBox;
|
|
||||||
|
|
||||||
class TriggerPage : public ArdourWidgets::Tabbable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
|
class TriggerPage : public ArdourWidgets::Tabbable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
|
||||||
{
|
{
|
||||||
|
|
@ -92,17 +91,17 @@ private:
|
||||||
TriggerClipPicker _trigger_clip_picker;
|
TriggerClipPicker _trigger_clip_picker;
|
||||||
|
|
||||||
FittedCanvasWidget _master_widget;
|
FittedCanvasWidget _master_widget;
|
||||||
CueMaster* _master;
|
CueMaster _master;
|
||||||
|
|
||||||
SlotPropertiesBox* _slot_prop_box;
|
SlotPropertiesBox _slot_prop_box;
|
||||||
|
|
||||||
AudioRegionPropertiesBox* _audio_prop_box;
|
AudioRegionPropertiesBox _audio_prop_box;
|
||||||
AudioRegionOperationsBox* _audio_ops_box;
|
AudioRegionOperationsBox _audio_ops_box;
|
||||||
AudioClipEditorBox* _audio_trim_box;
|
AudioClipEditorBox _audio_trim_box;
|
||||||
|
|
||||||
MidiRegionPropertiesBox* _midi_prop_box;
|
MidiRegionPropertiesBox _midi_prop_box;
|
||||||
MidiRegionOperationsBox* _midi_ops_box;
|
MidiRegionOperationsBox _midi_ops_box;
|
||||||
MidiClipEditorBox* _midi_trim_box;
|
MidiClipEditorBox _midi_trim_box;
|
||||||
|
|
||||||
std::list<TriggerStrip*> _strips;
|
std::list<TriggerStrip*> _strips;
|
||||||
sigc::connection _fast_screen_update_connection;
|
sigc::connection _fast_screen_update_connection;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue