1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-16 17:41:14 +01:00

"new"->"NEW" in comments, easier to find remaining naked operator new

This commit is contained in:
Paul Licameli
2016-02-13 10:43:16 -05:00
parent 56e7653343
commit 7c4c45a0d5
143 changed files with 451 additions and 451 deletions

View File

@@ -27,7 +27,7 @@ updating the ODPCMAliasBlockFile and the GUI of the newly available data.
//36 blockfiles > 3 minutes stereo 44.1kHz per ODTask::DoSome
#define kNumBlockFilesPerDoSome 36
///Creates a new task that computes summaries for a wavetrack that needs to be specified through SetWaveTrack()
///Creates a NEW task that computes summaries for a wavetrack that needs to be specified through SetWaveTrack()
ODComputeSummaryTask::ODComputeSummaryTask()
{
mMaxBlockFiles = 0;
@@ -229,7 +229,7 @@ void ODComputeSummaryTask::Update()
}
mWaveTrackMutex.Unlock();
//get the new order.
//get the NEW order.
mBlockFilesMutex.Lock();
OrderBlockFiles(tempBlocks);
mBlockFilesMutex.Unlock();

View File

@@ -114,7 +114,7 @@ ODDecodeFFmpegTask::ODDecodeFFmpegTask(void* scs,int numStreams, WaveTrack*** ch
mChannels=channels;
mFormatContext = formatContext;
mStreamIndex = streamIndex;
//TODO we probably need to create a new WaveTrack*** pointer and copy.
//TODO we probably need to create a NEW WaveTrack*** pointer and copy.
//same for streamContext, but we should also use a ref counting system - this should be added to streamContext
// mScs = (streamContext**)malloc(sizeof(streamContext**)*mFormatContext->nb_streams);
}
@@ -185,7 +185,7 @@ bool ODFFmpegDecoder::SeekingAllowed()
if(!audioStreamExists)
goto test_failed;
//TODO: now try a seek and see if dts/pts (decode/presentation timestamp) is updated as we expected it to be.
//This should be done using a new AVFormatContext clone so that we don't ruin the file pointer if we fail.
//This should be done using a NEW AVFormatContext clone so that we don't ruin the file pointer if we fail.
// url_fseek(mFormatContext->pb,0,SEEK_SET);
@@ -308,7 +308,7 @@ int ODFFmpegDecoder::Decode(SampleBuffer & data, sampleFormat & format, sampleCo
//TODO update this to work with seek - this only works linearly now.
if(mCurrentPos > start && mCurrentPos <= start+len + kDecodeSampleAllowance)
{
//this next call takes data, start and len as reference variables and updates them to reflect the new area that is needed.
//this next call takes data, start and len as reference variables and updates them to reflect the NEW area that is needed.
FillDataFromCache(bufStart, format, start,len,channel);
}
@@ -448,10 +448,10 @@ int ODFFmpegDecoder::Decode(SampleBuffer & data, sampleFormat & format, sampleCo
}
}
//this next call takes data, start and len as reference variables and updates them to reflect the new area that is needed.
//this next call takes data, start and len as reference variables and updates them to reflect the NEW area that is needed.
FillDataFromCache(bufStart, format, start, len, channel);
// CHECK: not sure if we need this. In any case it has to be updated for the new float case (not just int16)
// CHECK: not sure if we need this. In any case it has to be updated for the NEW float case (not just int16)
//if for some reason we couldn't get the samples, fill them with silence
/*
int16_t* outBuf = (int16_t*) bufStart;
@@ -466,7 +466,7 @@ int ODFFmpegDecoder::Decode(SampleBuffer & data, sampleFormat & format, sampleCo
// the minimum amount of cache entries necessary to warrant a binary search.
#define kODFFmpegSearchThreshold 10
///returns the number of samples filled in from start.
//also updates data and len to reflect new unfilled area - start is unmodified.
//also updates data and len to reflect NEW unfilled area - start is unmodified.
int ODFFmpegDecoder::FillDataFromCache(samplePtr & data, sampleFormat outFormat, sampleCount &start, sampleCount& len, unsigned int channel)
{
if(mDecodeCache.size() <= 0)
@@ -600,7 +600,7 @@ int ODFFmpegDecoder::DecodeFrame(streamContext *sc, bool flushing)
//stick it in the cache.
//TODO- consider growing/unioning a few cache buffers like WaveCache does.
//however we can't use wavecache as it isn't going to handle our stereo interleaved part, and isn't for samples
//However if other ODDecode tasks need this, we should do a new class for caching.
//However if other ODDecode tasks need this, we should do a NEW class for caching.
FFMpegDecodeCache* cache = new FFMpegDecodeCache;
//len is number of samples per channel
cache->numChannels = sc->m_stream->codec->channels;
@@ -630,7 +630,7 @@ void ODFFmpegDecoder::InsertCache(FFMpegDecodeCache* cache) {
//check greater than OR equals because we want to insert infront of old dupes.
if(mDecodeCache[guess]->start>= cache->start) {
// if(mDecodeCache[guess]->start == cache->start) {
// printf("dupe! start cache %llu start new cache %llu, mCurrentPos %llu\n",mDecodeCache[guess]->start, cache->start, mCurrentPos);
// printf("dupe! start cache %llu start NEW cache %llu, mCurrentPos %llu\n",mDecodeCache[guess]->start, cache->start, mCurrentPos);
// }
searchEnd = guess;
}

View File

@@ -22,7 +22,7 @@ updating the ODPCMAliasBlockFile and the GUI of the newly available data.
#include "../WaveTrack.h"
#include <wx/wx.h>
///Creates a new task that computes summaries for a wavetrack that needs to be specified through SetWaveTrack()
///Creates a NEW task that computes summaries for a wavetrack that needs to be specified through SetWaveTrack()
ODDecodeTask::ODDecodeTask()
{
mMaxBlockFiles = 0;
@@ -184,7 +184,7 @@ void ODDecodeTask::Update()
}
mWaveTrackMutex.Unlock();
//get the new order.
//get the NEW order.
OrderBlockFiles(tempBlocks);
}

View File

@@ -134,7 +134,7 @@ void ODManager::RemoveTaskIfInQueue(ODTask* task)
}
///Adds a new task to the queue. Creates a queue if the tracks associated with the task is not in the list
///Adds a NEW task to the queue. Creates a queue if the tracks associated with the task is not in the list
///
///@param task the task to add
///@param lockMutex locks the mutexes if true (default). This function is used within other ODManager calls, which many need to set this to false.
@@ -161,7 +161,7 @@ void ODManager::AddNewTask(ODTask* task, bool lockMutex)
}
else
{
//Make a new one, add it to the local track queue, and to the immediate running task list,
//Make a NEW one, add it to the local track queue, and to the immediate running task list,
//since this task is definitely at the head
queue = new ODWaveTrackTaskQueue();
queue->AddTask(task);
@@ -251,7 +251,7 @@ void ODManager::Start()
mTerminateMutex.Unlock();
// printf("ODManager thread running \n");
//we should look at our WaveTrack queues to see if we can process a new task to the running queue.
//we should look at our WaveTrack queues to see if we can process a NEW task to the running queue.
UpdateQueues();
//start some threads if necessary
@@ -272,7 +272,7 @@ void ODManager::Start()
mCurrentThreadsMutex.Unlock();
mTasksMutex.Lock();
//detach a new thread.
//detach a NEW thread.
thread = new ODTaskThread(mTasks[0]);//task);
//thread->SetPriority(10);//default is 50.
thread->Create();
@@ -404,7 +404,7 @@ void ODManager::ReplaceWaveTrack(WaveTrack* oldTrack,WaveTrack* newTrack)
mQueuesMutex.Unlock();
}
///if it shares a queue/task, creates a new queue/task for the track, and removes it from any previously existing tasks.
///if it shares a queue/task, creates a NEW queue/task for the track, and removes it from any previously existing tasks.
void ODManager::MakeWaveTrackIndependent(WaveTrack* track)
{
ODWaveTrackTaskQueue* owner=NULL;
@@ -485,7 +485,7 @@ void ODManager::DemandTrackUpdate(WaveTrack* track, double seconds)
mQueuesMutex.Unlock();
}
///remove tasks from ODWaveTrackTaskQueues that have been done. Schedules new ones if they exist
///remove tasks from ODWaveTrackTaskQueues that have been done. Schedules NEW ones if they exist
///Also remove queues that have become empty.
void ODManager::UpdateQueues()
{

View File

@@ -70,7 +70,7 @@ class ODManager
///removes a wavetrack and notifies its associated tasks to stop using its reference.
void RemoveWaveTrack(WaveTrack* track);
///if it shares a queue/task, creates a new queue/task for the track, and removes it from any previously existing tasks.
///if it shares a queue/task, creates a NEW queue/task for the track, and removes it from any previously existing tasks.
void MakeWaveTrackIndependent(WaveTrack* track);
///attach the track in question to another, already existing track's queues and tasks. Remove the task/tracks.
@@ -126,7 +126,7 @@ class ODManager
///Start the main loop for the manager.
void Start();
///Remove references in our array to Tasks that have been completed/Schedule new ones
///Remove references in our array to Tasks that have been completed/Schedule NEW ones
void UpdateQueues();
//instance

View File

@@ -356,7 +356,7 @@ void ODTask::StopUsingWaveTrack(WaveTrack* track)
mWaveTrackMutex.Unlock();
}
///Replaces all instances to a wavetrack with a new one, effectively transferring the task.
///Replaces all instances to a wavetrack with a NEW one, effectively transferring the task.
void ODTask::ReplaceWaveTrack(WaveTrack* oldTrack,WaveTrack* newTrack)
{
mWaveTrackMutex.Lock();

View File

@@ -81,7 +81,7 @@ class ODTask
virtual void StopUsingWaveTrack(WaveTrack* track);
///Replaces all instances to a wavetrack with a new one, effectively transferring the task.
///Replaces all instances to a wavetrack with a NEW one, effectively transferring the task.
///ODTask has no wavetrack, so it does nothing. But subclasses that do should override this.
virtual void ReplaceWaveTrack(WaveTrack* oldTrack,WaveTrack* newTrack);

View File

@@ -202,7 +202,7 @@ void ODWaveTrackTaskQueue::DemandTrackUpdate(WaveTrack* track, double seconds)
}
//Replaces all instances of a wavetracck with a new one (effectively transferes the task.)
//Replaces all instances of a wavetracck with a NEW one (effectively transferes the task.)
void ODWaveTrackTaskQueue::ReplaceWaveTrack(WaveTrack* oldTrack, WaveTrack* newTrack)
{
if(oldTrack)
@@ -285,7 +285,7 @@ bool ODWaveTrackTaskQueue::IsFrontTaskComplete()
mTasksMutex.Lock();
if(mTasks.size())
{
//there is a chance the task got updated and now has more to do, (like when it is joined with a new track)
//there is a chance the task got updated and now has more to do, (like when it is joined with a NEW track)
//check.
mTasks[0]->RecalculatePercentComplete();
bool ret;