mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 16:20:05 +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
|
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
|
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.
|
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
|
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
|
// Make instantiations for the linker to find
|
||||||
template Track *TrackList::Add<TimeTrack>(std::unique_ptr<TimeTrack> &&);
|
template Track *TrackList::Add<TimeTrack>(std::unique_ptr<TimeTrack> &&);
|
||||||
|
#if defined(USE_MIDI)
|
||||||
template Track *TrackList::Add<NoteTrack>(std::unique_ptr<NoteTrack> &&);
|
template Track *TrackList::Add<NoteTrack>(std::unique_ptr<NoteTrack> &&);
|
||||||
|
#endif
|
||||||
template Track *TrackList::Add<WaveTrack>(std::unique_ptr<WaveTrack> &&);
|
template Track *TrackList::Add<WaveTrack>(std::unique_ptr<WaveTrack> &&);
|
||||||
template Track *TrackList::Add<LabelTrack>(std::unique_ptr<LabelTrack> &&);
|
template Track *TrackList::Add<LabelTrack>(std::unique_ptr<LabelTrack> &&);
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ bool EffectTruncSilence::ProcessIndependently()
|
|||||||
if (track2->GetKind() == Track::Wave &&
|
if (track2->GetKind() == Track::Wave &&
|
||||||
!(track2 == track || track2 == link) &&
|
!(track2 == track || track2 == link) &&
|
||||||
track2->GetSelected()) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2109,8 +2109,11 @@ bool AdornedRulerPanel::IsWithinMarker(int mousePosX, double markerTime)
|
|||||||
void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||||
{
|
{
|
||||||
// Disable mouse actions on Timeline while recording.
|
// Disable mouse actions on Timeline while recording.
|
||||||
if (mIsRecording)
|
if (mIsRecording) {
|
||||||
|
if (HasCapture())
|
||||||
|
ReleaseMouse();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const bool inScrubZone =
|
const bool inScrubZone =
|
||||||
// only if scrubbing is allowed now
|
// only if scrubbing is allowed now
|
||||||
@ -2121,17 +2124,14 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
const bool changeInScrubZone = (inScrubZone != mPrevInScrubZone);
|
const bool changeInScrubZone = (inScrubZone != mPrevInScrubZone);
|
||||||
mPrevInScrubZone = inScrubZone;
|
mPrevInScrubZone = inScrubZone;
|
||||||
|
|
||||||
double t0 = mTracks->GetStartTime();
|
|
||||||
double t1 = mTracks->GetEndTime();
|
|
||||||
double sel0 = mProject->GetSel0();
|
|
||||||
double sel1 = mProject->GetSel1();
|
|
||||||
|
|
||||||
wxCoord xx = evt.GetX();
|
wxCoord xx = evt.GetX();
|
||||||
wxCoord mousePosX = xx;
|
wxCoord mousePosX = xx;
|
||||||
UpdateQuickPlayPos(mousePosX);
|
UpdateQuickPlayPos(mousePosX);
|
||||||
|
HandleSnapping();
|
||||||
|
|
||||||
// If not looping, restrict selection to end of project
|
// If not looping, restrict selection to end of project
|
||||||
if (!inScrubZone && !evt.ShiftDown()) {
|
if (!inScrubZone && !evt.ShiftDown()) {
|
||||||
|
const double t1 = mTracks->GetEndTime();
|
||||||
mQuickPlayPos = std::min(t1, mQuickPlayPos);
|
mQuickPlayPos = std::min(t1, mQuickPlayPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2201,11 +2201,6 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
mPlayRegionLock = mProject->IsPlayRegionLocked();
|
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
|
// Handle entering and leaving of the bar, or movement from
|
||||||
// one portion (quick play or scrub) to the other
|
// one portion (quick play or scrub) to the other
|
||||||
if (evt.Leaving() || (changeInScrubZone && inScrubZone)) {
|
if (evt.Leaving() || (changeInScrubZone && inScrubZone)) {
|
||||||
@ -2244,6 +2239,9 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
if (!mQuickPlayEnabled)
|
if (!mQuickPlayEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
|
||||||
|
bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
|
||||||
|
|
||||||
if (isWithinStart || isWithinEnd) {
|
if (isWithinStart || isWithinEnd) {
|
||||||
if (!mIsWE) {
|
if (!mIsWE) {
|
||||||
SetCursor(mCursorSizeWE);
|
SetCursor(mCursorSizeWE);
|
||||||
@ -2257,14 +2255,22 @@ 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;
|
mQuickPlayInd = true;
|
||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
DrawQuickPlayIndicator(&dc);
|
DrawQuickPlayIndicator(&dc);
|
||||||
|
}
|
||||||
|
|
||||||
if (evt.LeftDown())
|
void AdornedRulerPanel::HandleQPClick(wxMouseEvent &evt, wxCoord mousePosX)
|
||||||
{
|
{
|
||||||
// Temporarily unlock locked play region
|
// Temporarily unlock locked play region
|
||||||
if (mPlayRegionLock && evt.LeftDown()) {
|
if (mPlayRegionLock && evt.LeftDown()) {
|
||||||
//mPlayRegionLock = true;
|
//mPlayRegionLock = true;
|
||||||
@ -2272,7 +2278,8 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mLeftDownClick = mQuickPlayPos;
|
mLeftDownClick = mQuickPlayPos;
|
||||||
isWithinClick = IsWithinMarker(mousePosX, mLeftDownClick);
|
bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
|
||||||
|
bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
|
||||||
|
|
||||||
if (isWithinStart || isWithinEnd) {
|
if (isWithinStart || isWithinEnd) {
|
||||||
// If Quick-Play is playing from a point, we need to treat it as a click
|
// If Quick-Play is playing from a point, we need to treat it as a click
|
||||||
@ -2299,9 +2306,15 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
if (mMouseEventState != mesNone)
|
if (mMouseEventState != mesNone)
|
||||||
SetCursor(mCursorSizeWE);
|
SetCursor(mCursorSizeWE);
|
||||||
CaptureMouse();
|
CaptureMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
if (evt.LeftIsDown()) {
|
|
||||||
switch (mMouseEventState)
|
switch (mMouseEventState)
|
||||||
{
|
{
|
||||||
case mesNone:
|
case mesNone:
|
||||||
@ -2351,7 +2364,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
break;
|
break;
|
||||||
case mesSelectingPlayRegionClick:
|
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) {
|
if (isWithinClick || mLeftDownClick == -1) {
|
||||||
DrawQuickPlayIndicator(NULL);
|
DrawQuickPlayIndicator(NULL);
|
||||||
|
|
||||||
@ -2385,10 +2398,10 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
}
|
}
|
||||||
Refresh();
|
Refresh();
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evt.LeftUp())
|
void AdornedRulerPanel::HandleQPRelease(wxMouseEvent &evt)
|
||||||
{
|
{
|
||||||
HideQuickPlayIndicator();
|
HideQuickPlayIndicator();
|
||||||
|
|
||||||
if (HasCapture())
|
if (HasCapture())
|
||||||
@ -2401,6 +2414,11 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
mPlayRegionEnd = tmp;
|
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
|
// We want some audio in the selection, but we allow a dragged
|
||||||
// region to include selected white-space and space before audio start.
|
// region to include selected white-space and space before audio start.
|
||||||
if (evt.ShiftDown() && (mPlayRegionStart == mPlayRegionEnd)) {
|
if (evt.ShiftDown() && (mPlayRegionStart == mPlayRegionEnd)) {
|
||||||
@ -2461,7 +2479,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
|
|
||||||
ControlToolBar::PlayAppearance appearance =
|
ControlToolBar::PlayAppearance appearance =
|
||||||
evt.ControlDown() ? ControlToolBar::PlayAppearance::CutPreview
|
evt.ControlDown() ? ControlToolBar::PlayAppearance::CutPreview
|
||||||
: loopEnabled ? ControlToolBar::PlayAppearance::Looped
|
: options.playLooped ? ControlToolBar::PlayAppearance::Looped
|
||||||
: ControlToolBar::PlayAppearance::Straight;
|
: ControlToolBar::PlayAppearance::Straight;
|
||||||
ctb->PlayPlayRegion((SelectedRegion(start, end)),
|
ctb->PlayPlayRegion((SelectedRegion(start, end)),
|
||||||
options, PlayMode::normalPlay,
|
options, PlayMode::normalPlay,
|
||||||
@ -2485,7 +2503,6 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
|||||||
// and release local lock
|
// and release local lock
|
||||||
mPlayRegionLock = false;
|
mPlayRegionLock = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdornedRulerPanel::UpdateStatusBar(StatusChoice choice)
|
void AdornedRulerPanel::UpdateStatusBar(StatusChoice choice)
|
||||||
@ -2704,8 +2721,8 @@ void AdornedRulerPanel::DoDrawPlayRegion(wxDC * dc)
|
|||||||
|
|
||||||
if (start >= 0)
|
if (start >= 0)
|
||||||
{
|
{
|
||||||
int x1 = Time2Pos(start) + 1;
|
const int x1 = Time2Pos(start) + 1;
|
||||||
int x2 = Time2Pos(end);
|
const int x2 = Time2Pos(end);
|
||||||
int y = mInner.y - TopMargin + mInner.height/2;
|
int y = mInner.y - TopMargin + mInner.height/2;
|
||||||
|
|
||||||
bool isLocked = mProject->IsPlayRegionLocked();
|
bool isLocked = mProject->IsPlayRegionLocked();
|
||||||
@ -2746,7 +2763,7 @@ void AdornedRulerPanel::DoDrawPlayRegion(wxDC * dc)
|
|||||||
|
|
||||||
r.x = x1 + PLAY_REGION_TRIANGLE_SIZE;
|
r.x = x1 + PLAY_REGION_TRIANGLE_SIZE;
|
||||||
r.y = y - PLAY_REGION_RECT_HEIGHT/2 + PLAY_REGION_GLOBAL_OFFSET_Y;
|
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;
|
r.height = PLAY_REGION_RECT_HEIGHT;
|
||||||
dc->DrawRectangle(r);
|
dc->DrawRectangle(r);
|
||||||
}
|
}
|
||||||
@ -2762,8 +2779,8 @@ void AdornedRulerPanel::DoDrawBorder(wxDC * dc)
|
|||||||
if (mShowScrubbing) {
|
if (mShowScrubbing) {
|
||||||
// Let's distinguish the scrubbing area by using the same gray as for
|
// Let's distinguish the scrubbing area by using the same gray as for
|
||||||
// selected track control panel.
|
// selected track control panel.
|
||||||
AColor::Medium(&mBackDC, true);
|
AColor::Medium(dc, true);
|
||||||
mBackDC.DrawRectangle(mScrubZone);
|
dc->DrawRectangle(mScrubZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRect r = mOuter;
|
wxRect r = mOuter;
|
||||||
|
@ -321,6 +321,9 @@ private:
|
|||||||
void OnSize(wxSizeEvent &evt);
|
void OnSize(wxSizeEvent &evt);
|
||||||
void UpdateRects();
|
void UpdateRects();
|
||||||
void OnMouseEvents(wxMouseEvent &evt);
|
void OnMouseEvents(wxMouseEvent &evt);
|
||||||
|
void HandleQPClick(wxMouseEvent &event, wxCoord mousePosX);
|
||||||
|
void HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX);
|
||||||
|
void HandleQPRelease(wxMouseEvent &event);
|
||||||
|
|
||||||
enum class StatusChoice {
|
enum class StatusChoice {
|
||||||
EnteringQP,
|
EnteringQP,
|
||||||
|
@ -28,6 +28,8 @@ public:
|
|||||||
void swap(wxFileNameWrapper &that)
|
void swap(wxFileNameWrapper &that)
|
||||||
{
|
{
|
||||||
if (this != &that) {
|
if (this != &that) {
|
||||||
|
#if 0
|
||||||
|
// Awful hack number 1 makes gcc 5 choke
|
||||||
enum : size_t { Size = sizeof(*this) };
|
enum : size_t { Size = sizeof(*this) };
|
||||||
// Do it bitwise.
|
// Do it bitwise.
|
||||||
// std::aligned_storage<Size>::type buffer;
|
// std::aligned_storage<Size>::type buffer;
|
||||||
@ -35,6 +37,32 @@ public:
|
|||||||
memcpy(&buffer, this, Size);
|
memcpy(&buffer, this, Size);
|
||||||
memcpy(this, &that, Size);
|
memcpy(this, &that, Size);
|
||||||
memcpy(&that, &buffer, 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