#include "ardour/audioregion.h"
#include "ardour/audiofilesource.h"
+#include "ardour/silentfilesource.h"
#include "ardour/region_factory.h"
#include "ardour/session.h"
-#include "ardour/session_playlists.h"
-#include "ardour/silentfilesource.h"
#include "ardour/profile.h"
#include "gtkmm2ext/choice.h"
#include "utils.h"
#include "editor_regions.h"
#include "editor_drag.h"
+#include "main_clock.h"
#include "i18n.h"
, expanded (false)
{
_display.set_size_request (100, -1);
- _display.set_name ("RegionListDisplay");
_display.set_rules_hint (true);
/* Try to prevent single mouse presses from initiating edits.
ColumnInfo ci[] = {
{ 0, _("Region"), _("Region name, with number of channels in []'s") },
- { 1, _("Position"), _("Length of the region") },
- { 2, _("End"), _("Length of the region") },
- { 3, _("End"), _("Length of the region") },
+ { 1, _("Position"), _("Position of start of region") },
+ { 2, _("End"), _("Position of end of region") },
+ { 3, _("Length"), _("Length of the region") },
{ 4, _("Sync"), _("Position of region sync point, relative to start of the region") },
- { 5, _("Sync"), _("Region fade-in enabled?") },
- { 6, _("Fade In"), _("Region fade-out enabled?") },
+ { 5, _("Fade In"), _("Length of region fade-in (units: secondary clock), () if disabled") },
+ { 6, _("Fade Out"), _("Length of region fade-out (units: secondary clock), () if dsisabled") },
{ 7, _("L"), _("Region position locked?") },
{ 8, _("G"), _("Region position glued to Bars|Beats time?") },
{ 9, _("M"), _("Region muted?") },
ARDOUR_UI::instance()->set_tip (*l, ci[i].tooltip);
col->set_widget (*l);
l->show ();
+
+ if (ci[i].index > 6) {
+ col->set_expand (false);
+ col->set_alignment (ALIGN_CENTER);
+ }
}
_display.set_headers_visible (true);
- //_display.set_grid_lines (TREE_VIEW_GRID_LINES_BOTH);
+ _display.set_rules_hint ();
/* show path as the row tooltip */
_display.set_tooltip_column (14); /* path */
_display.get_selection()->set_select_function (sigc::mem_fun (*this, &EditorRegions::selection_filter));
TreeViewColumn* tv_col = _display.get_column(0);
- tv_col->set_resizable (true);
CellRendererText* renderer = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (0));
tv_col->add_attribute(renderer->property_text(), _columns.name);
tv_col->add_attribute(renderer->property_foreground_gdk(), _columns.color_);
+ tv_col->set_expand (true);
CellRendererToggle* locked_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (7));
locked_cell->property_activatable() = true;
_display.get_selection()->set_mode (SELECTION_MULTIPLE);
_display.add_object_drag (_columns.region.index(), "regions");
-
- /* only the first column (Region name) is resizable */
-
- for (int i = 1; ; ++i) {
- TreeViewColumn* col = _display.get_column (i);
- if (!col) {
- break;
- }
- col->set_resizable (false);
- }
-
/* setup DnD handling */
list<TargetEntry> region_list_target_table;
//ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &Editor::redisplay_regions));
ARDOUR_UI::instance()->secondary_clock->mode_changed.connect (sigc::mem_fun(*this, &EditorRegions::update_all_rows));
- ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::region_changed, this, _1, _2), gui_context());
- ARDOUR::RegionFactory::CheckNewRegion.connect (check_new_region_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::add_region, this, _1), gui_context());
+ ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::region_changed, this, _1, _2), gui_context());
+ ARDOUR::RegionFactory::CheckNewRegion.connect (check_new_region_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::add_region, this, _1), gui_context());
- e->EditorFreeze.connect (editor_freeze_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::freeze_tree_model, this), gui_context());
- e->EditorThaw.connect (editor_thaw_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::thaw_tree_model, this), gui_context());
+ e->EditorFreeze.connect (editor_freeze_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::freeze_tree_model, this), gui_context());
+ e->EditorThaw.connect (editor_thaw_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::thaw_tree_model, this), gui_context());
}
bool
TreeModel::iterator iter = _model->get_iter ("0");
TreeModel::Row parent;
- TreeModel::Row child;
if (!iter) {
parent = *(_model->append());
our_interests.add (ARDOUR::Properties::opaque);
our_interests.add (ARDOUR::Properties::fade_in);
our_interests.add (ARDOUR::Properties::fade_out);
+ our_interests.add (ARDOUR::Properties::fade_in_active);
+ our_interests.add (ARDOUR::Properties::fade_out_active);
if (what_changed.contains (our_interests)) {
for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) {
- if (iter = _model->get_iter (*i)) {
+ if ((iter = _model->get_iter (*i))) {
boost::shared_ptr<Region> region = (*iter)[_columns.region];
// they could have clicked on a row that is just a placeholder, like "Hidden"
}
void
-EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize)
+EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize, bool onoff)
{
Timecode::BBT_Time bbt;
Timecode::Time timecode;
switch (ARDOUR_UI::instance()->secondary_clock->mode ()) {
case AudioClock::BBT:
_session->tempo_map().bbt_time (pos, bbt);
- snprintf (buf, bufsize, "%03d|%02d|%04d" , bbt.bars, bbt.beats, bbt.ticks);
+ if (onoff) {
+ snprintf (buf, bufsize, "%03d|%02d|%04d" , bbt.bars, bbt.beats, bbt.ticks);
+ } else {
+ snprintf (buf, bufsize, "(%03d|%02d|%04d)" , bbt.bars, bbt.beats, bbt.ticks);
+ }
break;
case AudioClock::MinSec:
mins = (int) floor (left / (_session->frame_rate() * 60.0f));
left -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
secs = left / (float) _session->frame_rate();
- snprintf (buf, bufsize, "%02d:%02d:%06.3f", hrs, mins, secs);
+ if (onoff) {
+ snprintf (buf, bufsize, "%02d:%02d:%06.3f", hrs, mins, secs);
+ } else {
+ snprintf (buf, bufsize, "(%02d:%02d:%06.3f)", hrs, mins, secs);
+ }
break;
case AudioClock::Frames:
- snprintf (buf, bufsize, "%" PRId64, pos);
+ if (onoff) {
+ snprintf (buf, bufsize, "%" PRId64, pos);
+ } else {
+ snprintf (buf, bufsize, "(%" PRId64 ")", pos);
+ }
break;
case AudioClock::Timecode:
default:
_session->timecode_time (pos, timecode);
- snprintf (buf, bufsize, "%02d:%02d:%02d:%02d", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
+ if (onoff) {
+ snprintf (buf, bufsize, "%02d:%02d:%02d:%02d", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
+ } else {
+ snprintf (buf, bufsize, "(%02d:%02d:%02d:%02d)", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
+ }
break;
}
}
if (used > 1) {
row[_columns.fadein] = _("Multiple");
} else {
-
- char buf[16];
- format_position (audioregion->fade_in()->back()->when, buf, sizeof (buf));
+ char buf[32];
+ format_position (audioregion->fade_in()->back()->when, buf, sizeof (buf), audioregion->fade_in_active());
row[_columns.fadein] = buf;
-
- if (audioregion->fade_in_active()) {
- row[_columns.fadein] = string_compose("%1%2%3", " ", buf, " ");
- } else {
- row[_columns.fadein] = string_compose("%1%2%3", "(", buf, ")");
- }
}
}
}
if (used > 1) {
row[_columns.fadeout] = _("Multiple");
} else {
- char buf[16];
- format_position (audioregion->fade_out()->back()->when, buf, sizeof (buf));
-
- if (audioregion->fade_out_active()) {
- row[_columns.fadeout] = string_compose("%1%2%3", " ", buf, " ");
- } else {
- row[_columns.fadeout] = string_compose("%1%2%3", "(", buf, ")");
- }
+ char buf[32];
+ format_position (audioregion->fade_out()->back()->when, buf, sizeof (buf), audioregion->fade_out_active());
+ row[_columns.fadeout] = buf;
}
}
}