mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-10 00:51:13 +02:00
Split lines now only show over middle third of track height.
This allows selection and clicking on split lines to merge clips to act independently. It also means we don't need a portmanteau explanation in the status line, and the action to select up to a split line is simpler and easier to explain.
This commit is contained in:
parent
f6d92ece82
commit
dc1193a0af
@ -5672,55 +5672,6 @@ void AudacityProject::OnSplit()
|
||||
|
||||
PushState(_("Split"), _("Split"));
|
||||
mTrackPanel->Refresh(false);
|
||||
#if 0
|
||||
//ANSWER-ME: Do we need to keep this commented out OnSplit() code?
|
||||
// This whole section no longer used...
|
||||
/*
|
||||
* Previous (pre-multiclip) implementation of "Split" command
|
||||
* This does work only when a range is selected!
|
||||
*
|
||||
TrackListIterator iter(mTracks);
|
||||
|
||||
Track *n = iter.First();
|
||||
Track *dest;
|
||||
|
||||
TrackList newTracks;
|
||||
|
||||
while (n) {
|
||||
if (n->GetSelected()) {
|
||||
double sel0 = mViewInfo.selectedRegion.t0();
|
||||
double sel1 = mViewInfo.selectedRegion.t1();
|
||||
|
||||
dest = n->Copy(sel0, sel1);
|
||||
dest->Init(*n);
|
||||
dest->SetOffset(wxMax(sel0, n->GetOffset()));
|
||||
|
||||
if (sel1 >= n->GetEndTime())
|
||||
n->Clear(sel0, sel1);
|
||||
else if (sel0 <= n->GetOffset()) {
|
||||
n->Clear(sel0, sel1);
|
||||
n->SetOffset(sel1);
|
||||
} else
|
||||
n->Silence(sel0, sel1);
|
||||
|
||||
newTracks.Add(dest);
|
||||
}
|
||||
n = iter.Next();
|
||||
}
|
||||
|
||||
TrackListIterator nIter(&newTracks);
|
||||
n = nIter.First();
|
||||
while (n) {
|
||||
mTracks->Add(n);
|
||||
n = nIter.Next();
|
||||
}
|
||||
|
||||
PushState(_("Split"), _("Split"));
|
||||
|
||||
FixScrollbars();
|
||||
mTrackPanel->Refresh(false);
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
void AudacityProject::OnSplitNew()
|
||||
|
@ -1494,17 +1494,21 @@ void TrackArtist::DrawWaveform(const WaveTrack *track,
|
||||
for (const auto loc : track->GetCachedLocations()) {
|
||||
const int xx = zoomInfo.TimeToPosition(loc.pos);
|
||||
if (xx >= 0 && xx < rect.width) {
|
||||
// delta is used to adjust the top and bottom edge of a split line.
|
||||
int delta =0;
|
||||
dc.SetPen(*wxGREY_PEN);
|
||||
AColor::Line(dc, (int) (rect.x + xx - 1), rect.y, (int) (rect.x + xx - 1), rect.y + rect.height);
|
||||
if (loc.typ == WaveTrackLocation::locationCutLine) {
|
||||
dc.SetPen(*wxRED_PEN);
|
||||
}
|
||||
else {
|
||||
dc.SetPen(*wxBLACK_PEN);
|
||||
delta = rect.height/3;
|
||||
// JKC Black does not show up enough.
|
||||
dc.SetPen(*wxWHITE_PEN);
|
||||
}
|
||||
AColor::Line(dc, (int) (rect.x + xx), rect.y, (int) (rect.x + xx), rect.y + rect.height);
|
||||
AColor::Line(dc, (int) (rect.x + xx), rect.y+delta, (int) (rect.x + xx), rect.y - delta + rect.height);
|
||||
dc.SetPen(*wxGREY_PEN);
|
||||
AColor::Line(dc, (int) (rect.x + xx + 1), rect.y, (int) (rect.x + xx + 1), rect.y + rect.height);
|
||||
AColor::Line(dc, (int) (rect.x + xx + 1), rect.y+delta, (int) (rect.x + xx + 1), rect.y - delta + rect.height);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,11 @@ namespace
|
||||
locRect.width = 11;
|
||||
locRect.y = rect.y;
|
||||
locRect.height = rect.height;
|
||||
// Adjustment for split line, which only fills one third of track.
|
||||
if( loc.typ != WaveTrackLocation::locationCutLine ){
|
||||
locRect.y += rect.height/3;
|
||||
locRect.height /= 3;
|
||||
}
|
||||
if (locRect.Contains(event.m_x, event.m_y))
|
||||
{
|
||||
if (pCapturedTrackLocation)
|
||||
|
Loading…
x
Reference in New Issue
Block a user