mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
NO-OP: clang-format, cleanup
This commit is contained in:
parent
96e1735646
commit
efed7343e0
12 changed files with 430 additions and 499 deletions
|
|
@ -17,12 +17,12 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "gtkmm2ext/actions.h"
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/utils.h"
|
#include "gtkmm2ext/utils.h"
|
||||||
#include "gtkmm2ext/actions.h"
|
|
||||||
|
|
||||||
#include "canvas/canvas.h"
|
#include "canvas/canvas.h"
|
||||||
#include "canvas/debug.h"
|
#include "canvas/debug.h"
|
||||||
|
|
@ -56,27 +56,25 @@ using namespace ARDOUR;
|
||||||
using namespace ArdourCanvas;
|
using namespace ArdourCanvas;
|
||||||
using namespace ArdourWaveView;
|
using namespace ArdourWaveView;
|
||||||
using namespace ArdourWidgets;
|
using namespace ArdourWidgets;
|
||||||
using std::min;
|
|
||||||
using std::max;
|
using std::max;
|
||||||
|
using std::min;
|
||||||
|
|
||||||
Glib::RefPtr<Gtk::ActionGroup> ClipEditorBox::clip_editor_actions;
|
Glib::RefPtr<Gtk::ActionGroup> ClipEditorBox::clip_editor_actions;
|
||||||
|
|
||||||
void
|
void
|
||||||
ClipEditorBox::init ()
|
ClipEditorBox::init ()
|
||||||
{
|
{
|
||||||
Bindings* bindings = Bindings::get_bindings (X_("Clip Editing"));
|
Bindings* bindings = Bindings::get_bindings (X_ ("Clip Editing"));
|
||||||
|
|
||||||
register_clip_editor_actions (bindings);
|
register_clip_editor_actions (bindings);
|
||||||
|
|
||||||
//_track_canvas_viewport->canvas()->set_data ("ardour-bindings",
|
//_track_canvas_viewport->canvas()->set_data ("ardour-bindings", midi_bindings);
|
||||||
//midi_bindings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClipEditorBox::register_clip_editor_actions (Bindings* clip_editor_bindings)
|
ClipEditorBox::register_clip_editor_actions (Bindings* clip_editor_bindings)
|
||||||
{
|
{
|
||||||
clip_editor_actions = ActionManager::create_action_group (clip_editor_bindings, X_("ClipEditing"));
|
clip_editor_actions = ActionManager::create_action_group (clip_editor_bindings, X_ ("ClipEditing"));
|
||||||
|
|
||||||
/* two versions to allow same action for Delete and Backspace */
|
/* two versions to allow same action for Delete and Backspace */
|
||||||
|
|
||||||
|
|
@ -84,45 +82,20 @@ ClipEditorBox::register_clip_editor_actions (Bindings* clip_editor_bindings)
|
||||||
// ActionManager::register_action (clip_editor_actions, X_("zoom-in"), _("Zoom In"), sigc::mem_fun (*this, &ClipEditorBox::zoom_out));
|
// ActionManager::register_action (clip_editor_actions, X_("zoom-in"), _("Zoom In"), sigc::mem_fun (*this, &ClipEditorBox::zoom_out));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------ */
|
|
||||||
|
|
||||||
class ClipBBTMetric : public ArdourCanvas::Ruler::Metric
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ClipBBTMetric () { units_per_pixel = 1; }
|
|
||||||
|
|
||||||
void get_marks (std::vector<ArdourCanvas::Ruler::Mark>& marks, int64_t lower, int64_t upper, int maxchars) const {
|
|
||||||
ArdourCanvas::Ruler::Mark mark;
|
|
||||||
|
|
||||||
std::cerr << "get marks between " << lower << " .. " << upper << std::endl;
|
|
||||||
|
|
||||||
for (int64_t n = lower; n < upper; n += 4000) {
|
|
||||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
|
||||||
mark.label = string_compose ("%1", n);
|
|
||||||
mark.position = n / 100;
|
|
||||||
marks.push_back (mark);
|
|
||||||
std::cerr << "mark at " << mark.label << " @ " << mark.position << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
AudioClipEditor::AudioClipEditor ()
|
AudioClipEditor::AudioClipEditor ()
|
||||||
: _spp (0)
|
: _spp (0)
|
||||||
, scroll_fraction (0)
|
, scroll_fraction (0)
|
||||||
, current_line_drag (0)
|
, current_line_drag (0)
|
||||||
, current_scroll_drag (0)
|
, current_scroll_drag (0)
|
||||||
{
|
{
|
||||||
const double scale = UIConfiguration::instance().get_ui_scale();
|
const double scale = UIConfiguration::instance ().get_ui_scale ();
|
||||||
|
|
||||||
frame = new Rectangle (root());
|
frame = new Rectangle (root ());
|
||||||
frame->name = "audio clip editor frame";
|
frame->name = "audio clip editor frame";
|
||||||
frame->set_fill (false);
|
frame->set_fill (false);
|
||||||
frame->Event.connect (sigc::mem_fun (*this, &AudioClipEditor::event_handler));
|
frame->Event.connect (sigc::mem_fun (*this, &AudioClipEditor::event_handler));
|
||||||
|
|
||||||
scroll_bar_trough = new Rectangle (root());
|
scroll_bar_trough = new Rectangle (root ());
|
||||||
scroll_bar_handle = new Rectangle (scroll_bar_trough);
|
scroll_bar_handle = new Rectangle (scroll_bar_trough);
|
||||||
scroll_bar_handle->set_outline (false);
|
scroll_bar_handle->set_outline (false);
|
||||||
scroll_bar_handle->set_corner_radius (5.);
|
scroll_bar_handle->set_corner_radius (5.);
|
||||||
|
|
@ -133,10 +106,10 @@ AudioClipEditor::AudioClipEditor ()
|
||||||
|
|
||||||
clip_metric = new ClipBBTMetric ();
|
clip_metric = new ClipBBTMetric ();
|
||||||
|
|
||||||
ruler_container = new ArdourCanvas::Container (waves_container);
|
ruler_container = new ArdourCanvas::Container (waves_container);
|
||||||
ruler = new ArdourCanvas::Ruler (ruler_container, *clip_metric);
|
ruler = new ArdourCanvas::Ruler (ruler_container, *clip_metric);
|
||||||
ruler->name = "Clip Editor";
|
ruler->name = "Clip Editor";
|
||||||
ruler->set_font_description (UIConfiguration::instance().get_SmallerFont());
|
ruler->set_font_description (UIConfiguration::instance ().get_SmallerFont ());
|
||||||
|
|
||||||
line_container = new ArdourCanvas::Container (waves_container);
|
line_container = new ArdourCanvas::Container (waves_container);
|
||||||
|
|
||||||
|
|
@ -168,35 +141,34 @@ AudioClipEditor::~AudioClipEditor ()
|
||||||
bool
|
bool
|
||||||
AudioClipEditor::line_event_handler (GdkEvent* ev, ArdourCanvas::Line* l)
|
AudioClipEditor::line_event_handler (GdkEvent* ev, ArdourCanvas::Line* l)
|
||||||
{
|
{
|
||||||
std::cerr << "event type " << Gtkmm2ext::event_type_string (ev->type) << " on line " << std::endl;
|
std::cerr << "event type " << Gtkmm2ext::event_type_string (ev->type) << " on line " << std::endl;
|
||||||
|
|
||||||
switch (ev->type) {
|
switch (ev->type) {
|
||||||
case GDK_BUTTON_PRESS:
|
case GDK_BUTTON_PRESS:
|
||||||
current_line_drag = new LineDrag (*this, *l);
|
current_line_drag = new LineDrag (*this, *l);
|
||||||
return true;
|
|
||||||
|
|
||||||
case GDK_BUTTON_RELEASE:
|
|
||||||
if (current_line_drag) {
|
|
||||||
current_line_drag->end (&ev->button);
|
|
||||||
delete current_line_drag;
|
|
||||||
current_line_drag = 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GDK_MOTION_NOTIFY:
|
case GDK_BUTTON_RELEASE:
|
||||||
if (current_line_drag) {
|
if (current_line_drag) {
|
||||||
current_line_drag->motion (&ev->motion);
|
current_line_drag->end (&ev->button);
|
||||||
return true;
|
delete current_line_drag;
|
||||||
}
|
current_line_drag = 0;
|
||||||
break;
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GDK_MOTION_NOTIFY:
|
||||||
|
if (current_line_drag) {
|
||||||
|
current_line_drag->motion (&ev->motion);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case GDK_KEY_PRESS:
|
case GDK_KEY_PRESS:
|
||||||
return key_press (&ev->key);
|
return key_press (&ev->key);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -206,33 +178,32 @@ bool
|
||||||
AudioClipEditor::scroll_event_handler (GdkEvent* ev)
|
AudioClipEditor::scroll_event_handler (GdkEvent* ev)
|
||||||
{
|
{
|
||||||
switch (ev->type) {
|
switch (ev->type) {
|
||||||
case GDK_BUTTON_PRESS:
|
case GDK_BUTTON_PRESS:
|
||||||
current_scroll_drag = new ScrollDrag (*this);
|
current_scroll_drag = new ScrollDrag (*this);
|
||||||
current_scroll_drag->begin (&ev->button);
|
current_scroll_drag->begin (&ev->button);
|
||||||
return true;
|
|
||||||
|
|
||||||
case GDK_BUTTON_RELEASE:
|
|
||||||
if (current_scroll_drag) {
|
|
||||||
current_scroll_drag->end (&ev->button);
|
|
||||||
delete current_scroll_drag;
|
|
||||||
current_scroll_drag = 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GDK_MOTION_NOTIFY:
|
case GDK_BUTTON_RELEASE:
|
||||||
if (current_scroll_drag) {
|
if (current_scroll_drag) {
|
||||||
current_scroll_drag->motion (&ev->motion);
|
current_scroll_drag->end (&ev->button);
|
||||||
return true;
|
delete current_scroll_drag;
|
||||||
}
|
current_scroll_drag = 0;
|
||||||
break;
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GDK_MOTION_NOTIFY:
|
||||||
|
if (current_scroll_drag) {
|
||||||
|
current_scroll_drag->motion (&ev->motion);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case GDK_KEY_PRESS:
|
case GDK_KEY_PRESS:
|
||||||
return key_press (&ev->key);
|
return key_press (&ev->key);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -251,11 +222,11 @@ AudioClipEditor::position_lines ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
start_line->set_x0 (sample_to_pixel (audio_region->start().samples()));
|
start_line->set_x0 (sample_to_pixel (audio_region->start ().samples ()));
|
||||||
start_line->set_x1 (sample_to_pixel (audio_region->start().samples()));
|
start_line->set_x1 (sample_to_pixel (audio_region->start ().samples ()));
|
||||||
|
|
||||||
end_line->set_x0 (sample_to_pixel (audio_region->end().samples()));
|
end_line->set_x0 (sample_to_pixel (audio_region->end ().samples ()));
|
||||||
end_line->set_x1 (sample_to_pixel (audio_region->end().samples()));
|
end_line->set_x1 (sample_to_pixel (audio_region->end ().samples ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double
|
||||||
|
|
@ -270,12 +241,11 @@ AudioClipEditor::pixel_to_sample (double p)
|
||||||
return round (p * _spp);
|
return round (p * _spp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AudioClipEditor::LineDrag::LineDrag (AudioClipEditor& ed, ArdourCanvas::Line& l)
|
AudioClipEditor::LineDrag::LineDrag (AudioClipEditor& ed, ArdourCanvas::Line& l)
|
||||||
: editor (ed)
|
: editor (ed)
|
||||||
, line (l)
|
, line (l)
|
||||||
{
|
{
|
||||||
line.grab();
|
line.grab ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -286,7 +256,7 @@ AudioClipEditor::LineDrag::begin (GdkEventButton* ev)
|
||||||
void
|
void
|
||||||
AudioClipEditor::LineDrag::end (GdkEventButton* ev)
|
AudioClipEditor::LineDrag::end (GdkEventButton* ev)
|
||||||
{
|
{
|
||||||
line.ungrab();
|
line.ungrab ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -299,20 +269,17 @@ AudioClipEditor::LineDrag::motion (GdkEventMotion* ev)
|
||||||
void
|
void
|
||||||
AudioClipEditor::set_colors ()
|
AudioClipEditor::set_colors ()
|
||||||
{
|
{
|
||||||
set_background_color (UIConfiguration::instance().color (X_("theme:bg")));
|
set_background_color (UIConfiguration::instance ().color (X_ ("theme:bg")));
|
||||||
|
|
||||||
frame->set_outline_color (UIConfiguration::instance().color (X_("neutral:midground")));
|
frame->set_outline_color (UIConfiguration::instance ().color (X_ ("neutral:midground")));
|
||||||
|
|
||||||
ruler->set_fill_color (UIConfiguration::instance().color (X_("theme:bg1")));
|
start_line->set_outline_color (UIConfiguration::instance ().color (X_ ("theme:contrasting clock")));
|
||||||
ruler->set_outline_color (UIConfiguration::instance().color (X_("theme:contrasting less")));
|
end_line->set_outline_color (UIConfiguration::instance ().color (X_ ("theme:contrasting alt")));
|
||||||
|
loop_line->set_outline_color (UIConfiguration::instance ().color (X_ ("theme:contrasting selection")));
|
||||||
|
|
||||||
start_line->set_outline_color (UIConfiguration::instance().color (X_("theme:contrasting clock")));
|
scroll_bar_trough->set_fill_color (UIConfiguration::instance ().color (X_ ("theme:bg")));
|
||||||
end_line->set_outline_color (UIConfiguration::instance().color (X_("theme:contrasting alt")));
|
scroll_bar_trough->set_outline_color (UIConfiguration::instance ().color (X_ ("theme:contrasting less")));
|
||||||
loop_line->set_outline_color (UIConfiguration::instance().color (X_("theme:contrasting selection")));
|
scroll_bar_handle->set_fill_color (UIConfiguration::instance ().color (X_ ("theme:contrasting clock")));
|
||||||
|
|
||||||
scroll_bar_trough->set_fill_color (UIConfiguration::instance().color (X_("theme:bg")));
|
|
||||||
scroll_bar_trough->set_outline_color (UIConfiguration::instance().color (X_("theme:contrasting less")));
|
|
||||||
scroll_bar_handle->set_fill_color (UIConfiguration::instance().color (X_("theme:contrasting clock")));
|
|
||||||
|
|
||||||
set_waveform_colors ();
|
set_waveform_colors ();
|
||||||
}
|
}
|
||||||
|
|
@ -324,20 +291,20 @@ AudioClipEditor::scroll_changed ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const double right_edge = scroll_bar_handle->get().x0;
|
const double right_edge = scroll_bar_handle->get ().x0;
|
||||||
const double avail_width = scroll_bar_trough->get().width() - scroll_bar_handle->get().width();
|
const double avail_width = scroll_bar_trough->get ().width () - scroll_bar_handle->get ().width ();
|
||||||
scroll_fraction = right_edge / avail_width;
|
scroll_fraction = right_edge / avail_width;
|
||||||
scroll_fraction = std::min (1., std::max (0., scroll_fraction));
|
scroll_fraction = std::min (1., std::max (0., scroll_fraction));
|
||||||
const samplepos_t s = llrintf (audio_region->source (0)->length().samples () * scroll_fraction);
|
const samplepos_t s = llrintf (audio_region->source (0)->length ().samples () * scroll_fraction);
|
||||||
|
|
||||||
scroll_to (sample_to_pixel (s), 0);
|
scroll_to (sample_to_pixel (s), 0);
|
||||||
queue_draw ();
|
queue_draw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioClipEditor::ScrollDrag::ScrollDrag (AudioClipEditor& e)
|
AudioClipEditor::ScrollDrag::ScrollDrag (AudioClipEditor& e)
|
||||||
: editor (e)
|
: editor (e)
|
||||||
{
|
{
|
||||||
e.scroll_bar_handle->grab();
|
e.scroll_bar_handle->grab ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -357,10 +324,10 @@ void
|
||||||
AudioClipEditor::ScrollDrag::motion (GdkEventMotion* ev)
|
AudioClipEditor::ScrollDrag::motion (GdkEventMotion* ev)
|
||||||
{
|
{
|
||||||
ArdourCanvas::Rectangle& r (*editor.scroll_bar_handle);
|
ArdourCanvas::Rectangle& r (*editor.scroll_bar_handle);
|
||||||
const double xdelta = ev->x - last_x;
|
const double xdelta = ev->x - last_x;
|
||||||
ArdourCanvas::Rect n (r.get());
|
ArdourCanvas::Rect n (r.get ());
|
||||||
const double handle_width = n.width();
|
const double handle_width = n.width ();
|
||||||
const double avail_width = editor.scroll_bar_trough->get().width() - handle_width;
|
const double avail_width = editor.scroll_bar_trough->get ().width () - handle_width;
|
||||||
|
|
||||||
n.x0 = std::max (0., std::min (avail_width, n.x0 + xdelta));
|
n.x0 = std::max (0., std::min (avail_width, n.x0 + xdelta));
|
||||||
n.x1 = n.x0 + handle_width;
|
n.x1 = n.x0 + handle_width;
|
||||||
|
|
@ -374,7 +341,7 @@ AudioClipEditor::ScrollDrag::motion (GdkEventMotion* ev)
|
||||||
void
|
void
|
||||||
AudioClipEditor::drop_waves ()
|
AudioClipEditor::drop_waves ()
|
||||||
{
|
{
|
||||||
for (auto & wave : waves) {
|
for (auto& wave : waves) {
|
||||||
delete wave;
|
delete wave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -388,13 +355,12 @@ AudioClipEditor::set_region (boost::shared_ptr<AudioRegion> r)
|
||||||
|
|
||||||
audio_region = r;
|
audio_region = r;
|
||||||
|
|
||||||
uint32_t n_chans = r->n_channels ();
|
uint32_t n_chans = r->n_channels ();
|
||||||
samplecnt_t len;
|
samplecnt_t len;
|
||||||
|
|
||||||
len = r->source (0)->length().samples ();
|
len = r->source (0)->length ().samples ();
|
||||||
|
|
||||||
for (uint32_t n = 0; n < n_chans; ++n) {
|
for (uint32_t n = 0; n < n_chans; ++n) {
|
||||||
|
|
||||||
boost::shared_ptr<Region> wr = RegionFactory::get_whole_region_for_source (r->source (n));
|
boost::shared_ptr<Region> wr = RegionFactory::get_whole_region_for_source (r->source (n));
|
||||||
if (!wr) {
|
if (!wr) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -427,24 +393,21 @@ AudioClipEditor::on_size_allocate (Gtk::Allocation& alloc)
|
||||||
{
|
{
|
||||||
GtkCanvas::on_size_allocate (alloc);
|
GtkCanvas::on_size_allocate (alloc);
|
||||||
|
|
||||||
ArdourCanvas::Rect r (1, 1, alloc.get_width() - 2, alloc.get_height() - 2);
|
ArdourCanvas::Rect r (1, 1, alloc.get_width () - 2, alloc.get_height () - 2);
|
||||||
frame->set (r);
|
frame->set (r);
|
||||||
|
|
||||||
const double ruler_height = 25.;
|
const double scroll_bar_height = 10.;
|
||||||
ruler->set (Rect (2, 2, alloc.get_width() - 4, ruler_height));
|
const double scroll_bar_width = alloc.get_width () - 2;
|
||||||
|
|
||||||
const double scroll_bar_height = 10.;
|
|
||||||
const double scroll_bar_width = alloc.get_width() - 2;
|
|
||||||
const double scroll_bar_handle_left = scroll_bar_width * scroll_fraction;
|
const double scroll_bar_handle_left = scroll_bar_width * scroll_fraction;
|
||||||
|
|
||||||
scroll_bar_trough->set (Rect (1, alloc.get_height() - scroll_bar_height, scroll_bar_width, alloc.get_height()));
|
scroll_bar_trough->set (Rect (1, alloc.get_height () - scroll_bar_height, scroll_bar_width, alloc.get_height ()));
|
||||||
scroll_bar_handle->set (Rect (scroll_bar_handle_left, scroll_bar_trough->get().y0 + 1, scroll_bar_handle_left + 30., scroll_bar_trough->get().y1 - 1));
|
scroll_bar_handle->set (Rect (scroll_bar_handle_left, scroll_bar_trough->get ().y0 + 1, scroll_bar_handle_left + 30., scroll_bar_trough->get ().y1 - 1));
|
||||||
|
|
||||||
position_lines ();
|
position_lines ();
|
||||||
|
|
||||||
start_line->set_y1 (frame->get().height() - 2. - scroll_bar_height);
|
start_line->set_y1 (frame->get ().height () - 2. - scroll_bar_height);
|
||||||
end_line->set_y1 (frame->get().height() - 2. - scroll_bar_height);
|
end_line->set_y1 (frame->get ().height () - 2. - scroll_bar_height);
|
||||||
loop_line->set_y1 (frame->get().height() - 2. - scroll_bar_height);
|
loop_line->set_y1 (frame->get ().height () - 2. - scroll_bar_height);
|
||||||
|
|
||||||
set_wave_heights ();
|
set_wave_heights ();
|
||||||
}
|
}
|
||||||
|
|
@ -458,7 +421,7 @@ AudioClipEditor::set_spp (double samples_per_pixel)
|
||||||
|
|
||||||
position_lines ();
|
position_lines ();
|
||||||
|
|
||||||
for (auto & wave : waves) {
|
for (auto& wave : waves) {
|
||||||
wave->set_samples_per_pixel (_spp);
|
wave->set_samples_per_pixel (_spp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -466,8 +429,8 @@ AudioClipEditor::set_spp (double samples_per_pixel)
|
||||||
void
|
void
|
||||||
AudioClipEditor::set_spp_from_length (samplecnt_t len)
|
AudioClipEditor::set_spp_from_length (samplecnt_t len)
|
||||||
{
|
{
|
||||||
double available_width = frame->get().width();
|
double available_width = frame->get ().width ();
|
||||||
double s = floor (len / available_width);
|
double s = floor (len / available_width);
|
||||||
|
|
||||||
set_spp (s);
|
set_spp (s);
|
||||||
}
|
}
|
||||||
|
|
@ -475,17 +438,17 @@ AudioClipEditor::set_spp_from_length (samplecnt_t len)
|
||||||
void
|
void
|
||||||
AudioClipEditor::set_wave_heights ()
|
AudioClipEditor::set_wave_heights ()
|
||||||
{
|
{
|
||||||
if (waves.empty()) {
|
if (waves.empty ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t n = 0;
|
uint32_t n = 0;
|
||||||
const Distance w = frame->get().height() - scroll_bar_trough->get().height() - 2. - ruler->get().height();
|
const Distance w = frame->get ().height () - scroll_bar_trough->get ().height () - 2.;
|
||||||
Distance ht = w / waves.size();
|
Distance ht = w / waves.size ();
|
||||||
|
|
||||||
for (auto & wave : waves) {
|
for (auto& wave : waves) {
|
||||||
wave->set_height (ht);
|
wave->set_height (ht);
|
||||||
wave->set_y_position (ruler->get().height() + (n * ht));
|
wave->set_y_position (ruler->get ().height () + (n * ht));
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -493,44 +456,39 @@ AudioClipEditor::set_wave_heights ()
|
||||||
void
|
void
|
||||||
AudioClipEditor::set_waveform_colors ()
|
AudioClipEditor::set_waveform_colors ()
|
||||||
{
|
{
|
||||||
Gtkmm2ext::Color clip = UIConfiguration::instance().color ("clipped waveform");
|
Gtkmm2ext::Color clip = UIConfiguration::instance ().color ("clipped waveform");
|
||||||
Gtkmm2ext::Color zero = UIConfiguration::instance().color ("zero line");
|
Gtkmm2ext::Color zero = UIConfiguration::instance ().color ("zero line");
|
||||||
Gtkmm2ext::Color fill = UIConfiguration::instance().color ("waveform fill");
|
Gtkmm2ext::Color fill = UIConfiguration::instance ().color ("waveform fill");
|
||||||
Gtkmm2ext::Color outline = UIConfiguration::instance().color ("waveform outline");
|
Gtkmm2ext::Color outline = UIConfiguration::instance ().color ("waveform outline");
|
||||||
|
|
||||||
for (auto & wave : waves) {
|
for (auto& wave : waves) {
|
||||||
wave->set_fill_color (fill);
|
wave->set_fill_color (fill);
|
||||||
wave->set_outline_color (outline);
|
wave->set_outline_color (outline);
|
||||||
wave->set_clip_color (clip);
|
wave->set_clip_color (clip);
|
||||||
wave->set_zero_color (zero);
|
wave->set_zero_color (zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AudioClipEditor::event_handler (GdkEvent* ev)
|
AudioClipEditor::event_handler (GdkEvent* ev)
|
||||||
{
|
{
|
||||||
switch (ev->type) {
|
switch (ev->type) {
|
||||||
case GDK_BUTTON_PRESS:
|
case GDK_BUTTON_PRESS:
|
||||||
// PublicEditor::instance().get_selection().set (this);
|
break;
|
||||||
break;
|
case GDK_ENTER_NOTIFY:
|
||||||
case GDK_ENTER_NOTIFY:
|
break;
|
||||||
// redraw ();
|
case GDK_LEAVE_NOTIFY:
|
||||||
break;
|
break;
|
||||||
case GDK_LEAVE_NOTIFY:
|
default:
|
||||||
// redraw ();
|
break;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ====================================================== */
|
|
||||||
|
|
||||||
AudioClipEditorBox::AudioClipEditorBox ()
|
AudioClipEditorBox::AudioClipEditorBox ()
|
||||||
{
|
{
|
||||||
_header_label.set_text(_("AUDIO Region Trimmer:"));
|
_header_label.set_text (_ ("AUDIO Region Trimmer:"));
|
||||||
_header_label.set_alignment(0.0, 0.5);
|
_header_label.set_alignment (0.0, 0.5);
|
||||||
|
|
||||||
zoom_in_button.set_icon (ArdourIcon::ZoomIn);
|
zoom_in_button.set_icon (ArdourIcon::ZoomIn);
|
||||||
zoom_out_button.set_icon (ArdourIcon::ZoomOut);
|
zoom_out_button.set_icon (ArdourIcon::ZoomOut);
|
||||||
|
|
@ -542,13 +500,13 @@ AudioClipEditorBox::AudioClipEditorBox ()
|
||||||
header_box.pack_start (zoom_in_button, false, false);
|
header_box.pack_start (zoom_in_button, false, false);
|
||||||
header_box.pack_start (zoom_out_button, false, false);
|
header_box.pack_start (zoom_out_button, false, false);
|
||||||
|
|
||||||
pack_start(header_box, false, false, 6);
|
pack_start (header_box, false, false, 6);
|
||||||
|
|
||||||
editor = manage (new AudioClipEditor);
|
editor = manage (new AudioClipEditor);
|
||||||
editor->set_size_request(600,120);
|
editor->set_size_request (600, 120);
|
||||||
|
|
||||||
pack_start(*editor, true, true);
|
pack_start (*editor, true, true);
|
||||||
editor->show();
|
editor->show ();
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioClipEditorBox::~AudioClipEditorBox ()
|
AudioClipEditorBox::~AudioClipEditorBox ()
|
||||||
|
|
@ -559,13 +517,13 @@ AudioClipEditorBox::~AudioClipEditorBox ()
|
||||||
void
|
void
|
||||||
AudioClipEditorBox::zoom_in_click ()
|
AudioClipEditorBox::zoom_in_click ()
|
||||||
{
|
{
|
||||||
editor->set_spp (editor->spp() / 2.);
|
editor->set_spp (editor->spp () / 2.);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClipEditorBox::zoom_out_click ()
|
AudioClipEditorBox::zoom_out_click ()
|
||||||
{
|
{
|
||||||
editor->set_spp (editor->spp() * 2.);
|
editor->set_spp (editor->spp () * 2.);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -577,31 +535,20 @@ AudioClipEditorBox::set_region (boost::shared_ptr<Region> r)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_session(&r->session());
|
set_session (&r->session ());
|
||||||
|
|
||||||
state_connection.disconnect();
|
state_connection.disconnect ();
|
||||||
|
|
||||||
_region = r;
|
_region = r;
|
||||||
editor->set_region (ar);
|
editor->set_region (ar);
|
||||||
|
|
||||||
PBD::PropertyChange interesting_stuff;
|
PBD::PropertyChange interesting_stuff;
|
||||||
region_changed(interesting_stuff);
|
region_changed (interesting_stuff);
|
||||||
|
|
||||||
_region->PropertyChanged.connect (state_connection, invalidator (*this), boost::bind (&AudioClipEditorBox::region_changed, this, _1), gui_context());
|
_region->PropertyChanged.connect (state_connection, invalidator (*this), boost::bind (&AudioClipEditorBox::region_changed, this, _1), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClipEditorBox::region_changed (const PBD::PropertyChange& what_changed)
|
AudioClipEditorBox::region_changed (const PBD::PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
//ToDo: refactor the region_editor.cc to cover this basic stuff
|
|
||||||
// if (what_changed.contains (ARDOUR::Properties::name)) {
|
|
||||||
// name_changed ();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// PBD::PropertyChange interesting_stuff;
|
|
||||||
// interesting_stuff.add (ARDOUR::Properties::length);
|
|
||||||
// interesting_stuff.add (ARDOUR::Properties::start);
|
|
||||||
// if (what_changed.contains (interesting_stuff))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@
|
||||||
#include <gtkmm/table.h>
|
#include <gtkmm/table.h>
|
||||||
|
|
||||||
#include "ardour/ardour.h"
|
#include "ardour/ardour.h"
|
||||||
#include "ardour/types.h"
|
|
||||||
#include "ardour/session_handle.h"
|
#include "ardour/session_handle.h"
|
||||||
|
#include "ardour/types.h"
|
||||||
|
|
||||||
#include "gtkmm2ext/actions.h"
|
#include "gtkmm2ext/actions.h"
|
||||||
#include "gtkmm2ext/bindings.h"
|
#include "gtkmm2ext/bindings.h"
|
||||||
|
|
@ -45,19 +45,21 @@
|
||||||
|
|
||||||
#include "audio_clock.h"
|
#include "audio_clock.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR
|
||||||
|
{
|
||||||
class Session;
|
class Session;
|
||||||
class Location;
|
class Location;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas
|
||||||
|
{
|
||||||
class Text;
|
class Text;
|
||||||
class Polygon;
|
class Polygon;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
namespace ArdourWaveView
|
||||||
|
{
|
||||||
namespace ArdourWaveView {
|
class WaveView;
|
||||||
class WaveView;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ClipEditorBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr
|
class ClipEditorBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr
|
||||||
|
|
@ -66,56 +68,56 @@ public:
|
||||||
ClipEditorBox () {}
|
ClipEditorBox () {}
|
||||||
~ClipEditorBox () {}
|
~ClipEditorBox () {}
|
||||||
|
|
||||||
virtual void set_region (boost::shared_ptr<ARDOUR::Region>) =0;
|
virtual void set_region (boost::shared_ptr<ARDOUR::Region>) = 0;
|
||||||
|
|
||||||
static void init ();
|
static void init ();
|
||||||
static void register_clip_editor_actions (Gtkmm2ext::Bindings*);
|
static void register_clip_editor_actions (Gtkmm2ext::Bindings*);
|
||||||
static Glib::RefPtr<Gtk::ActionGroup> clip_editor_actions;
|
static Glib::RefPtr<Gtk::ActionGroup> clip_editor_actions;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ClipEditor
|
class ClipEditor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~ClipEditor() {}
|
virtual ~ClipEditor () {}
|
||||||
|
|
||||||
virtual void zoom_in () = 0;
|
virtual void zoom_in () = 0;
|
||||||
virtual void zoom_out () = 0;
|
virtual void zoom_out () = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AudioClipEditor : public ArdourCanvas::GtkCanvas
|
class AudioClipEditor : public ArdourCanvas::GtkCanvas
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudioClipEditor ();
|
AudioClipEditor ();
|
||||||
~AudioClipEditor ();
|
~AudioClipEditor ();
|
||||||
|
|
||||||
void set_region (boost::shared_ptr<ARDOUR::AudioRegion>);
|
void set_region (boost::shared_ptr<ARDOUR::AudioRegion>);
|
||||||
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);
|
||||||
samplepos_t pixel_to_sample (double);
|
samplepos_t pixel_to_sample (double);
|
||||||
|
|
||||||
void set_spp (double);
|
void set_spp (double);
|
||||||
double spp() const { return _spp; }
|
double spp () const
|
||||||
|
{
|
||||||
|
return _spp;
|
||||||
|
}
|
||||||
|
|
||||||
bool key_press (GdkEventKey*);
|
bool key_press (GdkEventKey*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ArdourCanvas::Rectangle* frame;
|
ArdourCanvas::Rectangle* frame;
|
||||||
ArdourCanvas::ScrollGroup* waves_container;
|
ArdourCanvas::ScrollGroup* waves_container;
|
||||||
ArdourCanvas::Container* line_container;
|
ArdourCanvas::Container* line_container;
|
||||||
ArdourCanvas::Line* start_line;
|
ArdourCanvas::Line* start_line;
|
||||||
ArdourCanvas::Line* end_line;
|
ArdourCanvas::Line* end_line;
|
||||||
ArdourCanvas::Line* loop_line;
|
ArdourCanvas::Line* loop_line;
|
||||||
ArdourCanvas::Rectangle* scroll_bar_trough;
|
ArdourCanvas::Rectangle* scroll_bar_trough;
|
||||||
ArdourCanvas::Rectangle* scroll_bar_handle;
|
ArdourCanvas::Rectangle* scroll_bar_handle;
|
||||||
ArdourCanvas::Container* ruler_container;
|
std::vector<ArdourWaveView::WaveView*> waves;
|
||||||
ArdourCanvas::Ruler* ruler;
|
double non_wave_height;
|
||||||
ArdourCanvas::Ruler::Metric* clip_metric;
|
samplepos_t left_origin;
|
||||||
std::vector<ArdourWaveView::WaveView *> waves;
|
double _spp;
|
||||||
double non_wave_height;
|
double scroll_fraction;
|
||||||
samplepos_t left_origin;
|
|
||||||
double _spp;
|
|
||||||
double scroll_fraction;
|
|
||||||
boost::shared_ptr<ARDOUR::AudioRegion> audio_region;
|
boost::shared_ptr<ARDOUR::AudioRegion> audio_region;
|
||||||
|
|
||||||
void scroll_left ();
|
void scroll_left ();
|
||||||
|
|
@ -138,33 +140,35 @@ class AudioClipEditor : public ArdourCanvas::GtkCanvas
|
||||||
void position_lines ();
|
void position_lines ();
|
||||||
void scroll_changed ();
|
void scroll_changed ();
|
||||||
|
|
||||||
class LineDrag {
|
class LineDrag
|
||||||
public:
|
{
|
||||||
|
public:
|
||||||
LineDrag (AudioClipEditor&, ArdourCanvas::Line&);
|
LineDrag (AudioClipEditor&, ArdourCanvas::Line&);
|
||||||
|
|
||||||
void begin (GdkEventButton*);
|
void begin (GdkEventButton*);
|
||||||
void end (GdkEventButton*);
|
void end (GdkEventButton*);
|
||||||
void motion (GdkEventMotion*);
|
void motion (GdkEventMotion*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AudioClipEditor& editor;
|
AudioClipEditor& editor;
|
||||||
ArdourCanvas::Line& line;
|
ArdourCanvas::Line& line;
|
||||||
};
|
};
|
||||||
|
|
||||||
friend class LineDrag;
|
friend class LineDrag;
|
||||||
LineDrag* current_line_drag;
|
LineDrag* current_line_drag;
|
||||||
|
|
||||||
class ScrollDrag {
|
class ScrollDrag
|
||||||
public:
|
{
|
||||||
|
public:
|
||||||
ScrollDrag (AudioClipEditor&);
|
ScrollDrag (AudioClipEditor&);
|
||||||
|
|
||||||
void begin (GdkEventButton*);
|
void begin (GdkEventButton*);
|
||||||
void end (GdkEventButton*);
|
void end (GdkEventButton*);
|
||||||
void motion (GdkEventMotion*);
|
void motion (GdkEventMotion*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AudioClipEditor& editor;
|
AudioClipEditor& editor;
|
||||||
double last_x;
|
double last_x;
|
||||||
};
|
};
|
||||||
|
|
||||||
friend class ScrollDrag;
|
friend class ScrollDrag;
|
||||||
|
|
@ -181,13 +185,13 @@ public:
|
||||||
void region_changed (const PBD::PropertyChange& what_changed);
|
void region_changed (const PBD::PropertyChange& what_changed);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Gtk::HBox header_box;
|
Gtk::HBox header_box;
|
||||||
ArdourWidgets::ArdourButton zoom_in_button;
|
ArdourWidgets::ArdourButton zoom_in_button;
|
||||||
ArdourWidgets::ArdourButton zoom_out_button;
|
ArdourWidgets::ArdourButton zoom_out_button;
|
||||||
Gtk::Label _header_label;
|
Gtk::Label _header_label;
|
||||||
Gtk::Table table;
|
Gtk::Table table;
|
||||||
|
|
||||||
AudioClipEditor *editor;
|
AudioClipEditor* editor;
|
||||||
|
|
||||||
PBD::ScopedConnection state_connection;
|
PBD::ScopedConnection state_connection;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "gtkmm2ext/actions.h"
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/utils.h"
|
#include "gtkmm2ext/utils.h"
|
||||||
#include "gtkmm2ext/actions.h"
|
|
||||||
|
|
||||||
#include "ardour/location.h"
|
#include "ardour/location.h"
|
||||||
#include "ardour/profile.h"
|
#include "ardour/profile.h"
|
||||||
|
|
@ -41,62 +41,74 @@
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace ArdourWidgets;
|
using namespace ArdourWidgets;
|
||||||
using std::min;
|
|
||||||
using std::max;
|
using std::max;
|
||||||
|
using std::min;
|
||||||
|
|
||||||
RegionPropertiesBox::RegionPropertiesBox() :
|
RegionPropertiesBox::RegionPropertiesBox ()
|
||||||
length_clock (X_("regionlength"), true, "", true, false, true)
|
: length_clock (X_("regionlength"), true, "", true, false, true)
|
||||||
, start_clock (X_("regionstart"), true, "", false, false)
|
, start_clock (X_("regionstart"), true, "", false, false)
|
||||||
, loop_length_clock (X_("regionlength"), true, "", true, false, true)
|
, loop_length_clock (X_("regionlength"), true, "", true, false, true)
|
||||||
, loop_start_clock (X_("regionstart"), true, "", false, false)
|
, loop_start_clock (X_("regionstart"), true, "", false, false)
|
||||||
, bbt_toggle (ArdourButton::led_default_elements)
|
, bbt_toggle (ArdourButton::led_default_elements)
|
||||||
, loop_toggle (ArdourButton::led_default_elements)
|
, loop_toggle (ArdourButton::led_default_elements)
|
||||||
{
|
{
|
||||||
Gtk::Label *label;
|
Gtk::Label* label;
|
||||||
int row = 0;
|
int row = 0;
|
||||||
|
|
||||||
_header_label.set_alignment(0.0, 0.5);
|
_header_label.set_alignment (0.0, 0.5);
|
||||||
pack_start(_header_label, false, false, 6);
|
pack_start (_header_label, false, false, 6);
|
||||||
|
|
||||||
Gtk::Table *bpm_table = manage(new Gtk::Table());
|
Gtk::Table* bpm_table = manage (new Gtk::Table ());
|
||||||
bpm_table->set_homogeneous (false);
|
bpm_table->set_homogeneous (false);
|
||||||
bpm_table->set_spacings (4);
|
bpm_table->set_spacings (4);
|
||||||
bpm_table->set_border_width (2);
|
bpm_table->set_border_width (2);
|
||||||
label = manage(new Gtk::Label(_("BPM:"))); label->set_alignment(1.0, 0.5);
|
label = manage (new Gtk::Label (_("BPM:")));
|
||||||
bpm_table->attach(*label, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK );
|
label->set_alignment (1.0, 0.5);
|
||||||
bpm_table->attach(bpm_button, 1, 2, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
bpm_table->attach (*label, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
bpm_table->attach (bpm_button, 1, 2, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
pack_start (*bpm_table, false, false);
|
pack_start (*bpm_table, false, false);
|
||||||
|
|
||||||
Gtk::Table *metrum_table = manage(new Gtk::Table());
|
Gtk::Table* metrum_table = manage (new Gtk::Table ());
|
||||||
metrum_table->set_homogeneous (false);
|
metrum_table->set_homogeneous (false);
|
||||||
metrum_table->set_spacings (4);
|
metrum_table->set_spacings (4);
|
||||||
metrum_table->set_border_width (2);
|
metrum_table->set_border_width (2);
|
||||||
label = manage(new Gtk::Label(_("Time Sig:"))); label->set_alignment(1.0, 0.5);
|
label = manage (new Gtk::Label (_("Time Sig:")));
|
||||||
bpm_table->attach(*label, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK );
|
label->set_alignment (1.0, 0.5);
|
||||||
bpm_table->attach(metrum_button, 1, 2, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
bpm_table->attach (*label, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
bpm_table->attach (metrum_button, 1, 2, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
pack_start (*metrum_table, false, false);
|
pack_start (*metrum_table, false, false);
|
||||||
|
|
||||||
row = 0;
|
row = 0;
|
||||||
|
|
||||||
bbt_toggle.set_text(_("BBT Sync"));
|
bbt_toggle.set_text (_("BBT Sync"));
|
||||||
table.attach(bbt_toggle, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
table.attach (bbt_toggle, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
label = manage(new Gtk::Label(_("Start:"))); label->set_alignment(1.0, 0.5);
|
label = manage (new Gtk::Label (_("Start:")));
|
||||||
table.attach(*label, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK );
|
label->set_alignment (1.0, 0.5);
|
||||||
table.attach(start_clock, 1, 2, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
table.attach (*label, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
table.attach (start_clock, 1, 2, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
label = manage(new Gtk::Label(_("Length:"))); label->set_alignment(1.0, 0.5);
|
label = manage (new Gtk::Label (_("Length:")));
|
||||||
table.attach(*label, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK );
|
label->set_alignment (1.0, 0.5);
|
||||||
table.attach(length_clock, 1, 2, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
table.attach (*label, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
table.attach (length_clock, 1, 2, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
loop_toggle.set_text(_("Loop"));
|
loop_toggle.set_text (_("Loop"));
|
||||||
table.attach(loop_toggle, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
table.attach (loop_toggle, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
label = manage(new Gtk::Label(_("Loop Start:"))); label->set_alignment(1.0, 0.5);
|
label = manage (new Gtk::Label (_("Loop Start:")));
|
||||||
table.attach(*label, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK );
|
label->set_alignment (1.0, 0.5);
|
||||||
table.attach(loop_start_clock, 1, 2, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
table.attach (*label, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
table.attach (loop_start_clock, 1, 2, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
table.set_homogeneous (false);
|
table.set_homogeneous (false);
|
||||||
table.set_spacings (4);
|
table.set_spacings (4);
|
||||||
|
|
@ -104,7 +116,7 @@ RegionPropertiesBox::RegionPropertiesBox() :
|
||||||
pack_start (table, false, false);
|
pack_start (table, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPropertiesBox::~RegionPropertiesBox()
|
RegionPropertiesBox::~RegionPropertiesBox ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,92 +135,81 @@ RegionPropertiesBox::set_session (Session* s)
|
||||||
void
|
void
|
||||||
RegionPropertiesBox::set_region (boost::shared_ptr<Region> r)
|
RegionPropertiesBox::set_region (boost::shared_ptr<Region> r)
|
||||||
{
|
{
|
||||||
set_session(&r->session());
|
set_session (&r->session ());
|
||||||
|
|
||||||
state_connection.disconnect();
|
state_connection.disconnect ();
|
||||||
|
|
||||||
_region = r;
|
_region = r;
|
||||||
|
|
||||||
PBD::PropertyChange interesting_stuff;
|
PBD::PropertyChange interesting_stuff;
|
||||||
region_changed(interesting_stuff);
|
region_changed (interesting_stuff);
|
||||||
|
|
||||||
_region->PropertyChanged.connect (state_connection, invalidator (*this), boost::bind (&RegionPropertiesBox::region_changed, this, _1), gui_context());
|
_region->PropertyChanged.connect (state_connection, invalidator (*this), boost::bind (&RegionPropertiesBox::region_changed, this, _1), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RegionPropertiesBox::region_changed (const PBD::PropertyChange& what_changed)
|
RegionPropertiesBox::region_changed (const PBD::PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
//ToDo: refactor the region_editor.cc to cover this basic stuff
|
// TODO: refactor the region_editor.cc to cover this basic stuff
|
||||||
// if (what_changed.contains (ARDOUR::Properties::name)) {
|
|
||||||
// name_changed ();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// PBD::PropertyChange interesting_stuff;
|
|
||||||
// interesting_stuff.add (ARDOUR::Properties::length);
|
|
||||||
// interesting_stuff.add (ARDOUR::Properties::start);
|
|
||||||
// if (what_changed.contains (interesting_stuff))
|
|
||||||
{
|
{
|
||||||
AudioClock::Mode mode = _region->position_time_domain() == Temporal::AudioTime ? AudioClock::Samples : AudioClock::BBT;
|
AudioClock::Mode mode = _region->position_time_domain () == Temporal::AudioTime ? AudioClock::Samples : AudioClock::BBT;
|
||||||
|
|
||||||
start_clock.set_mode (mode);
|
start_clock.set_mode (mode);
|
||||||
length_clock.set_mode (mode);
|
length_clock.set_mode (mode);
|
||||||
|
|
||||||
start_clock.set (_region->start());
|
start_clock.set (_region->start ());
|
||||||
length_clock.set_duration (_region->length());
|
length_clock.set_duration (_region->length ());
|
||||||
|
|
||||||
bpm_button.set_text("122.2");
|
bpm_button.set_text ("122.2");
|
||||||
metrum_button.set_text("4/4");
|
metrum_button.set_text ("4/4");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================== */
|
|
||||||
|
|
||||||
AudioRegionPropertiesBox::AudioRegionPropertiesBox ()
|
AudioRegionPropertiesBox::AudioRegionPropertiesBox ()
|
||||||
{
|
{
|
||||||
_header_label.set_text(_("AUDIO Region Properties:"));
|
_header_label.set_text (_("AUDIO Region Properties:"));
|
||||||
|
|
||||||
Gtk::Label *label;
|
Gtk::Label* label;
|
||||||
|
|
||||||
Gtk::Table *audio_t = manage(new Gtk::Table());
|
Gtk::Table* audio_t = manage (new Gtk::Table ());
|
||||||
audio_t->set_homogeneous (true);
|
audio_t->set_homogeneous (true);
|
||||||
audio_t->set_spacings (4);
|
audio_t->set_spacings (4);
|
||||||
|
|
||||||
int row = 0;
|
int row = 0;
|
||||||
|
|
||||||
label = manage(new Gtk::Label(_("Stretch Mode:"))); label->set_alignment(1.0, 0.5);
|
label = manage (new Gtk::Label (_("Stretch Mode:")));
|
||||||
audio_t->attach(*label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
label->set_alignment (1.0, 0.5);
|
||||||
|
audio_t->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
|
|
||||||
stretch_selector.set_text ("Mixed");
|
stretch_selector.set_text ("Mixed");
|
||||||
stretch_selector.set_name ("generic button");
|
stretch_selector.set_name ("generic button");
|
||||||
// stretch_selector.signal_clicked.connect (sigc::mem_fun (*this, &MidiRegionPropertiesBox::patch_enable_button_clicked));
|
audio_t->attach (stretch_selector, 1, 3, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
audio_t->attach(stretch_selector, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
label = manage(new Gtk::Label(_("Fades:"))); label->set_alignment(1.0, 0.5);
|
label = manage (new Gtk::Label (_("Fades:")));
|
||||||
fade_in_enable_button.set_text (_("In"));
|
label->set_alignment (1.0, 0.5);
|
||||||
fade_in_enable_button.set_name ("generic button");
|
fade_in_enable_button.set_text (_("In"));
|
||||||
// fade_in_enable_button.signal_clicked.connect (sigc::mem_fun (*this, &MidiRegionPropertiesBox::patch_enable_button_clicked));
|
fade_in_enable_button.set_name ("generic button");
|
||||||
fade_out_enable_button.set_text (_("Out"));
|
fade_out_enable_button.set_text (_("Out"));
|
||||||
fade_out_enable_button.set_name ("generic button");
|
fade_out_enable_button.set_name ("generic button");
|
||||||
// fade_out_enable_button.signal_clicked.connect (sigc::mem_fun (*this, &MidiRegionPropertiesBox::patch_enable_button_clicked));
|
audio_t->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
audio_t->attach(*label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
audio_t->attach (fade_in_enable_button, 1, 2, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
audio_t->attach(fade_in_enable_button, 1, 2, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
audio_t->attach (fade_out_enable_button, 2, 3, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
audio_t->attach(fade_out_enable_button, 2, 3, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
label = manage(new Gtk::Label(_("Gain:"))); label->set_alignment(1.0, 0.5);
|
label = manage (new Gtk::Label (_("Gain:")));
|
||||||
audio_t->attach(*label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
label->set_alignment (1.0, 0.5);
|
||||||
|
audio_t->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
|
|
||||||
gain_control.set_text (_("+6dB"));
|
gain_control.set_text (_("+6dB"));
|
||||||
gain_control.set_name ("generic button");
|
gain_control.set_name ("generic button");
|
||||||
// gain_control.signal_clicked.connect (sigc::mem_fun (*this, &MidiRegionPropertiesBox::patch_enable_button_clicked));
|
audio_t->attach (gain_control, 1, 3, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
audio_t->attach(gain_control, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
pack_start(*audio_t);
|
pack_start (*audio_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioRegionPropertiesBox::~AudioRegionPropertiesBox ()
|
AudioRegionPropertiesBox::~AudioRegionPropertiesBox ()
|
||||||
|
|
@ -220,4 +221,3 @@ AudioRegionPropertiesBox::set_region (boost::shared_ptr<Region> r)
|
||||||
{
|
{
|
||||||
RegionPropertiesBox::set_region (r);
|
RegionPropertiesBox::set_region (r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@
|
||||||
|
|
||||||
#include "audio_clock.h"
|
#include "audio_clock.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR
|
||||||
|
{
|
||||||
class Session;
|
class Session;
|
||||||
class Location;
|
class Location;
|
||||||
}
|
}
|
||||||
|
|
@ -54,7 +55,10 @@ protected:
|
||||||
boost::shared_ptr<ARDOUR::Region> _region;
|
boost::shared_ptr<ARDOUR::Region> _region;
|
||||||
|
|
||||||
Gtk::Label _header_label;
|
Gtk::Label _header_label;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void region_changed (const PBD::PropertyChange& what_changed);
|
||||||
|
|
||||||
Gtk::Table table;
|
Gtk::Table table;
|
||||||
|
|
||||||
AudioClock length_clock;
|
AudioClock length_clock;
|
||||||
|
|
@ -63,13 +67,12 @@ private:
|
||||||
AudioClock loop_length_clock;
|
AudioClock loop_length_clock;
|
||||||
AudioClock loop_start_clock;
|
AudioClock loop_start_clock;
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton bpm_button;
|
ArdourWidgets::ArdourButton bpm_button;
|
||||||
ArdourWidgets::ArdourButton metrum_button;
|
ArdourWidgets::ArdourButton metrum_button;
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton bbt_toggle;
|
ArdourWidgets::ArdourButton bbt_toggle;
|
||||||
ArdourWidgets::ArdourButton loop_toggle;
|
ArdourWidgets::ArdourButton loop_toggle;
|
||||||
|
|
||||||
void region_changed (const PBD::PropertyChange& what_changed);
|
|
||||||
PBD::ScopedConnection state_connection;
|
PBD::ScopedConnection state_connection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -82,12 +85,11 @@ public:
|
||||||
virtual void set_region (boost::shared_ptr<ARDOUR::Region>);
|
virtual void set_region (boost::shared_ptr<ARDOUR::Region>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
ArdourWidgets::ArdourButton fade_in_enable_button;
|
||||||
|
ArdourWidgets::ArdourButton fade_out_enable_button;
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton fade_in_enable_button;
|
ArdourWidgets::ArdourButton gain_control;
|
||||||
ArdourWidgets::ArdourButton fade_out_enable_button;
|
ArdourWidgets::ArdourButton stretch_selector;
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton gain_control;
|
|
||||||
ArdourWidgets::ArdourButton stretch_selector;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __audio_region_properties_box_h__ */
|
#endif /* __audio_region_properties_box_h__ */
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "gtkmm2ext/actions.h"
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/utils.h"
|
#include "gtkmm2ext/utils.h"
|
||||||
#include "gtkmm2ext/actions.h"
|
|
||||||
|
|
||||||
#include "canvas/canvas.h"
|
#include "canvas/canvas.h"
|
||||||
#include "canvas/debug.h"
|
#include "canvas/debug.h"
|
||||||
|
|
@ -48,24 +48,17 @@
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace ArdourCanvas;
|
using namespace ArdourCanvas;
|
||||||
using std::min;
|
|
||||||
using std::max;
|
using std::max;
|
||||||
|
using std::min;
|
||||||
/* ------------ */
|
|
||||||
|
|
||||||
MidiClipEditor::MidiClipEditor ()
|
MidiClipEditor::MidiClipEditor ()
|
||||||
{
|
{
|
||||||
// set_homogenous (true);
|
set_background_color (UIConfiguration::instance ().color (X_("theme:darkest")));
|
||||||
// set_row_spacing (4);
|
|
||||||
|
|
||||||
set_background_color (UIConfiguration::instance().color (X_("theme:darkest")));
|
const double scale = UIConfiguration::instance ().get_ui_scale ();
|
||||||
|
const double width = 600. * scale;
|
||||||
const double scale = UIConfiguration::instance().get_ui_scale();
|
|
||||||
const double width = 600. * scale;
|
|
||||||
const double height = 210. * scale;
|
const double height = 210. * scale;
|
||||||
|
|
||||||
// name = string_compose ("trigger %1", _trigger.index());
|
|
||||||
|
|
||||||
frame = new Rectangle (this);
|
frame = new Rectangle (this);
|
||||||
|
|
||||||
ArdourCanvas::Rect r (0, 0, width, height);
|
ArdourCanvas::Rect r (0, 0, width, height);
|
||||||
|
|
@ -73,8 +66,6 @@ MidiClipEditor::MidiClipEditor ()
|
||||||
frame->set_outline_all ();
|
frame->set_outline_all ();
|
||||||
|
|
||||||
frame->Event.connect (sigc::mem_fun (*this, &MidiClipEditor::event_handler));
|
frame->Event.connect (sigc::mem_fun (*this, &MidiClipEditor::event_handler));
|
||||||
|
|
||||||
// selection_connection = PublicEditor::instance().get_selection().TriggersChanged.connect (sigc::mem_fun (*this, &TriggerBoxUI::selection_changed));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiClipEditor::~MidiClipEditor ()
|
MidiClipEditor::~MidiClipEditor ()
|
||||||
|
|
@ -85,35 +76,30 @@ bool
|
||||||
MidiClipEditor::event_handler (GdkEvent* ev)
|
MidiClipEditor::event_handler (GdkEvent* ev)
|
||||||
{
|
{
|
||||||
switch (ev->type) {
|
switch (ev->type) {
|
||||||
case GDK_BUTTON_PRESS:
|
case GDK_BUTTON_PRESS:
|
||||||
// PublicEditor::instance().get_selection().set (this);
|
break;
|
||||||
break;
|
case GDK_ENTER_NOTIFY:
|
||||||
case GDK_ENTER_NOTIFY:
|
break;
|
||||||
// redraw ();
|
case GDK_LEAVE_NOTIFY:
|
||||||
break;
|
break;
|
||||||
case GDK_LEAVE_NOTIFY:
|
default:
|
||||||
// redraw ();
|
break;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ====================================================== */
|
|
||||||
|
|
||||||
MidiClipEditorBox::MidiClipEditorBox ()
|
MidiClipEditorBox::MidiClipEditorBox ()
|
||||||
{
|
{
|
||||||
_header_label.set_text(_("MIDI Region Trimmer:"));
|
_header_label.set_text (_("MIDI Region Trimmer:"));
|
||||||
_header_label.set_alignment(0.0, 0.5);
|
_header_label.set_alignment (0.0, 0.5);
|
||||||
pack_start(_header_label, false, false, 6);
|
pack_start (_header_label, false, false, 6);
|
||||||
|
|
||||||
editor = manage (new MidiClipEditor());
|
editor = manage (new MidiClipEditor ());
|
||||||
editor->set_size_request(600,120);
|
editor->set_size_request (600, 120);
|
||||||
|
|
||||||
pack_start(*editor, true, true);
|
pack_start (*editor, true, true);
|
||||||
editor->show();
|
editor->show ();
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiClipEditorBox::~MidiClipEditorBox ()
|
MidiClipEditorBox::~MidiClipEditorBox ()
|
||||||
|
|
@ -129,33 +115,19 @@ MidiClipEditorBox::set_session (Session* s)
|
||||||
void
|
void
|
||||||
MidiClipEditorBox::set_region (boost::shared_ptr<Region> r)
|
MidiClipEditorBox::set_region (boost::shared_ptr<Region> r)
|
||||||
{
|
{
|
||||||
set_session(&r->session());
|
set_session (&r->session ());
|
||||||
|
|
||||||
state_connection.disconnect();
|
state_connection.disconnect ();
|
||||||
|
|
||||||
_region = r;
|
_region = r;
|
||||||
|
|
||||||
PBD::PropertyChange interesting_stuff;
|
PBD::PropertyChange interesting_stuff;
|
||||||
region_changed(interesting_stuff);
|
region_changed (interesting_stuff);
|
||||||
|
|
||||||
_region->PropertyChanged.connect (state_connection, invalidator (*this), boost::bind (&MidiClipEditorBox::region_changed, this, _1), gui_context());
|
_region->PropertyChanged.connect (state_connection, invalidator (*this), boost::bind (&MidiClipEditorBox::region_changed, this, _1), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiClipEditorBox::region_changed (const PBD::PropertyChange& what_changed)
|
MidiClipEditorBox::region_changed (const PBD::PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
//ToDo: refactor the region_editor.cc to cover this basic stuff
|
|
||||||
// if (what_changed.contains (ARDOUR::Properties::name)) {
|
|
||||||
// name_changed ();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// PBD::PropertyChange interesting_stuff;
|
|
||||||
// interesting_stuff.add (ARDOUR::Properties::length);
|
|
||||||
// interesting_stuff.add (ARDOUR::Properties::start);
|
|
||||||
// if (what_changed.contains (interesting_stuff))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,25 +38,27 @@
|
||||||
|
|
||||||
#include "audio_clock.h"
|
#include "audio_clock.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR
|
||||||
|
{
|
||||||
class Session;
|
class Session;
|
||||||
class Location;
|
class Location;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas
|
||||||
|
{
|
||||||
class Text;
|
class Text;
|
||||||
class Polygon;
|
class Polygon;
|
||||||
};
|
}
|
||||||
|
|
||||||
class MidiClipEditor : public ArdourCanvas::GtkCanvas
|
class MidiClipEditor : public ArdourCanvas::GtkCanvas
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MidiClipEditor ();
|
MidiClipEditor ();
|
||||||
~MidiClipEditor ();
|
~MidiClipEditor ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ArdourCanvas::Rectangle* frame;
|
ArdourCanvas::Rectangle* frame;
|
||||||
bool event_handler (GdkEvent* ev);
|
bool event_handler (GdkEvent* ev);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MidiClipEditorBox : public ClipEditorBox
|
class MidiClipEditorBox : public ClipEditorBox
|
||||||
|
|
@ -74,7 +76,7 @@ private:
|
||||||
Gtk::Label _header_label;
|
Gtk::Label _header_label;
|
||||||
Gtk::Table table;
|
Gtk::Table table;
|
||||||
|
|
||||||
MidiClipEditor *editor;
|
MidiClipEditor* editor;
|
||||||
|
|
||||||
PBD::ScopedConnection state_connection;
|
PBD::ScopedConnection state_connection;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "gtkmm2ext/actions.h"
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/utils.h"
|
#include "gtkmm2ext/utils.h"
|
||||||
#include "gtkmm2ext/actions.h"
|
|
||||||
|
|
||||||
#include "ardour/location.h"
|
#include "ardour/location.h"
|
||||||
#include "ardour/profile.h"
|
#include "ardour/profile.h"
|
||||||
|
|
@ -43,44 +43,42 @@
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace ArdourWidgets;
|
using namespace ArdourWidgets;
|
||||||
using std::min;
|
|
||||||
using std::max;
|
using std::max;
|
||||||
|
using std::min;
|
||||||
|
|
||||||
MidiRegionPropertiesBox::MidiRegionPropertiesBox () :
|
MidiRegionPropertiesBox::MidiRegionPropertiesBox ()
|
||||||
patch_enable_button (ArdourButton::led_default_elements)
|
: patch_enable_button (ArdourButton::led_default_elements)
|
||||||
, cc_enable_button (ArdourButton::led_default_elements)
|
, cc_enable_button (ArdourButton::led_default_elements)
|
||||||
{
|
{
|
||||||
_header_label.set_text(_("MIDI Region Properties:"));
|
_header_label.set_text (_("MIDI Region Properties:"));
|
||||||
|
|
||||||
Gtk::Table *midi_t = manage(new Gtk::Table());
|
Gtk::Table* midi_t = manage (new Gtk::Table ());
|
||||||
midi_t->set_homogeneous (true);
|
midi_t->set_homogeneous (true);
|
||||||
midi_t->set_spacings (4);
|
midi_t->set_spacings (4);
|
||||||
|
|
||||||
int row = 0;
|
int row = 0;
|
||||||
|
|
||||||
patch_enable_button.set_text (_("Send Patches"));
|
patch_enable_button.set_text (_("Send Patches"));
|
||||||
patch_enable_button.set_name ("generic button");
|
patch_enable_button.set_name ("generic button");
|
||||||
// patch_enable_button.signal_clicked.connect (sigc::mem_fun (*this, &MidiRegionPropertiesBox::patch_enable_button_clicked));
|
|
||||||
|
|
||||||
patch_selector_button.set_text (_("Patches..."));
|
patch_selector_button.set_text (_("Patches..."));
|
||||||
patch_selector_button.set_name ("generic button");
|
patch_selector_button.set_name ("generic button");
|
||||||
// patch_selector_button.signal_clicked.connect (sigc::mem_fun (*this, &MidiRegionPropertiesBox::patch_enable_button_clicked));
|
|
||||||
|
|
||||||
midi_t->attach(patch_enable_button, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK );
|
midi_t->attach (patch_enable_button, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
midi_t->attach(patch_selector_button, 1, 2, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
midi_t->attach (patch_selector_button, 1, 2, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
cc_enable_button.set_text (_("Send CCs"));
|
cc_enable_button.set_text (_("Send CCs"));
|
||||||
cc_enable_button.set_name ("generic button");
|
cc_enable_button.set_name ("generic button");
|
||||||
// cc_enable_button.signal_clicked.connect (sigc::mem_fun (*this, &MidiRegionPropertiesBox::patch_enable_button_clicked));
|
|
||||||
|
|
||||||
cc_selector_button.set_text (_("CCs..."));
|
cc_selector_button.set_text (_("CCs..."));
|
||||||
cc_selector_button.set_name ("generic button");
|
cc_selector_button.set_name ("generic button");
|
||||||
// cc_selector_button.signal_clicked.connect (sigc::mem_fun (*this, &MidiRegionPropertiesBox::patch_enable_button_clicked));
|
|
||||||
|
|
||||||
midi_t->attach(cc_enable_button, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK );
|
midi_t->attach (cc_enable_button, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
midi_t->attach(cc_selector_button, 1, 2, row, row+1, Gtk::SHRINK, Gtk::SHRINK ); row++;
|
midi_t->attach (cc_selector_button, 1, 2, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
row++;
|
||||||
|
|
||||||
pack_start(*midi_t);
|
pack_start (*midi_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiRegionPropertiesBox::~MidiRegionPropertiesBox ()
|
MidiRegionPropertiesBox::~MidiRegionPropertiesBox ()
|
||||||
|
|
@ -92,12 +90,11 @@ MidiRegionPropertiesBox::set_region (boost::shared_ptr<Region> r)
|
||||||
{
|
{
|
||||||
RegionPropertiesBox::set_region (r);
|
RegionPropertiesBox::set_region (r);
|
||||||
|
|
||||||
_region->PropertyChanged.connect (midi_state_connection, invalidator (*this), boost::bind (&MidiRegionPropertiesBox::region_changed, this, _1), gui_context());
|
_region->PropertyChanged.connect (midi_state_connection, invalidator (*this), boost::bind (&MidiRegionPropertiesBox::region_changed, this, _1), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiRegionPropertiesBox::region_changed (const PBD::PropertyChange& what_changed)
|
MidiRegionPropertiesBox::region_changed (const PBD::PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
//CC and Pgm stuff ...?
|
/* CC and Pgm stuff ...? */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@
|
||||||
|
|
||||||
#include "audio_region_properties_box.h"
|
#include "audio_region_properties_box.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR
|
||||||
|
{
|
||||||
class Session;
|
class Session;
|
||||||
class Location;
|
class Location;
|
||||||
}
|
}
|
||||||
|
|
@ -47,15 +48,15 @@ public:
|
||||||
void set_region (boost::shared_ptr<ARDOUR::Region>);
|
void set_region (boost::shared_ptr<ARDOUR::Region>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
PBD::ScopedConnection midi_state_connection;
|
|
||||||
void region_changed (const PBD::PropertyChange& what_changed);
|
void region_changed (const PBD::PropertyChange& what_changed);
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton patch_enable_button;
|
PBD::ScopedConnection midi_state_connection;
|
||||||
ArdourWidgets::ArdourButton patch_selector_button;
|
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton cc_enable_button;
|
ArdourWidgets::ArdourButton patch_enable_button;
|
||||||
ArdourWidgets::ArdourButton cc_selector_button;
|
ArdourWidgets::ArdourButton patch_selector_button;
|
||||||
|
|
||||||
|
ArdourWidgets::ArdourButton cc_enable_button;
|
||||||
|
ArdourWidgets::ArdourButton cc_selector_button;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __midi_region_properties_box_h__ */
|
#endif /* __midi_region_properties_box_h__ */
|
||||||
|
|
|
||||||
|
|
@ -37,17 +37,17 @@
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
|
|
||||||
#include "audio_region_properties_box.h"
|
|
||||||
#include "midi_region_properties_box.h"
|
|
||||||
#include "audio_region_operations_box.h"
|
#include "audio_region_operations_box.h"
|
||||||
#include "midi_region_operations_box.h"
|
#include "audio_region_properties_box.h"
|
||||||
#include "slot_properties_box.h"
|
|
||||||
#include "midi_clip_editor.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_page.h"
|
|
||||||
#include "trigger_strip.h"
|
|
||||||
#include "cuebox_ui.h"
|
#include "cuebox_ui.h"
|
||||||
#include "trigger_master.h"
|
#include "trigger_master.h"
|
||||||
|
#include "trigger_page.h"
|
||||||
|
#include "trigger_strip.h"
|
||||||
#include "ui_config.h"
|
#include "ui_config.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
|
@ -63,33 +63,33 @@ 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.)
|
||||||
{
|
{
|
||||||
load_bindings ();
|
load_bindings ();
|
||||||
register_actions ();
|
register_actions ();
|
||||||
|
|
||||||
/* spacer to account for the trigger strip frame */
|
/* spacer to account for the trigger strip frame */
|
||||||
ArdourVSpacer *spacer = manage(new ArdourVSpacer());
|
ArdourVSpacer* spacer = manage (new ArdourVSpacer ());
|
||||||
spacer->set_size_request(-1,1);
|
spacer->set_size_request (-1, 1);
|
||||||
_slot_area_box.pack_start (*spacer, Gtk::PACK_SHRINK);
|
_slot_area_box.pack_start (*spacer, Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
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());
|
_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 ();
|
_midi_prop_box = new MidiRegionPropertiesBox ();
|
||||||
_slot_prop_box = new SlotPropertiesBox ();
|
_slot_prop_box = new SlotPropertiesBox ();
|
||||||
|
|
||||||
_audio_prop_box = new AudioRegionPropertiesBox ();
|
_audio_prop_box = new AudioRegionPropertiesBox ();
|
||||||
_midi_prop_box = new MidiRegionPropertiesBox ();
|
_midi_prop_box = new MidiRegionPropertiesBox ();
|
||||||
|
|
||||||
_audio_ops_box = new AudioRegionOperationsBox ();
|
_audio_ops_box = new AudioRegionOperationsBox ();
|
||||||
_midi_ops_box = new MidiRegionOperationsBox ();
|
_midi_ops_box = new MidiRegionOperationsBox ();
|
||||||
|
|
||||||
_audio_trim_box = new AudioClipEditorBox ();
|
_audio_trim_box = new AudioClipEditorBox ();
|
||||||
_midi_trim_box = new MidiClipEditorBox ();
|
_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);
|
||||||
|
|
@ -97,17 +97,23 @@ TriggerPage::TriggerPage ()
|
||||||
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 ); col++;
|
table->attach (*_audio_prop_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 ); col++;
|
table->attach (*_audio_trim_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
|
col++;
|
||||||
|
table->attach (*_audio_ops_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
|
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 ); col++;
|
table->attach (*_midi_prop_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 ); col++;
|
table->attach (*_midi_trim_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
|
col++;
|
||||||
|
table->attach (*_midi_ops_box, col, col + 1, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND);
|
||||||
|
col++;
|
||||||
|
|
||||||
_parameter_box.pack_start (*table);
|
_parameter_box.pack_start (*table);
|
||||||
|
|
||||||
|
|
@ -124,7 +130,7 @@ TriggerPage::TriggerPage ()
|
||||||
/* last item of strip packer */
|
/* last item of strip packer */
|
||||||
_strip_packer.pack_end (_no_strips, true, true);
|
_strip_packer.pack_end (_no_strips, true, true);
|
||||||
_no_strips.set_size_request (PX_SCALE (60), -1);
|
_no_strips.set_size_request (PX_SCALE (60), -1);
|
||||||
_no_strips.signal_expose_event().connect (sigc::bind (sigc::ptr_fun(&ArdourWidgets::ArdourIcon::expose), &_no_strips, ArdourWidgets::ArdourIcon::CloseCross));
|
_no_strips.signal_expose_event ().connect (sigc::bind (sigc::ptr_fun (&ArdourWidgets::ArdourIcon::expose), &_no_strips, ArdourWidgets::ArdourIcon::CloseCross));
|
||||||
|
|
||||||
_strip_group_box.pack_start (_slot_area_box, false, false);
|
_strip_group_box.pack_start (_slot_area_box, false, false);
|
||||||
_strip_group_box.pack_start (_strip_scroller, true, true);
|
_strip_group_box.pack_start (_strip_scroller, true, true);
|
||||||
|
|
@ -261,23 +267,23 @@ TriggerPage::set_session (Session* s)
|
||||||
|
|
||||||
_session->config.ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&TriggerPage::parameter_changed, this, _1), gui_context ());
|
_session->config.ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&TriggerPage::parameter_changed, this, _1), gui_context ());
|
||||||
|
|
||||||
Editor::instance().get_selection().TriggersChanged.connect (sigc::mem_fun (*this, &TriggerPage::selection_changed));
|
Editor::instance ().get_selection ().TriggersChanged.connect (sigc::mem_fun (*this, &TriggerPage::selection_changed));
|
||||||
|
|
||||||
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 ();
|
||||||
selection_changed();
|
selection_changed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -343,42 +349,42 @@ TriggerPage::initial_track_display ()
|
||||||
void
|
void
|
||||||
TriggerPage::selection_changed ()
|
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 ();
|
||||||
|
|
||||||
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();
|
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 ();
|
||||||
|
|
@ -403,7 +409,7 @@ TriggerPage::add_routes (RouteList& rl)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!(*r)->triggerbox()) {
|
if (!(*r)->triggerbox ()) {
|
||||||
/* This Route has no TriggerBox -- and can never have one */
|
/* This Route has no TriggerBox -- and can never have one */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -437,17 +443,17 @@ TriggerPage::redisplay_track_list ()
|
||||||
{
|
{
|
||||||
bool visible_triggers = false;
|
bool visible_triggers = false;
|
||||||
for (list<TriggerStrip*>::iterator i = _strips.begin (); i != _strips.end (); ++i) {
|
for (list<TriggerStrip*>::iterator i = _strips.begin (); i != _strips.end (); ++i) {
|
||||||
TriggerStrip* strip = *i;
|
TriggerStrip* strip = *i;
|
||||||
boost::shared_ptr<Stripable> s = strip->stripable ();
|
boost::shared_ptr<Stripable> s = strip->stripable ();
|
||||||
boost::shared_ptr<Route> route = boost::dynamic_pointer_cast<Route> (s);
|
boost::shared_ptr<Route> route = boost::dynamic_pointer_cast<Route> (s);
|
||||||
|
|
||||||
bool hidden = s->presentation_info ().hidden ();
|
bool hidden = s->presentation_info ().hidden ();
|
||||||
|
|
||||||
if (!(s)->presentation_info ().trigger_track ()) {
|
if (!(s)->presentation_info ().trigger_track ()) {
|
||||||
hidden = true;
|
hidden = true;
|
||||||
}
|
}
|
||||||
assert (route && route->triggerbox());
|
assert (route && route->triggerbox ());
|
||||||
if (!route || !route->triggerbox()) {
|
if (!route || !route->triggerbox ()) {
|
||||||
hidden = true;
|
hidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ private:
|
||||||
void pi_property_changed (PBD::PropertyChange const&);
|
void pi_property_changed (PBD::PropertyChange const&);
|
||||||
void stripable_property_changed (PBD::PropertyChange const&, boost::weak_ptr<ARDOUR::Stripable>);
|
void stripable_property_changed (PBD::PropertyChange const&, boost::weak_ptr<ARDOUR::Stripable>);
|
||||||
|
|
||||||
void selection_changed ();
|
void selection_changed ();
|
||||||
PBD::ScopedConnectionList editor_connections;
|
PBD::ScopedConnectionList editor_connections;
|
||||||
|
|
||||||
gint start_updating ();
|
gint start_updating ();
|
||||||
|
|
@ -89,18 +89,18 @@ private:
|
||||||
Gtk::VBox _browser_box;
|
Gtk::VBox _browser_box;
|
||||||
Gtk::HBox _parameter_box;
|
Gtk::HBox _parameter_box;
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,9 @@ TriggerStrip::TriggerStrip (Session* s, boost::shared_ptr<ARDOUR::Route> rt)
|
||||||
, RouteUI (s)
|
, RouteUI (s)
|
||||||
, _clear_meters (true)
|
, _clear_meters (true)
|
||||||
, _pb_selection ()
|
, _pb_selection ()
|
||||||
, _master_widget ( -1, 16 )
|
, _master_widget (-1, 16)
|
||||||
, _processor_box (s, boost::bind (&TriggerStrip::plugin_selector, this), _pb_selection, 0)
|
, _processor_box (s, boost::bind (&TriggerStrip::plugin_selector, this), _pb_selection, 0)
|
||||||
, _trigger_display (*rt->triggerbox (), -1., TriggerBox::default_triggers_per_box*16.)
|
, _trigger_display (*rt->triggerbox (), -1., TriggerBox::default_triggers_per_box * 16.)
|
||||||
, _panners (s)
|
, _panners (s)
|
||||||
, _level_meter (s)
|
, _level_meter (s)
|
||||||
{
|
{
|
||||||
|
|
@ -145,12 +145,12 @@ TriggerStrip::init ()
|
||||||
global_frame.set_shadow_type (Gtk::SHADOW_IN);
|
global_frame.set_shadow_type (Gtk::SHADOW_IN);
|
||||||
global_frame.set_name ("BaseFrame");
|
global_frame.set_name ("BaseFrame");
|
||||||
|
|
||||||
Gtk::VBox *outer_vpacker = manage(new Gtk::VBox);
|
Gtk::VBox* outer_vpacker = manage (new Gtk::VBox);
|
||||||
|
|
||||||
outer_vpacker->pack_start (_trigger_display, Gtk::PACK_SHRINK);
|
outer_vpacker->pack_start (_trigger_display, Gtk::PACK_SHRINK);
|
||||||
outer_vpacker->pack_start (_master_widget, Gtk::PACK_SHRINK);
|
outer_vpacker->pack_start (_master_widget, Gtk::PACK_SHRINK);
|
||||||
outer_vpacker->pack_start (global_frame, true, true);
|
outer_vpacker->pack_start (global_frame, true, true);
|
||||||
outer_vpacker->show();
|
outer_vpacker->show ();
|
||||||
|
|
||||||
add (*outer_vpacker);
|
add (*outer_vpacker);
|
||||||
|
|
||||||
|
|
@ -191,8 +191,8 @@ TriggerStrip::set_route (boost::shared_ptr<Route> rt)
|
||||||
{
|
{
|
||||||
RouteUI::set_route (rt);
|
RouteUI::set_route (rt);
|
||||||
|
|
||||||
_master = new TriggerMaster(_master_widget.root(), _route->triggerbox());
|
_master = new TriggerMaster (_master_widget.root (), _route->triggerbox ());
|
||||||
|
|
||||||
_processor_box.set_route (rt);
|
_processor_box.set_route (rt);
|
||||||
|
|
||||||
/* Fader/Gain */
|
/* Fader/Gain */
|
||||||
|
|
|
||||||
|
|
@ -120,13 +120,13 @@ private:
|
||||||
Gtk::Table volume_table;
|
Gtk::Table volume_table;
|
||||||
|
|
||||||
/* Widgets */
|
/* Widgets */
|
||||||
FittedCanvasWidget _master_widget;
|
FittedCanvasWidget _master_widget;
|
||||||
TriggerMaster *_master;
|
TriggerMaster* _master;
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton _name_button;
|
ArdourWidgets::ArdourButton _name_button;
|
||||||
ProcessorBox _processor_box;
|
ProcessorBox _processor_box;
|
||||||
TriggerBoxWidget _trigger_display;
|
TriggerBoxWidget _trigger_display;
|
||||||
PannerUI _panners;
|
PannerUI _panners;
|
||||||
LevelMeterVBox _level_meter;
|
LevelMeterVBox _level_meter;
|
||||||
boost::shared_ptr<AutomationController> _gain_control;
|
boost::shared_ptr<AutomationController> _gain_control;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue