1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-04 14:39:08 +02:00

Fix mac build

This commit is contained in:
Paul Licameli 2016-03-30 23:24:39 -04:00
parent 7e83d70350
commit 13595620cf
4 changed files with 15 additions and 20 deletions

View File

@ -5605,9 +5605,8 @@ void AudacityProject::HandleMixAndRender(bool toNewTrack)
{ {
wxGetApp().SetMissingAliasedFileWarningShouldShow(true); wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
auto results = WaveTrack::Holder uNewLeft, uNewRight;
::MixAndRender(mTracks, mTrackFactory, mRate, mDefaultFormat, 0.0, 0.0); MixAndRender(mTracks, mTrackFactory, mRate, mDefaultFormat, 0.0, 0.0, uNewLeft, uNewRight);
auto &uNewLeft = results.first, &uNewRight = results.second;
if (uNewLeft) { if (uNewLeft) {
// Remove originals, get stats on what tracks were mixed // Remove originals, get stats on what tracks were mixed

View File

@ -43,11 +43,13 @@
#include "float_cast.h" #include "float_cast.h"
//TODO-MB: wouldn't it make more sense to DELETE the time track after 'mix and render'? //TODO-MB: wouldn't it make more sense to DELETE the time track after 'mix and render'?
std::pair<WaveTrack::Holder, WaveTrack::Holder> void MixAndRender(TrackList *tracks, TrackFactory *trackFactory,
MixAndRender(TrackList *tracks, TrackFactory *trackFactory,
double rate, sampleFormat format, double rate, sampleFormat format,
double startTime, double endTime) double startTime, double endTime,
WaveTrack::Holder &uLeft, WaveTrack::Holder &uRight)
{ {
uLeft.reset(), uRight.reset();
// This function was formerly known as "Quick Mix". // This function was formerly known as "Quick Mix".
Track *t; Track *t;
bool mono = false; /* flag if output can be mono without loosing anything*/ bool mono = false; /* flag if output can be mono without loosing anything*/
@ -197,13 +199,11 @@ MixAndRender(TrackList *tracks, TrackFactory *trackFactory,
mixRight->Flush(); mixRight->Flush();
if (updateResult == eProgressCancelled || updateResult == eProgressFailed) if (updateResult == eProgressCancelled || updateResult == eProgressFailed)
{ {
return{}; return;
} }
else { else {
return std::make_pair( uLeft = std::move(mixLeft),
std::move(mixLeft), uRight = std::move(mixRight);
std::move(mixRight)
);
#if 0 #if 0
int elapsedMS = wxGetElapsedTime(); int elapsedMS = wxGetElapsedTime();
double elapsedTime = elapsedMS * 0.001; double elapsedTime = elapsedMS * 0.001;

View File

@ -13,7 +13,6 @@
#define __AUDACITY_MIX__ #define __AUDACITY_MIX__
#include "MemoryX.h" #include "MemoryX.h"
#include <utility>
#include <wx/string.h> #include <wx/string.h>
#include "SampleFormat.h" #include "SampleFormat.h"
@ -38,12 +37,10 @@ class WaveTrackConstArray;
* no explicit time range to process, and the whole occupied length of the * no explicit time range to process, and the whole occupied length of the
* input tracks is processed. * input tracks is processed.
*/ */
std::pair< void MixAndRender(TrackList * tracks, TrackFactory *factory,
std::unique_ptr<WaveTrack>,
std::unique_ptr<WaveTrack>
> MixAndRender(TrackList * tracks, TrackFactory *factory,
double rate, sampleFormat format, double rate, sampleFormat format,
double startTime, double endTime); double startTime, double endTime,
std::unique_ptr<WaveTrack> &uLeft, std::unique_ptr<WaveTrack> &uRight);
void MixBuffers(int numChannels, int *channelFlags, float *gains, void MixBuffers(int numChannels, int *channelFlags, float *gains,
samplePtr src, samplePtr src,

View File

@ -2569,9 +2569,8 @@ void Effect::Preview(bool dryOnly)
// Linear Effect preview optimised by pre-mixing to one track. // Linear Effect preview optimised by pre-mixing to one track.
// Generators need to generate per track. // Generators need to generate per track.
if (mIsLinearEffect && !isGenerator) { if (mIsLinearEffect && !isGenerator) {
auto results = ::MixAndRender(saveTracks, mFactory, rate, floatSample, mT0, t1); WaveTrack::Holder mixLeft, mixRight;
auto &mixLeft = results.first; MixAndRender(saveTracks, mFactory, rate, floatSample, mT0, t1, mixLeft, mixRight);
auto &mixRight = results.second;
if (!mixLeft) { if (!mixLeft) {
delete mTracks; delete mTracks;
mTracks = saveTracks; mTracks = saveTracks;