mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
fix #4663, partly by more efficiently generating the relevant string, and secondly by making the region list pay attention to fade in/out *active*, not just length
git-svn-id: svn://localhost/ardour2/branches/3.0@11364 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
27747a6ee2
commit
ea655d711c
2 changed files with 29 additions and 23 deletions
|
|
@ -485,6 +485,8 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange
|
||||||
our_interests.add (ARDOUR::Properties::opaque);
|
our_interests.add (ARDOUR::Properties::opaque);
|
||||||
our_interests.add (ARDOUR::Properties::fade_in);
|
our_interests.add (ARDOUR::Properties::fade_in);
|
||||||
our_interests.add (ARDOUR::Properties::fade_out);
|
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)) {
|
if (what_changed.contains (our_interests)) {
|
||||||
|
|
||||||
|
|
@ -686,7 +688,7 @@ EditorRegions::update_all_rows ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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::BBT_Time bbt;
|
||||||
Timecode::Time timecode;
|
Timecode::Time timecode;
|
||||||
|
|
@ -694,7 +696,11 @@ EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize)
|
||||||
switch (ARDOUR_UI::instance()->secondary_clock->mode ()) {
|
switch (ARDOUR_UI::instance()->secondary_clock->mode ()) {
|
||||||
case AudioClock::BBT:
|
case AudioClock::BBT:
|
||||||
_session->tempo_map().bbt_time (pos, 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;
|
break;
|
||||||
|
|
||||||
case AudioClock::MinSec:
|
case AudioClock::MinSec:
|
||||||
|
|
@ -709,17 +715,29 @@ EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize)
|
||||||
mins = (int) floor (left / (_session->frame_rate() * 60.0f));
|
mins = (int) floor (left / (_session->frame_rate() * 60.0f));
|
||||||
left -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
|
left -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
|
||||||
secs = left / (float) _session->frame_rate();
|
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;
|
break;
|
||||||
|
|
||||||
case AudioClock::Frames:
|
case AudioClock::Frames:
|
||||||
snprintf (buf, bufsize, "%" PRId64, pos);
|
if (onoff) {
|
||||||
|
snprintf (buf, bufsize, "%" PRId64, pos);
|
||||||
|
} else {
|
||||||
|
snprintf (buf, bufsize, "(%" PRId64 ")", pos);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AudioClock::Timecode:
|
case AudioClock::Timecode:
|
||||||
default:
|
default:
|
||||||
_session->timecode_time (pos, timecode);
|
_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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -851,16 +869,9 @@ EditorRegions::populate_row_fade_in (boost::shared_ptr<Region> region, TreeModel
|
||||||
if (used > 1) {
|
if (used > 1) {
|
||||||
row[_columns.fadein] = _("Multiple");
|
row[_columns.fadein] = _("Multiple");
|
||||||
} else {
|
} else {
|
||||||
|
char buf[32];
|
||||||
char buf[16];
|
format_position (audioregion->fade_in()->back()->when, buf, sizeof (buf), audioregion->fade_in_active());
|
||||||
format_position (audioregion->fade_in()->back()->when, buf, sizeof (buf));
|
|
||||||
row[_columns.fadein] = buf;
|
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, ")");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -874,14 +885,9 @@ EditorRegions::populate_row_fade_out (boost::shared_ptr<Region> region, TreeMode
|
||||||
if (used > 1) {
|
if (used > 1) {
|
||||||
row[_columns.fadeout] = _("Multiple");
|
row[_columns.fadeout] = _("Multiple");
|
||||||
} else {
|
} else {
|
||||||
char buf[16];
|
char buf[32];
|
||||||
format_position (audioregion->fade_out()->back()->when, buf, sizeof (buf));
|
format_position (audioregion->fade_out()->back()->when, buf, sizeof (buf), audioregion->fade_out_active());
|
||||||
|
row[_columns.fadeout] = 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, ")");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ private:
|
||||||
|
|
||||||
int sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
|
int sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
|
||||||
|
|
||||||
void format_position (ARDOUR::framepos_t pos, char* buf, size_t bufsize);
|
void format_position (ARDOUR::framepos_t pos, char* buf, size_t bufsize, bool onoff = true);
|
||||||
|
|
||||||
void add_region (boost::shared_ptr<ARDOUR::Region>);
|
void add_region (boost::shared_ptr<ARDOUR::Region>);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue