summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/SConscript1
-rwxr-xr-xgtk2_ardour/ardbg4
-rw-r--r--gtk2_ardour/ardour_ui2.cc130
-rwxr-xr-xgtk2_ardour/arval2
-rw-r--r--gtk2_ardour/canvas-simplerect.c6
-rw-r--r--gtk2_ardour/canvas-simplerect.h6
-rw-r--r--gtk2_ardour/plugin_ui.cc1
-rw-r--r--gtk2_ardour/regionview.cc123
-rw-r--r--gtk2_ardour/regionview.h24
-rw-r--r--gtk2_ardour/streamview.cc39
-rw-r--r--gtk2_ardour/time_axis_view_item.cc61
-rw-r--r--gtk2_ardour/time_axis_view_item.h7
12 files changed, 312 insertions, 92 deletions
diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript
index ee1d713cce..95136ae008 100644
--- a/gtk2_ardour/SConscript
+++ b/gtk2_ardour/SConscript
@@ -163,6 +163,7 @@ selection.cc
sfdb_ui.cc
send_ui.cc
streamview.cc
+taperegionview.cc
tempo_dialog.cc
time_axis_view.cc
time_axis_view_item.cc
diff --git a/gtk2_ardour/ardbg b/gtk2_ardour/ardbg
index a4d686a545..0aa19ac5e7 100755
--- a/gtk2_ardour/ardbg
+++ b/gtk2_ardour/ardbg
@@ -8,11 +8,11 @@ export ARDOUR_BINDINGS=./ardour.bindings
if [ -x ./ardour.bin ] ; then
# scons executable
- export LD_LIBRARY_PATH=../libs/ardour
+ export LD_LIBRARY_PATH=../libs/ardour:$LD_LIBRARY_PATH
exec gdb ./ardour.bin
else
# autofoo/make executable
- export LD_LIBRARY_PATH=../libs/ardour/.libs
+ export LD_LIBRARY_PATH=../libs/ardour/.libs:$LD_LIBRARY_PATH
exec gdb ./ardour
fi
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index 8d026a43a4..6b256c2609 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -117,6 +117,134 @@ ARDOUR_UI::setup_adjustables ()
adjuster_table.attach (*mmc_id_button, 2, 3, 1, 2, FILL, FILL, 5, 5);
}
+#define NEW_LOOP_XPM
+#ifdef NEW_LOOP_XPM
+
+/* XPM */
+static const gchar * loop_xpm[] = {
+"17 25 94 2",
+" c None",
+". c #4C4C4C",
+"+ c #555555",
+"@ c #454545",
+"# c #242424",
+"$ c #5E5E5E",
+"% c #000000",
+"& c #6B6B6B",
+"* c #484848",
+"= c #4E4E4E",
+"- c #6A6A6A",
+"; c #717171",
+"> c #686868",
+", c #838383",
+"' c #888888",
+") c #676767",
+"! c #4A4A4A",
+"~ c #474747",
+"{ c #939393",
+"] c #949494",
+"^ c #9E9E9E",
+"/ c #4B4B4B",
+"( c #A1A1A1",
+"_ c #A0A0A0",
+": c #A5A5A5",
+"< c #B2B2B2",
+"[ c #646464",
+"} c #ADADAD",
+"| c #AAAAAA",
+"1 c #B1B1B1",
+"2 c #494949",
+"3 c #9A9A9A",
+"4 c #A2A2A2",
+"5 c #A7A7A7",
+"6 c #A8A8A8",
+"7 c #C1C1C1",
+"8 c #696969",
+"9 c #656565",
+"0 c #B6B6B6",
+"a c #404040",
+"b c #989898",
+"c c #9D9D9D",
+"d c #999999",
+"e c #A3A3A3",
+"f c #C4C4C4",
+"g c #707070",
+"h c #C2C2C2",
+"i c #9C9C9C",
+"j c #969696",
+"k c #A4A4A4",
+"l c #777777",
+"m c #979797",
+"n c #2F2F2F",
+"o c #A9A9A9",
+"p c #7D7D7D",
+"q c #6D6D6D",
+"r c #959595",
+"s c #AFAFAF",
+"t c #848484",
+"u c #7F7F7F",
+"v c #3B3B3B",
+"w c #9B9B9B",
+"x c #2B2B2B",
+"y c #BFBFBF",
+"z c #B3B3B3",
+"A c #8A8A8A",
+"B c #858585",
+"C c #2E2E2E",
+"D c #C3C3C3",
+"E c #B8B8B8",
+"F c #464646",
+"G c #8E8E8E",
+"H c #898989",
+"I c #8D8D8D",
+"J c #797979",
+"K c #BCBCBC",
+"L c #909090",
+"M c #8C8C8C",
+"N c #2A2A2A",
+"O c #747474",
+"P c #818181",
+"Q c #808080",
+"R c #C6C6C6",
+"S c #C0C0C0",
+"T c #787878",
+"U c #868686",
+"V c #878787",
+"W c #8B8B8B",
+"X c #666666",
+"Y c #BDBDBD",
+"Z c #929292",
+"` c #6C6C6C",
+" . c #505050",
+".. c #C8C8C8",
+" . + ",
+" @ # $ ",
+" @ % @ & ",
+" * % % = - ",
+" * % ; % = > ",
+" * % , ' % = ) ",
+"* ! ! ~ % { ] ^ % / . ! * ~ * + ",
+"~ % % % % ( _ : < % % % % % % % ) ",
+"* % $ [ % } | 1 % 2 3 ^ 4 5 6 % 7 ",
+"* % 8 9 % 0 0 % a b c d c _ e % f ",
+"* % g 8 % h % a b i b j c 4 k % 7 ",
+"* % l g % % . m i j j 3 n o o % 7 ",
+"~ % p l % q d i j r b # % 0 s % 7 ",
+"~ % t u v b w j r d x % % y z % 7 ",
+"~ % A B A b j ] d C % [ % D E % 7 ",
+"F % G H I { ] b C % q J % f K % 7 ",
+"~ % L M G { b N % O P Q % R S % 7 ",
+"+ % % % % % % % T U V W % % % % D ",
+" X 7 D 7 7 Y = % I Z b % 7 7 K 7 ",
+" ` = % ( : % 7 ",
+" 8 = % z % 7 ",
+" X / % % 7 ",
+" X .% .. ",
+" - 9 .. ",
+" q I "};
+
+#else
+
static const gchar * loop_xpm[] = {
"19 19 3 1",
" c None",
@@ -142,6 +270,8 @@ static const gchar * loop_xpm[] = {
" ..+. ",
" ... "};
+#endif
+
void
ARDOUR_UI::transport_stopped ()
{
diff --git a/gtk2_ardour/arval b/gtk2_ardour/arval
index dd23b2801e..f560d4e336 100755
--- a/gtk2_ardour/arval
+++ b/gtk2_ardour/arval
@@ -5,5 +5,5 @@ export ARDOUR_UI=./ardour.menus
export ARDOUR_UI_RC=./ardour2_ui.rc
export ARDOUR_BINDINGS=./ardour.bindings
-export LD_LIBRARY_PATH=../libs/ardour
+export LD_LIBRARY_PATH=../libs/ardour:$LD_LIBRARY_PATH
exec valgrind --num-callers=12 --tool=memcheck ./ardour.bin --novst $*
diff --git a/gtk2_ardour/canvas-simplerect.c b/gtk2_ardour/canvas-simplerect.c
index 8edfba7ca9..62d3a96bcf 100644
--- a/gtk2_ardour/canvas-simplerect.c
+++ b/gtk2_ardour/canvas-simplerect.c
@@ -573,9 +573,9 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
randb = random() % 255;
PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey);
#else
- FAST_PAINT_BOX (buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a,
- intersection.x0, intersection.y0,
- intersection.x1, intersection.y1);
+ PAINT_BOX (buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a,
+ intersection.x0, intersection.y0,
+ intersection.x1, intersection.y1);
#endif
}
diff --git a/gtk2_ardour/canvas-simplerect.h b/gtk2_ardour/canvas-simplerect.h
index 2e3ec1b7cc..5bb695bbf3 100644
--- a/gtk2_ardour/canvas-simplerect.h
+++ b/gtk2_ardour/canvas-simplerect.h
@@ -48,9 +48,9 @@ struct _GnomeCanvasSimpleRect
gboolean fill;
gboolean draw;
gboolean full_draw_on_update;
- uint32_t fill_color;
- uint32_t outline_color;
- uint32_t outline_pixels;
+ uint32_t fill_color;
+ uint32_t outline_color;
+ uint32_t outline_pixels;
/* cached values set during update/used during render */
diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc
index c9e8c2ee14..fd4c91ff80 100644
--- a/gtk2_ardour/plugin_ui.cc
+++ b/gtk2_ardour/plugin_ui.cc
@@ -186,7 +186,6 @@ PluginUI::build (AudioEngine &engine)
Frame* frame;
Frame* bt_frame;
VBox* box;
- char info[32];
int output_row, output_col;
int button_row, button_col;
int output_rows, output_cols;
diff --git a/gtk2_ardour/regionview.cc b/gtk2_ardour/regionview.cc
index 5da65dead7..e2694f2b50 100644
--- a/gtk2_ardour/regionview.cc
+++ b/gtk2_ardour/regionview.cc
@@ -56,20 +56,26 @@ static const int32_t sync_mark_width = 9;
sigc::signal<void,AudioRegionView*> AudioRegionView::AudioRegionViewGoingAway;
-AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView &tv,
- AudioRegion& r,
- double spu,
- double amplitude_above_axis,
- Gdk::Color& basic_color,
- bool wfw)
-
+AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView &tv, AudioRegion& r, double spu,
+ Gdk::Color& basic_color)
: TimeAxisViewItem (r.name(), *parent, tv, spu, basic_color, r.position(), r.length(),
TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
TimeAxisViewItem::ShowNameHighlight|
TimeAxisViewItem::ShowFrame)),
+ region (r)
+{
+}
+AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView &tv, AudioRegion& r, double spu,
+ Gdk::Color& basic_color, TimeAxisViewItem::Visibility visibility)
+ : TimeAxisViewItem (r.name(), *parent, tv, spu, basic_color, r.position(), r.length(), visibility),
region (r)
{
+}
+
+void
+AudioRegionView::init (double amplitude_above_axis, Gdk::Color& basic_color, bool wfw)
+{
ArdourCanvas::Points shape;
XMLNode *node;
@@ -150,7 +156,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView
foo += ':';
foo += "gain";
- gain_line = new AudioRegionGainLine (foo, tv.session(), *this, *group, region.envelope());
+ gain_line = new AudioRegionGainLine (foo, trackview.session(), *this, *group, region.envelope());
if (!(_flags & EnvelopeVisible)) {
gain_line->hide ();
@@ -197,7 +203,7 @@ AudioRegionView::~AudioRegionView ()
gnome_canvas_waveview_cache_destroy (*cache);
}
- /* all waveviews will be destroyed when the group is destroyed */
+ /* all waveviews etc will be destroyed when the group is destroyed */
for (vector<GhostRegion*>::iterator g = ghosts.begin(); g != ghosts.end(); ++g) {
delete *g;
@@ -207,7 +213,9 @@ AudioRegionView::~AudioRegionView ()
delete editor;
}
- delete gain_line;
+ if (gain_line) {
+ delete gain_line;
+ }
}
gint
@@ -402,16 +410,18 @@ AudioRegionView::reset_width_dependent_items (double pixel_width)
zero_line->property_x2() = pixel_width - 1.0;
}
- if (pixel_width <= 6.0) {
- fade_in_handle->hide();
- fade_out_handle->hide();
- } else {
- if (_height < 5.0) {
+ if (fade_in_handle) {
+ if (pixel_width <= 6.0) {
fade_in_handle->hide();
fade_out_handle->hide();
} else {
- fade_in_handle->show();
- fade_out_handle->show();
+ if (_height < 5.0) {
+ fade_in_handle->hide();
+ fade_out_handle->hide();
+ } else {
+ fade_in_handle->show();
+ fade_out_handle->show();
+ }
}
}
@@ -517,19 +527,23 @@ AudioRegionView::set_height (gdouble height)
waves[n]->property_y() = yoff + 2;
}
- if ((height/wcnt) < NAME_HIGHLIGHT_SIZE) {
- gain_line->hide ();
- } else {
- if (_flags & EnvelopeVisible) {
- gain_line->show ();
+ if (gain_line) {
+ if ((height/wcnt) < NAME_HIGHLIGHT_SIZE) {
+ gain_line->hide ();
+ } else {
+ if (_flags & EnvelopeVisible) {
+ gain_line->show ();
+ }
}
+ gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE));
}
manage_zero_line ();
- gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE));
reset_fade_shapes ();
-
- name_text->raise_to_top();
+
+ if (name_text) {
+ name_text->raise_to_top();
+ }
}
void
@@ -565,6 +579,10 @@ AudioRegionView::reset_fade_in_shape ()
void
AudioRegionView::reset_fade_in_shape_width (jack_nframes_t width)
{
+ if (fade_in_handle == 0) {
+ return;
+ }
+
/* smallest size for a fade is 64 frames */
width = std::max ((jack_nframes_t) 64, width);
@@ -645,6 +663,10 @@ AudioRegionView::reset_fade_out_shape ()
void
AudioRegionView::reset_fade_out_shape_width (jack_nframes_t width)
{
+ if (fade_out_handle == 0) {
+ return;
+ }
+
/* smallest size for a fade is 64 frames */
width = std::max ((jack_nframes_t) 64, width);
@@ -732,7 +754,9 @@ AudioRegionView::set_samples_per_unit (gdouble spu)
(*i)->set_duration (region.length() / samples_per_unit);
}
- gain_line->reset ();
+ if (gain_line) {
+ gain_line->reset ();
+ }
reset_fade_shapes ();
region_sync_changed ();
}
@@ -776,8 +800,13 @@ AudioRegionView::set_colors ()
{
TimeAxisViewItem::set_colors ();
- gain_line->set_line_color (region.envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]);
- sync_mark->property_fill_color_rgba() = fill_color;
+ if (gain_line) {
+ gain_line->set_line_color (region.envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]);
+ }
+
+ if (sync_mark) {
+ sync_mark->property_fill_color_rgba() = fill_color;
+ }
for (uint32_t n=0; n < waves.size(); ++n) {
if (region.muted()) {
@@ -846,6 +875,10 @@ AudioRegionView::region_renamed ()
void
AudioRegionView::region_sync_changed ()
{
+ if (sync_mark == 0) {
+ return;
+ }
+
int sync_dir;
jack_nframes_t sync_offset;
@@ -911,13 +944,15 @@ AudioRegionView::set_waveform_visible (bool yn)
void
AudioRegionView::temporarily_hide_envelope ()
{
- gain_line->hide ();
+ if (gain_line) {
+ gain_line->hide ();
+ }
}
void
AudioRegionView::unhide_envelope ()
{
- if (_flags & EnvelopeVisible) {
+ if (gain_line && (_flags & EnvelopeVisible)) {
gain_line->show ();
}
}
@@ -925,7 +960,7 @@ AudioRegionView::unhide_envelope ()
void
AudioRegionView::set_envelope_visible (bool yn)
{
- if ((_flags & EnvelopeVisible) != yn) {
+ if (gain_line && ((_flags & EnvelopeVisible) != yn)) {
if (yn) {
gain_line->show ();
_flags |= EnvelopeVisible;
@@ -1068,6 +1103,10 @@ AudioRegionView::peaks_ready_handler (uint32_t which)
void
AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
{
+ if (gain_line == 0) {
+ return;
+ }
+
double x, y;
/* don't create points that can't be seen */
@@ -1274,7 +1313,7 @@ AudioRegionView::get_fill_color ()
void
AudioRegionView::entered ()
{
- if (_flags & EnvelopeVisible) {
+ if (gain_line && _flags & EnvelopeVisible) {
gain_line->show_all_control_points ();
}
@@ -1282,27 +1321,35 @@ AudioRegionView::entered ()
UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
a=255;
- fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
- fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ if (fade_in_handle) {
+ fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ }
}
void
AudioRegionView::exited ()
{
- gain_line->hide_all_but_selected_control_points ();
+ if (gain_line) {
+ gain_line->hide_all_but_selected_control_points ();
+ }
uint32_t r,g,b,a;
UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
a=0;
- fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
- fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ if (fade_in_handle) {
+ fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ }
}
void
AudioRegionView::envelope_active_changed ()
{
- gain_line->set_line_color (region.envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]);
+ if (gain_line) {
+ gain_line->set_line_color (region.envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]);
+ }
}
void
diff --git a/gtk2_ardour/regionview.h b/gtk2_ardour/regionview.h
index 0ce154747f..03f8243231 100644
--- a/gtk2_ardour/regionview.h
+++ b/gtk2_ardour/regionview.h
@@ -52,11 +52,12 @@ class AudioRegionView : public TimeAxisViewItem
AudioTimeAxisView&,
ARDOUR::AudioRegion&,
double initial_samples_per_unit,
- double amplitude_above_axis,
- Gdk::Color& base_color,
- bool wait_for_waves);
+ Gdk::Color& basic_color);
+
~AudioRegionView ();
+ virtual void init (double amplitude_above_axis, Gdk::Color& base_color, bool wait_for_waves);
+
ARDOUR::AudioRegion& region; // ok, let 'em have it
bool is_valid() const { return valid; }
void set_valid (bool yn) { valid = yn; }
@@ -115,7 +116,20 @@ class AudioRegionView : public TimeAxisViewItem
virtual void entered ();
virtual void exited ();
- private:
+ protected:
+
+ /* this constructor allows derived types
+ to specify their visibility requirements
+ to the TimeAxisViewItem parent class
+ */
+
+ AudioRegionView (ArdourCanvas::Group *,
+ AudioTimeAxisView&,
+ ARDOUR::AudioRegion&,
+ double initial_samples_per_unit,
+ Gdk::Color& basic_color,
+ TimeAxisViewItem::Visibility);
+
enum Flags {
EnvelopeVisible = 0x1,
WaveformVisible = 0x4,
@@ -178,7 +192,7 @@ class AudioRegionView : public TimeAxisViewItem
void set_colors ();
void compute_colors (Gdk::Color&);
- void set_frame_color ();
+ virtual void set_frame_color ();
void reset_width_dependent_items (double pixel_width);
void set_waveview_data_src();
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index dda5f0ef51..91a34de755 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -13,6 +13,7 @@
#include "streamview.h"
#include "regionview.h"
+#include "taperegionview.h"
#include "audio_time_axis.h"
#include "canvas-waveview.h"
#include "canvas-simplerect.h"
@@ -46,31 +47,15 @@ StreamView::StreamView (AudioTimeAxisView& tv)
/* set_position() will position the group */
- //GTK2FIX -- how to get the group? is the canvas display really a group?
- //canvas_group = gnome_canvas_item_new (GNOME_CANVAS_GROUP(_trackview.canvas_display),
- // gnome_canvas_group_get_type (),
- // NULL);
canvas_group = new ArdourCanvas::Group(*_trackview.canvas_display);
- //canvas_rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas_group),
- // gnome_canvas_simplerect_get_type(),
- // "x1", 0.0,
- // "y1", 0.0,
- // "x2", 1000000.0,
- // "y2", (double) tv.height,
- // "outline_color_rgba", color_map[cAudioTrackOutline],
- // /* outline ends and bottom */
- // "outline_what", (guint32) (0x1|0x2|0x8),
- // "fill_color_rgba", stream_base_color,
- // ] NULL);
canvas_rect = new ArdourCanvas::SimpleRect (*canvas_group);
canvas_rect->property_x1() = 0.0;
canvas_rect->property_y1() = 0.0;
canvas_rect->property_x2() = 1000000.0;
canvas_rect->property_y2() = (double) tv.height;
canvas_rect->property_outline_color_rgba() = color_map[cAudioTrackOutline];
- /* outline ends and bottom */
- canvas_rect->property_outline_what() = (guint32) (0x1|0x2|0x8);
+ canvas_rect->property_outline_what() = (guint32) (0x1|0x2|0x8); // outline ends and bottom
canvas_rect->property_fill_color_rgba() = stream_base_color;
canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
@@ -222,15 +207,19 @@ StreamView::add_region_view_internal (Region *r, bool wait_for_waves)
return;
}
}
+
+ switch (_trackview.audio_track()->mode()) {
+ case Normal:
+ region_view = new AudioRegionView (canvas_group, _trackview, *region,
+ _samples_per_unit, region_color);
+ break;
+ case Destructive:
+ region_view = new TapeAudioRegionView (canvas_group, _trackview, *region,
+ _samples_per_unit, region_color);
+ break;
+ }
- region_view = new AudioRegionView (canvas_group,
- _trackview,
- *region,
- _samples_per_unit,
- _amplitude_above_axis,
- region_color,
- wait_for_waves);
-
+ region_view->init (_amplitude_above_axis, region_color, wait_for_waves);
region_views.push_front (region_view);
/* follow global waveform setting */
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index bab9e9e1b5..a9663b8630 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -64,7 +64,7 @@ const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
*/
TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color,
jack_nframes_t start, jack_nframes_t duration,
- Visibility visibility)
+ Visibility vis)
: trackview (tv)
{
if (!have_name_font) {
@@ -83,6 +83,7 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
max_item_duration = ARDOUR::max_frames;
min_item_duration = 0 ;
show_vestigial = true;
+ visibility = vis;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl ;
@@ -108,14 +109,33 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
frame->property_outline_color_rgba() = color_map[cTimeAxisFrameOutline];
frame->property_fill_color_rgba() = color_map[cTimeAxisFrameFill];
+ /* by default draw all 4 edges */
+
+ uint32_t outline_what = 0x1|0x2|0x4|0x8;
+
+ if (visibility & HideFrameLR) {
+ outline_what &= ~(0x1 | 0x2);
+ }
+
+ if (visibility & HideFrameTB) {
+ outline_what &= ~(0x4 | 0x8);
+ }
+
+ frame->property_outline_what() = outline_what;
+
} else {
frame = 0;
}
if (visibility & ShowNameHighlight) {
name_highlight = new ArdourCanvas::SimpleRect (*group);
- name_highlight->property_x1() = (double) 1.0;
- name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1;
+ if (visibility & FullWidthNameHighlight) {
+ name_highlight->property_x1() = (double) 0.0;
+ name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration));
+ } else {
+ name_highlight->property_x1() = (double) 1.0;
+ name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1;
+ }
name_highlight->property_y1() = (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
name_highlight->property_y2() = (double) (trackview.height - 1);
name_highlight->property_outline_color_rgba() = color_map[cNameHighlightFill];
@@ -508,10 +528,14 @@ TimeAxisViewItem::set_height(double height)
if (name_highlight) {
if (height < NAME_HIGHLIGHT_THRESH) {
name_highlight->hide();
- name_text->hide();
+ if (name_text) {
+ name_text->hide();
+ }
} else {
name_highlight->show();
- name_text->show();
+ if (name_text) {
+ name_text->show();
+ }
}
if (height > NAME_HIGHLIGHT_SIZE) {
@@ -567,7 +591,7 @@ TimeAxisViewItem::get_canvas_frame()
ArdourCanvas::Item*
TimeAxisViewItem::get_canvas_group()
{
- return(group) ;
+ return (group) ;
}
/**
@@ -576,7 +600,7 @@ TimeAxisViewItem::get_canvas_group()
ArdourCanvas::Item*
TimeAxisViewItem::get_name_highlight()
{
- return(name_highlight) ;
+ return (name_highlight) ;
}
/**
@@ -585,7 +609,7 @@ TimeAxisViewItem::get_name_highlight()
ArdourCanvas::Text*
TimeAxisViewItem::get_name_text()
{
- return(name_text) ;
+ return (name_text) ;
}
/**
@@ -780,7 +804,9 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (name_highlight) {
name_highlight->hide();
- name_text->hide();
+ if (name_text) {
+ name_text->hide();
+ }
}
if (frame) {
@@ -801,14 +827,23 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (height < NAME_HIGHLIGHT_THRESH) {
name_highlight->hide();
- name_text->hide();
+ if (name_text) {
+ name_text->hide();
+ }
} else {
name_highlight->show();
- name_text->show();
- reset_name_width (pixel_width);
+ if (name_text) {
+ name_text->show();
+ reset_name_width (pixel_width);
+ }
+ }
+
+ if (visibility & FullWidthNameHighlight) {
+ name_highlight->property_x2() = pixel_width;
+ } else {
+ name_highlight->property_x2() = pixel_width - 1.0;
}
- name_highlight->property_x2() = pixel_width - 1.0;
}
if (frame) {
diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h
index d33738cc8b..b1e9939449 100644
--- a/gtk2_ardour/time_axis_view_item.h
+++ b/gtk2_ardour/time_axis_view_item.h
@@ -326,7 +326,10 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
ShowFrame = 0x1,
ShowNameHighlight = 0x2,
ShowNameText = 0x4,
- ShowHandles = 0x8
+ ShowHandles = 0x8,
+ HideFrameLR = 0x10,
+ HideFrameTB = 0x20,
+ FullWidthNameHighlight = 0x40
};
/**
@@ -454,6 +457,8 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
ArdourCanvas::SimpleRect* frame_handle_start;
ArdourCanvas::SimpleRect* frame_handle_end;
+ Visibility visibility;
+
}; /* class TimeAxisViewItem */
#endif /* __gtk_ardour_time_axis_view_item_h__ */