mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 14:18:53 +02:00
Merge branch 'master' into temp
This commit is contained in:
commit
3849df763b
@ -4,7 +4,10 @@ to extract the 10.6 SDK from an earlier version of Xcode.
|
||||
|
||||
In the instructions below, Xcode 4.3.3 (for the 10.6 SDK) and
|
||||
Xcode 5.1.1 will be used. Xcode 6.1.1, 6.3, 6.4.1, and 7.1
|
||||
have been verified to work as well.
|
||||
have also been verified to work. Xcode 7.2 and later require a
|
||||
custom build setting to accept the 10.6 SDK, or to edit
|
||||
src\MemoryX.h in the Audacity code. See this topic:
|
||||
http://forum.audacityteam.org/viewtopic.php?p=303835#p303835 .
|
||||
|
||||
1) Download Xcode 5.1.1 or greater and install it to /Applications.
|
||||
2) Download Xcode 4.3.3 (it includes the 10.6 and 10.7 SDK's despite
|
||||
|
@ -878,7 +878,9 @@ Track *TrackList::Add(std::unique_ptr<TrackKind> &&t)
|
||||
|
||||
// Make instantiations for the linker to find
|
||||
template Track *TrackList::Add<TimeTrack>(std::unique_ptr<TimeTrack> &&);
|
||||
#if defined(USE_MIDI)
|
||||
template Track *TrackList::Add<NoteTrack>(std::unique_ptr<NoteTrack> &&);
|
||||
#endif
|
||||
template Track *TrackList::Add<WaveTrack>(std::unique_ptr<WaveTrack> &&);
|
||||
template Track *TrackList::Add<LabelTrack>(std::unique_ptr<LabelTrack> &&);
|
||||
|
||||
|
@ -283,7 +283,7 @@ bool EffectTruncSilence::ProcessIndependently()
|
||||
if (track2->GetKind() == Track::Wave &&
|
||||
!(track2 == track || track2 == link) &&
|
||||
track2->GetSelected()) {
|
||||
::wxMessageBox(_("When truncating independently, there may only be one selected audio track in each sync-lock group."));
|
||||
::wxMessageBox(_("When truncating independently, there may only be one selected audio track in each Sync-Locked Track Group."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -2109,8 +2109,11 @@ bool AdornedRulerPanel::IsWithinMarker(int mousePosX, double markerTime)
|
||||
void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
{
|
||||
// Disable mouse actions on Timeline while recording.
|
||||
if (mIsRecording)
|
||||
if (mIsRecording) {
|
||||
if (HasCapture())
|
||||
ReleaseMouse();
|
||||
return;
|
||||
}
|
||||
|
||||
const bool inScrubZone =
|
||||
// only if scrubbing is allowed now
|
||||
@ -2121,17 +2124,14 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
const bool changeInScrubZone = (inScrubZone != mPrevInScrubZone);
|
||||
mPrevInScrubZone = inScrubZone;
|
||||
|
||||
double t0 = mTracks->GetStartTime();
|
||||
double t1 = mTracks->GetEndTime();
|
||||
double sel0 = mProject->GetSel0();
|
||||
double sel1 = mProject->GetSel1();
|
||||
|
||||
wxCoord xx = evt.GetX();
|
||||
wxCoord mousePosX = xx;
|
||||
UpdateQuickPlayPos(mousePosX);
|
||||
HandleSnapping();
|
||||
|
||||
// If not looping, restrict selection to end of project
|
||||
if (!inScrubZone && !evt.ShiftDown()) {
|
||||
const double t1 = mTracks->GetEndTime();
|
||||
mQuickPlayPos = std::min(t1, mQuickPlayPos);
|
||||
}
|
||||
|
||||
@ -2201,11 +2201,6 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
mPlayRegionLock = mProject->IsPlayRegionLocked();
|
||||
}
|
||||
|
||||
bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
|
||||
bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
|
||||
bool isWithinClick = (mLeftDownClick >= 0) && IsWithinMarker(mousePosX, mLeftDownClick);
|
||||
bool canDragSel = !mPlayRegionLock && mPlayRegionDragsSelection;
|
||||
|
||||
// Handle entering and leaving of the bar, or movement from
|
||||
// one portion (quick play or scrub) to the other
|
||||
if (evt.Leaving() || (changeInScrubZone && inScrubZone)) {
|
||||
@ -2244,6 +2239,9 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
if (!mQuickPlayEnabled)
|
||||
return;
|
||||
|
||||
bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
|
||||
bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
|
||||
|
||||
if (isWithinStart || isWithinEnd) {
|
||||
if (!mIsWE) {
|
||||
SetCursor(mCursorSizeWE);
|
||||
@ -2257,13 +2255,21 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
}
|
||||
}
|
||||
|
||||
HandleSnapping();
|
||||
if (evt.LeftDown()) {
|
||||
HandleQPClick(evt, mousePosX);
|
||||
HandleQPDrag(evt, mousePosX);
|
||||
}
|
||||
else if (evt.LeftIsDown())
|
||||
HandleQPDrag(evt, mousePosX);
|
||||
else if (evt.LeftUp())
|
||||
HandleQPRelease(evt);
|
||||
|
||||
mQuickPlayInd = true;
|
||||
wxClientDC dc(this);
|
||||
DrawQuickPlayIndicator(&dc);
|
||||
}
|
||||
|
||||
if (evt.LeftDown())
|
||||
void AdornedRulerPanel::HandleQPClick(wxMouseEvent &evt, wxCoord mousePosX)
|
||||
{
|
||||
// Temporarily unlock locked play region
|
||||
if (mPlayRegionLock && evt.LeftDown()) {
|
||||
@ -2272,7 +2278,8 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
}
|
||||
|
||||
mLeftDownClick = mQuickPlayPos;
|
||||
isWithinClick = IsWithinMarker(mousePosX, mLeftDownClick);
|
||||
bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
|
||||
bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
|
||||
|
||||
if (isWithinStart || isWithinEnd) {
|
||||
// If Quick-Play is playing from a point, we need to treat it as a click
|
||||
@ -2301,7 +2308,13 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
CaptureMouse();
|
||||
}
|
||||
|
||||
if (evt.LeftIsDown()) {
|
||||
void AdornedRulerPanel::HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX)
|
||||
{
|
||||
bool isWithinClick = (mLeftDownClick >= 0) && IsWithinMarker(mousePosX, mLeftDownClick);
|
||||
bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
|
||||
bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
|
||||
bool canDragSel = !mPlayRegionLock && mPlayRegionDragsSelection;
|
||||
|
||||
switch (mMouseEventState)
|
||||
{
|
||||
case mesNone:
|
||||
@ -2351,7 +2364,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
break;
|
||||
case mesSelectingPlayRegionClick:
|
||||
|
||||
// Don't start dragging until mouse is beyond tollerance of initial click.
|
||||
// Don't start dragging until mouse is beyond tolerance of initial click.
|
||||
if (isWithinClick || mLeftDownClick == -1) {
|
||||
DrawQuickPlayIndicator(NULL);
|
||||
|
||||
@ -2387,7 +2400,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
Update();
|
||||
}
|
||||
|
||||
if (evt.LeftUp())
|
||||
void AdornedRulerPanel::HandleQPRelease(wxMouseEvent &evt)
|
||||
{
|
||||
HideQuickPlayIndicator();
|
||||
|
||||
@ -2401,6 +2414,11 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
mPlayRegionEnd = tmp;
|
||||
}
|
||||
|
||||
const double t0 = mTracks->GetStartTime();
|
||||
const double t1 = mTracks->GetEndTime();
|
||||
const double sel0 = mProject->GetSel0();
|
||||
const double sel1 = mProject->GetSel1();
|
||||
|
||||
// We want some audio in the selection, but we allow a dragged
|
||||
// region to include selected white-space and space before audio start.
|
||||
if (evt.ShiftDown() && (mPlayRegionStart == mPlayRegionEnd)) {
|
||||
@ -2461,7 +2479,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
|
||||
ControlToolBar::PlayAppearance appearance =
|
||||
evt.ControlDown() ? ControlToolBar::PlayAppearance::CutPreview
|
||||
: loopEnabled ? ControlToolBar::PlayAppearance::Looped
|
||||
: options.playLooped ? ControlToolBar::PlayAppearance::Looped
|
||||
: ControlToolBar::PlayAppearance::Straight;
|
||||
ctb->PlayPlayRegion((SelectedRegion(start, end)),
|
||||
options, PlayMode::normalPlay,
|
||||
@ -2486,7 +2504,6 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
mPlayRegionLock = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AdornedRulerPanel::UpdateStatusBar(StatusChoice choice)
|
||||
{
|
||||
@ -2704,8 +2721,8 @@ void AdornedRulerPanel::DoDrawPlayRegion(wxDC * dc)
|
||||
|
||||
if (start >= 0)
|
||||
{
|
||||
int x1 = Time2Pos(start) + 1;
|
||||
int x2 = Time2Pos(end);
|
||||
const int x1 = Time2Pos(start) + 1;
|
||||
const int x2 = Time2Pos(end);
|
||||
int y = mInner.y - TopMargin + mInner.height/2;
|
||||
|
||||
bool isLocked = mProject->IsPlayRegionLocked();
|
||||
@ -2746,7 +2763,7 @@ void AdornedRulerPanel::DoDrawPlayRegion(wxDC * dc)
|
||||
|
||||
r.x = x1 + PLAY_REGION_TRIANGLE_SIZE;
|
||||
r.y = y - PLAY_REGION_RECT_HEIGHT/2 + PLAY_REGION_GLOBAL_OFFSET_Y;
|
||||
r.width = x2-x1 - PLAY_REGION_TRIANGLE_SIZE*2;
|
||||
r.width = std::max(0, x2-x1 - PLAY_REGION_TRIANGLE_SIZE*2);
|
||||
r.height = PLAY_REGION_RECT_HEIGHT;
|
||||
dc->DrawRectangle(r);
|
||||
}
|
||||
@ -2762,8 +2779,8 @@ void AdornedRulerPanel::DoDrawBorder(wxDC * dc)
|
||||
if (mShowScrubbing) {
|
||||
// Let's distinguish the scrubbing area by using the same gray as for
|
||||
// selected track control panel.
|
||||
AColor::Medium(&mBackDC, true);
|
||||
mBackDC.DrawRectangle(mScrubZone);
|
||||
AColor::Medium(dc, true);
|
||||
dc->DrawRectangle(mScrubZone);
|
||||
}
|
||||
|
||||
wxRect r = mOuter;
|
||||
|
@ -321,6 +321,9 @@ private:
|
||||
void OnSize(wxSizeEvent &evt);
|
||||
void UpdateRects();
|
||||
void OnMouseEvents(wxMouseEvent &evt);
|
||||
void HandleQPClick(wxMouseEvent &event, wxCoord mousePosX);
|
||||
void HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX);
|
||||
void HandleQPRelease(wxMouseEvent &event);
|
||||
|
||||
enum class StatusChoice {
|
||||
EnteringQP,
|
||||
|
@ -28,6 +28,8 @@ public:
|
||||
void swap(wxFileNameWrapper &that)
|
||||
{
|
||||
if (this != &that) {
|
||||
#if 0
|
||||
// Awful hack number 1 makes gcc 5 choke
|
||||
enum : size_t { Size = sizeof(*this) };
|
||||
// Do it bitwise.
|
||||
// std::aligned_storage<Size>::type buffer;
|
||||
@ -35,6 +37,32 @@ public:
|
||||
memcpy(&buffer, this, Size);
|
||||
memcpy(this, &that, Size);
|
||||
memcpy(&that, &buffer, Size);
|
||||
#else
|
||||
// Awful hack number 2 relies on knowing the class layout
|
||||
// This is the less evil one but watch out for redefinition of the base class
|
||||
struct Contents
|
||||
{
|
||||
void swap(Contents &that) {
|
||||
m_volume.swap(that.m_volume);
|
||||
m_dirs.swap(that.m_dirs);
|
||||
m_name.swap(that.m_name);
|
||||
m_ext.swap(that.m_ext);
|
||||
std::swap(m_relative, that.m_relative);
|
||||
std::swap(m_hasExt, that.m_hasExt);
|
||||
std::swap(m_dontFollowLinks, that.m_dontFollowLinks);
|
||||
};
|
||||
|
||||
wxString m_volume;
|
||||
wxArrayString m_dirs;
|
||||
wxString m_name, m_ext;
|
||||
bool m_relative;
|
||||
bool m_hasExt;
|
||||
bool m_dontFollowLinks;
|
||||
};
|
||||
|
||||
reinterpret_cast<Contents*>(this)->swap
|
||||
(*reinterpret_cast<Contents*>(&that));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user