mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 00:20:06 +02:00
Merge branch 'master' into antifrag
This commit is contained in:
commit
4fefad1028
11
.travis.yml
11
.travis.yml
@ -1,12 +1,17 @@
|
|||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.8
|
||||||
|
- gcc-4.8
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install -y libwxgtk3.0-dev libgtk2.0-dev
|
- sudo apt-get install -y libwxgtk3.0-dev libgtk2.0-dev
|
||||||
- git show -s --format="wxT(\"<a href=\\\"http://github.com/audacity/audacity/commit/%H\\\">%h</a> of %cd\")"
|
- git show -s --format="wxT(\"<a href=\\\"http://github.com/audacity/audacity/commit/%H\\\">%h</a> of %cd\")"
|
||||||
- git show -s --format="wxT(\"<a href=\\\"http://github.com/audacity/audacity/commit/%H\\\">%h</a> of %cd\")" > ./src/RevisionIdent.h
|
- git show -s --format="wxT(\"<a href=\\\"http://github.com/audacity/audacity/commit/%H\\\">%h</a> of %cd\")" > ./src/RevisionIdent.h
|
||||||
|
- export CXX="g++-4.8" CC="gcc-4.8"
|
||||||
language:
|
language:
|
||||||
- cpp
|
- cpp
|
||||||
compiler:
|
|
||||||
- gcc
|
|
||||||
script:
|
script:
|
||||||
- aclocal --install -I m4 && automake && ./configure && make
|
- aclocal --install -I m4 && automake && ./configure && make
|
||||||
|
|
||||||
|
@ -216,6 +216,10 @@ OBJCXXLINK = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
|||||||
--mode=link $(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) \
|
--mode=link $(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) \
|
||||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
AM_V_OBJCXXLD = $(am__v_OBJCXXLD_@AM_V@)
|
AM_V_OBJCXXLD = $(am__v_OBJCXXLD_@AM_V@)
|
||||||
|
# Overwrite C++ variables with values for Objective-C, because in the end there
|
||||||
|
# is only one linker command that should be configured correctly.
|
||||||
|
@MAC_TRUE@CXXLINK = $(OBJCXXLINK)
|
||||||
|
@MAC_TRUE@AM_V_CXXLD = $(AM_V_OBJCXXLD)
|
||||||
am__v_OBJCXXLD_ = $(am__v_OBJCXXLD_@AM_DEFAULT_V@)
|
am__v_OBJCXXLD_ = $(am__v_OBJCXXLD_@AM_DEFAULT_V@)
|
||||||
am__v_OBJCXXLD_0 = @echo " OBJCXXLD" $@;
|
am__v_OBJCXXLD_0 = @echo " OBJCXXLD" $@;
|
||||||
am__v_OBJCXXLD_1 =
|
am__v_OBJCXXLD_1 =
|
||||||
@ -521,7 +525,7 @@ win/libFileDialog_la-FileDialogPrivate.lo: win/$(am__dirstamp) \
|
|||||||
win/$(DEPDIR)/$(am__dirstamp)
|
win/$(DEPDIR)/$(am__dirstamp)
|
||||||
|
|
||||||
libFileDialog.la: $(libFileDialog_la_OBJECTS) $(libFileDialog_la_DEPENDENCIES) $(EXTRA_libFileDialog_la_DEPENDENCIES)
|
libFileDialog.la: $(libFileDialog_la_OBJECTS) $(libFileDialog_la_DEPENDENCIES) $(EXTRA_libFileDialog_la_DEPENDENCIES)
|
||||||
$(AM_V_OBJCXXLD)$(OBJCXXLINK) -rpath $(libdir) $(libFileDialog_la_OBJECTS) $(libFileDialog_la_LIBADD) $(LIBS)
|
$(AM_V_CXXLD)$(CXXLINK) -rpath $(libdir) $(libFileDialog_la_OBJECTS) $(libFileDialog_la_LIBADD) $(LIBS)
|
||||||
|
|
||||||
mostlyclean-compile:
|
mostlyclean-compile:
|
||||||
-rm -f *.$(OBJEXT)
|
-rm -f *.$(OBJEXT)
|
||||||
|
@ -3,38 +3,40 @@ is 10.6. To build Audacity using Xcode 5.1 or newer, you need
|
|||||||
to extract the 10.6 SDK from an earlier version of Xcode.
|
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.0
|
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 been verified to work as well.
|
||||||
|
|
||||||
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 and open it in Finder
|
2) Download Xcode 4.3.3 (it includes the 10.6 and 10.7 SDK's despite
|
||||||
3) Right click the "Xcode.app" bundle and select "Show Package Contents"
|
the downloads page says it only has the 10.7 SDK).
|
||||||
4) Navigate down the directories to get to:
|
3) Open the DMG in Finder.
|
||||||
|
4) Right-click the "Xcode.app" bundle and select "Show Package Contents".
|
||||||
|
5) Navigate down the directories to get to:
|
||||||
|
|
||||||
Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
|
Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ .
|
||||||
|
|
||||||
5) Copy the MacOSX10.6.sdk folder to:
|
6) Copy the MacOSX10.6.sdk folder to:
|
||||||
|
|
||||||
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
|
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
|
||||||
|
|
||||||
Xcode is now ready.
|
Xcode is now ready.
|
||||||
|
|
||||||
6) Download wxWidgets. We currently require version 3.0.2, which can be downloaded from:
|
7) Download wxWidgets. We currently require version 3.0.2, which can be downloaded from:
|
||||||
|
|
||||||
http://sourceforge.net/projects/wxwindows/files/3.0.2/wxWidgets-3.0.2.tar.bz2
|
http://sourceforge.net/projects/wxwindows/files/3.0.2/wxWidgets-3.0.2.tar.bz2
|
||||||
|
|
||||||
7) Once the download is complete, untar it (your browser may have already done this):
|
8) Once the download is complete, untar it (your browser may have already done this):
|
||||||
|
|
||||||
tar xf wxWidgets-3.0.2.tar.bz2
|
tar xf wxWidgets-3.0.2.tar.bz2 .
|
||||||
|
|
||||||
8) Apply the following fixes to wxWidgets:
|
9) Apply the following fixes to wxWidgets:
|
||||||
|
|
||||||
cd wxWidgets-3.0.2
|
cd wxWidgets-3.0.2
|
||||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/wxMac-3.0.2-fixes.patch
|
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/wxMac-3.0.2-fixes.patch .
|
||||||
|
|
||||||
9) And finally build/install wxWidgets:
|
10) And finally build/install wxWidgets:
|
||||||
|
|
||||||
sudo <path to Audacity source>/mac/build_wxwidgets
|
sudo <path to Audacity source>/mac/build_wxwidgets .
|
||||||
|
|
||||||
You should now be able to build Audacity using either the Xcode application or the
|
You should now be able to build Audacity using either the Xcode application or the
|
||||||
xcodebuild command line tool.
|
xcodebuild command line tool.
|
||||||
|
@ -1107,8 +1107,13 @@ void AudioIO::HandleDeviceChange()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// get the selected record and playback devices
|
// get the selected record and playback devices
|
||||||
int playDeviceNum = getPlayDevIndex();
|
const int playDeviceNum = getPlayDevIndex();
|
||||||
int recDeviceNum = getRecordDevIndex();
|
const int recDeviceNum = getRecordDevIndex();
|
||||||
|
|
||||||
|
// If no change needed, return
|
||||||
|
if (mCachedPlaybackIndex == playDeviceNum &&
|
||||||
|
mCachedCaptureIndex == recDeviceNum)
|
||||||
|
return;
|
||||||
|
|
||||||
// cache playback/capture rates
|
// cache playback/capture rates
|
||||||
mCachedPlaybackRates = GetSupportedPlaybackRates(playDeviceNum);
|
mCachedPlaybackRates = GetSupportedPlaybackRates(playDeviceNum);
|
||||||
|
@ -283,6 +283,28 @@ RecordingRecoveryHandler::RecordingRecoveryHandler(AudacityProject* proj)
|
|||||||
mNumChannels = -1;
|
mNumChannels = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int RecordingRecoveryHandler::FindTrack() const
|
||||||
|
{
|
||||||
|
WaveTrackArray tracks = mProject->GetTracks()->GetWaveTrackArray(false);
|
||||||
|
int index;
|
||||||
|
if (mAutoSaveIdent)
|
||||||
|
{
|
||||||
|
for (index = 0; index < (int)tracks.GetCount(); index++)
|
||||||
|
{
|
||||||
|
if (tracks[index]->GetAutoSaveIdent() == mAutoSaveIdent)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
index = tracks.GetCount() - mNumChannels + mChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
|
bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
|
||||||
const wxChar **attrs)
|
const wxChar **attrs)
|
||||||
{
|
{
|
||||||
@ -296,23 +318,9 @@ bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to find the track and sequence where the blockfile belongs
|
|
||||||
WaveTrackArray tracks = mProject->GetTracks()->GetWaveTrackArray(false);
|
WaveTrackArray tracks = mProject->GetTracks()->GetWaveTrackArray(false);
|
||||||
int index;
|
int index = FindTrack();
|
||||||
if (mAutoSaveIdent)
|
// We need to find the track and sequence where the blockfile belongs
|
||||||
{
|
|
||||||
for (index = 0; index < (int) tracks.GetCount(); index++)
|
|
||||||
{
|
|
||||||
if (tracks[index]->GetAutoSaveIdent() == mAutoSaveIdent)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
index = tracks.GetCount() - mNumChannels + mChannel;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index < 0 || index >= (int) tracks.GetCount())
|
if (index < 0 || index >= (int) tracks.GetCount())
|
||||||
{
|
{
|
||||||
@ -326,10 +334,14 @@ bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
|
|||||||
Sequence* seq = clip->GetSequence();
|
Sequence* seq = clip->GetSequence();
|
||||||
|
|
||||||
// Load the blockfile from the XML
|
// Load the blockfile from the XML
|
||||||
BlockFile* blockFile = NULL;
|
|
||||||
DirManager* dirManager = mProject->GetDirManager();
|
DirManager* dirManager = mProject->GetDirManager();
|
||||||
dirManager->SetLoadingFormat(seq->GetSampleFormat());
|
dirManager->SetLoadingFormat(seq->GetSampleFormat());
|
||||||
dirManager->SetLoadingTarget(&blockFile);
|
|
||||||
|
BlockArray array;
|
||||||
|
array.resize(1);
|
||||||
|
dirManager->SetLoadingTarget(&array, 0);
|
||||||
|
BlockFile *& blockFile = array[0].f;
|
||||||
|
|
||||||
if (!dirManager->HandleXMLTag(tag, attrs) || !blockFile)
|
if (!dirManager->HandleXMLTag(tag, attrs) || !blockFile)
|
||||||
{
|
{
|
||||||
// This should only happen if there is a bug
|
// This should only happen if there is a bug
|
||||||
@ -387,6 +399,29 @@ bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RecordingRecoveryHandler::HandleXMLEndTag(const wxChar *tag)
|
||||||
|
{
|
||||||
|
if (wxStrcmp(tag, wxT("simpleblockfile")) == 0)
|
||||||
|
// Still in inner looop
|
||||||
|
return;
|
||||||
|
|
||||||
|
WaveTrackArray tracks = mProject->GetTracks()->GetWaveTrackArray(false);
|
||||||
|
int index = FindTrack();
|
||||||
|
// We need to find the track and sequence where the blockfile belongs
|
||||||
|
|
||||||
|
if (index < 0 || index >= (int)tracks.GetCount()) {
|
||||||
|
// This should only happen if there is a bug
|
||||||
|
wxASSERT(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
WaveTrack* track = tracks.Item(index);
|
||||||
|
WaveClip* clip = track->NewestOrNewClip();
|
||||||
|
Sequence* seq = clip->GetSequence();
|
||||||
|
|
||||||
|
seq->ConsistencyCheck(wxT("RecordingRecoveryHandler::HandleXMLEndTag"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
XMLTagHandler* RecordingRecoveryHandler::HandleXMLChild(const wxChar *tag)
|
XMLTagHandler* RecordingRecoveryHandler::HandleXMLChild(const wxChar *tag)
|
||||||
{
|
{
|
||||||
if (wxStrcmp(tag, wxT("simpleblockfile")) == 0)
|
if (wxStrcmp(tag, wxT("simpleblockfile")) == 0)
|
||||||
|
@ -46,12 +46,16 @@ class RecordingRecoveryHandler: public XMLTagHandler
|
|||||||
public:
|
public:
|
||||||
RecordingRecoveryHandler(AudacityProject* proj);
|
RecordingRecoveryHandler(AudacityProject* proj);
|
||||||
virtual bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
|
virtual bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
|
||||||
|
virtual void HandleXMLEndTag(const wxChar *tag);
|
||||||
virtual XMLTagHandler *HandleXMLChild(const wxChar *tag);
|
virtual XMLTagHandler *HandleXMLChild(const wxChar *tag);
|
||||||
|
|
||||||
// This class only knows reading tags
|
// This class only knows reading tags
|
||||||
virtual void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); }
|
virtual void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
int FindTrack() const;
|
||||||
|
|
||||||
AudacityProject* mProject;
|
AudacityProject* mProject;
|
||||||
int mChannel;
|
int mChannel;
|
||||||
int mNumChannels;
|
int mNumChannels;
|
||||||
|
@ -60,7 +60,7 @@ WX_DECLARE_HASH_MAP(BlockFile *, bool,
|
|||||||
// in the current set of tracks. Enumerating that array allows
|
// in the current set of tracks. Enumerating that array allows
|
||||||
// you to process all block files in the current set.
|
// you to process all block files in the current set.
|
||||||
static void GetAllSeqBlocks(AudacityProject *project,
|
static void GetAllSeqBlocks(AudacityProject *project,
|
||||||
BlockArray *outBlocks)
|
BlockPtrArray *outBlocks)
|
||||||
{
|
{
|
||||||
TrackList *tracks = project->GetTracks();
|
TrackList *tracks = project->GetTracks();
|
||||||
TrackListIterator iter(tracks);
|
TrackListIterator iter(tracks);
|
||||||
@ -72,10 +72,10 @@ static void GetAllSeqBlocks(AudacityProject *project,
|
|||||||
while(node) {
|
while(node) {
|
||||||
WaveClip *clip = node->GetData();
|
WaveClip *clip = node->GetData();
|
||||||
Sequence *sequence = clip->GetSequence();
|
Sequence *sequence = clip->GetSequence();
|
||||||
BlockArray *blocks = sequence->GetBlockArray();
|
BlockArray &blocks = sequence->GetBlockArray();
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < (int)blocks->GetCount(); i++)
|
for (i = 0; i < (int)blocks.size(); i++)
|
||||||
outBlocks->Add(blocks->Item(i));
|
outBlocks->push_back(&blocks.at(i));
|
||||||
node = node->GetNext();
|
node = node->GetNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,11 +92,11 @@ static void ReplaceBlockFiles(AudacityProject *project,
|
|||||||
ReplacedBlockFileHash &hash)
|
ReplacedBlockFileHash &hash)
|
||||||
{
|
{
|
||||||
DirManager *dirManager = project->GetDirManager();
|
DirManager *dirManager = project->GetDirManager();
|
||||||
BlockArray blocks;
|
BlockPtrArray blocks;
|
||||||
GetAllSeqBlocks(project, &blocks);
|
GetAllSeqBlocks(project, &blocks);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < (int)blocks.GetCount(); i++) {
|
for (i = 0; i < (int)blocks.size(); i++) {
|
||||||
if (hash.count(blocks[i]->f) > 0) {
|
if (hash.count(blocks[i]->f) > 0) {
|
||||||
BlockFile *src = blocks[i]->f;
|
BlockFile *src = blocks[i]->f;
|
||||||
BlockFile *dst = hash[src];
|
BlockFile *dst = hash[src];
|
||||||
@ -114,14 +114,14 @@ void FindDependencies(AudacityProject *project,
|
|||||||
{
|
{
|
||||||
sampleFormat format = project->GetDefaultFormat();
|
sampleFormat format = project->GetDefaultFormat();
|
||||||
|
|
||||||
BlockArray blocks;
|
BlockPtrArray blocks;
|
||||||
GetAllSeqBlocks(project, &blocks);
|
GetAllSeqBlocks(project, &blocks);
|
||||||
|
|
||||||
AliasedFileHash aliasedFileHash;
|
AliasedFileHash aliasedFileHash;
|
||||||
BoolBlockFileHash blockFileHash;
|
BoolBlockFileHash blockFileHash;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < (int)blocks.GetCount(); i++) {
|
for (i = 0; i < (int)blocks.size(); i++) {
|
||||||
BlockFile *f = blocks[i]->f;
|
BlockFile *f = blocks[i]->f;
|
||||||
if (f->IsAlias() && (blockFileHash.count(f) == 0))
|
if (f->IsAlias() && (blockFileHash.count(f) == 0))
|
||||||
{
|
{
|
||||||
@ -181,13 +181,13 @@ static void RemoveDependencies(AudacityProject *project,
|
|||||||
aliasedFileHash[fileNameStr] = &aliasedFiles->Item(i);
|
aliasedFileHash[fileNameStr] = &aliasedFiles->Item(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockArray blocks;
|
BlockPtrArray blocks;
|
||||||
GetAllSeqBlocks(project, &blocks);
|
GetAllSeqBlocks(project, &blocks);
|
||||||
|
|
||||||
const sampleFormat format = project->GetDefaultFormat();
|
const sampleFormat format = project->GetDefaultFormat();
|
||||||
ReplacedBlockFileHash blockFileHash;
|
ReplacedBlockFileHash blockFileHash;
|
||||||
wxLongLong completedBytes = 0;
|
wxLongLong completedBytes = 0;
|
||||||
for (i = 0; i < blocks.GetCount(); i++) {
|
for (i = 0; i < blocks.size(); i++) {
|
||||||
BlockFile *f = blocks[i]->f;
|
BlockFile *f = blocks[i]->f;
|
||||||
if (f->IsAlias() && (blockFileHash.count(f) == 0))
|
if (f->IsAlias() && (blockFileHash.count(f) == 0))
|
||||||
{
|
{
|
||||||
|
@ -98,6 +98,7 @@
|
|||||||
#include "Internat.h"
|
#include "Internat.h"
|
||||||
#include "Project.h"
|
#include "Project.h"
|
||||||
#include "Prefs.h"
|
#include "Prefs.h"
|
||||||
|
#include "Sequence.h"
|
||||||
#include "widgets/Warning.h"
|
#include "widgets/Warning.h"
|
||||||
#include "widgets/MultiDialog.h"
|
#include "widgets/MultiDialog.h"
|
||||||
|
|
||||||
@ -349,6 +350,7 @@ DirManager::DirManager()
|
|||||||
projName = wxT("");
|
projName = wxT("");
|
||||||
|
|
||||||
mLoadingTarget = NULL;
|
mLoadingTarget = NULL;
|
||||||
|
mLoadingTargetIdx = 0;
|
||||||
mMaxSamples = -1;
|
mMaxSamples = -1;
|
||||||
|
|
||||||
// toplevel pool hash is fully populated to begin
|
// toplevel pool hash is fully populated to begin
|
||||||
@ -1009,10 +1011,12 @@ bool DirManager::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
|
|||||||
|
|
||||||
BlockFile* pBlockFile = NULL;
|
BlockFile* pBlockFile = NULL;
|
||||||
|
|
||||||
if( !wxStricmp(tag, wxT("silentblockfile")) ) {
|
BlockFile *&target = mLoadingTarget->at(mLoadingTargetIdx).f;
|
||||||
|
|
||||||
|
if (!wxStricmp(tag, wxT("silentblockfile"))) {
|
||||||
// Silent blocks don't actually have a file associated, so
|
// Silent blocks don't actually have a file associated, so
|
||||||
// we don't need to worry about the hash table at all
|
// we don't need to worry about the hash table at all
|
||||||
*mLoadingTarget = SilentBlockFile::BuildFromXML(*this, attrs);
|
target = SilentBlockFile::BuildFromXML(*this, attrs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( !wxStricmp(tag, wxT("simpleblockfile")) )
|
else if ( !wxStricmp(tag, wxT("simpleblockfile")) )
|
||||||
@ -1074,7 +1078,7 @@ bool DirManager::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*mLoadingTarget = pBlockFile;
|
target = pBlockFile;
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the block we loaded is already in the hash table, then the
|
// If the block we loaded is already in the hash table, then the
|
||||||
@ -1082,21 +1086,21 @@ bool DirManager::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
|
|||||||
// return a reference to the existing object instead.
|
// return a reference to the existing object instead.
|
||||||
//
|
//
|
||||||
|
|
||||||
wxString name = (*mLoadingTarget)->GetFileName().GetName();
|
wxString name = target->GetFileName().GetName();
|
||||||
BlockFile *retrieved = mBlockFileHash[name];
|
BlockFile *retrieved = mBlockFileHash[name];
|
||||||
if (retrieved) {
|
if (retrieved) {
|
||||||
// Lock it in order to delete it safely, i.e. without having
|
// Lock it in order to delete it safely, i.e. without having
|
||||||
// it delete the file, too...
|
// it delete the file, too...
|
||||||
(*mLoadingTarget)->Lock();
|
target->Lock();
|
||||||
delete (*mLoadingTarget);
|
delete target;
|
||||||
|
|
||||||
Ref(retrieved); // Add one to its reference count
|
Ref(retrieved); // Add one to its reference count
|
||||||
*mLoadingTarget = retrieved;
|
target = retrieved;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a new object
|
// This is a new object
|
||||||
mBlockFileHash[name]=*mLoadingTarget;
|
mBlockFileHash[name] = target;
|
||||||
// MakeBlockFileName wasn't used so we must add the directory
|
// MakeBlockFileName wasn't used so we must add the directory
|
||||||
// balancing information
|
// balancing information
|
||||||
BalanceInfoAdd(name);
|
BalanceInfoAdd(name);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "xml/XMLTagHandler.h"
|
#include "xml/XMLTagHandler.h"
|
||||||
|
|
||||||
class wxHashTable;
|
class wxHashTable;
|
||||||
|
class BlockArray;
|
||||||
class BlockFile;
|
class BlockFile;
|
||||||
class SequenceTest;
|
class SequenceTest;
|
||||||
|
|
||||||
@ -101,10 +102,17 @@ class DirManager: public XMLTagHandler {
|
|||||||
// For debugging only
|
// For debugging only
|
||||||
int GetRefCount(BlockFile * f);
|
int GetRefCount(BlockFile * f);
|
||||||
|
|
||||||
void SetLoadingTarget(BlockFile **target) { mLoadingTarget = target; }
|
void SetLoadingTarget(BlockArray *pArray, unsigned idx)
|
||||||
|
{
|
||||||
|
mLoadingTarget = pArray;
|
||||||
|
mLoadingTargetIdx = idx;
|
||||||
|
}
|
||||||
void SetLoadingFormat(sampleFormat format) { mLoadingFormat = format; }
|
void SetLoadingFormat(sampleFormat format) { mLoadingFormat = format; }
|
||||||
void SetLoadingBlockLength(sampleCount len) { mLoadingBlockLen = len; }
|
void SetLoadingBlockLength(sampleCount len) { mLoadingBlockLen = len; }
|
||||||
void SetMaxSamples(sampleCount max) { mMaxSamples = max; }
|
|
||||||
|
// Note: following affects only the loading of block files when opening a project
|
||||||
|
void SetLoadingMaxSamples(sampleCount max) { mMaxSamples = max; }
|
||||||
|
|
||||||
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
|
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
|
||||||
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; }
|
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; }
|
||||||
void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); } // This class only reads tags.
|
void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); } // This class only reads tags.
|
||||||
@ -186,7 +194,8 @@ class DirManager: public XMLTagHandler {
|
|||||||
|
|
||||||
wxArrayString aliasList;
|
wxArrayString aliasList;
|
||||||
|
|
||||||
BlockFile **mLoadingTarget;
|
BlockArray *mLoadingTarget;
|
||||||
|
unsigned mLoadingTargetIdx;
|
||||||
sampleFormat mLoadingFormat;
|
sampleFormat mLoadingFormat;
|
||||||
sampleCount mLoadingBlockLen;
|
sampleCount mLoadingBlockLen;
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ libaudacity_la_SOURCES = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
audacity_CPPFLAGS = \
|
audacity_CPPFLAGS = \
|
||||||
|
-std=c++11 \
|
||||||
-Wno-deprecated-declarations \
|
-Wno-deprecated-declarations \
|
||||||
-D__STDC_CONSTANT_MACROS \
|
-D__STDC_CONSTANT_MACROS \
|
||||||
-DLIBDIR=\"$(libdir)\" \
|
-DLIBDIR=\"$(libdir)\" \
|
||||||
|
@ -3737,10 +3737,11 @@ void AudacityProject::AddImportedTracks(wxString fileName,
|
|||||||
if (newTracks[i]->GetKind() == WaveTrack::Wave)
|
if (newTracks[i]->GetKind() == WaveTrack::Wave)
|
||||||
{
|
{
|
||||||
WaveClip* clip = ((WaveTrack*)newTracks[i])->GetClipByIndex(0);
|
WaveClip* clip = ((WaveTrack*)newTracks[i])->GetClipByIndex(0);
|
||||||
if (clip && clip->GetSequence()->GetBlockArray()->GetCount())
|
BlockArray &blocks = clip->GetSequence()->GetBlockArray();
|
||||||
|
if (clip && blocks.size())
|
||||||
{
|
{
|
||||||
SeqBlock* block = clip->GetSequence()->GetBlockArray()->Item(0);
|
SeqBlock& block = blocks.at(0);
|
||||||
if (block->f->IsAlias())
|
if (block.f->IsAlias())
|
||||||
{
|
{
|
||||||
mImportedDependencies = true;
|
mImportedDependencies = true;
|
||||||
}
|
}
|
||||||
@ -5189,7 +5190,7 @@ void AudacityProject::CaptureKeyboard(wxWindow *handler)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void AudacityProject::ReleaseKeyboard(wxWindow *handler)
|
void AudacityProject::ReleaseKeyboard(wxWindow * /* handler */)
|
||||||
{
|
{
|
||||||
AudacityProject *project = GetActiveProject();
|
AudacityProject *project = GetActiveProject();
|
||||||
if (project)
|
if (project)
|
||||||
|
1319
src/Sequence.cpp
1319
src/Sequence.cpp
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,7 @@
|
|||||||
#ifndef __AUDACITY_SEQUENCE__
|
#ifndef __AUDACITY_SEQUENCE__
|
||||||
#define __AUDACITY_SEQUENCE__
|
#define __AUDACITY_SEQUENCE__
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/dynarray.h>
|
#include <wx/dynarray.h>
|
||||||
|
|
||||||
@ -36,15 +37,27 @@ class SeqBlock {
|
|||||||
BlockFile * f;
|
BlockFile * f;
|
||||||
///the sample in the global wavetrack that this block starts at.
|
///the sample in the global wavetrack that this block starts at.
|
||||||
sampleCount start;
|
sampleCount start;
|
||||||
|
|
||||||
|
SeqBlock()
|
||||||
|
: f(NULL), start(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
SeqBlock(BlockFile *f_, sampleCount start_)
|
||||||
|
: f(f_), start(start_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
// Construct a SeqBlock with changed start, same file
|
||||||
|
SeqBlock Plus(sampleCount delta) const
|
||||||
|
{
|
||||||
|
return SeqBlock(f, start + delta);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
WX_DEFINE_ARRAY(SeqBlock *, BlockArray);
|
class BlockArray : public std::vector<SeqBlock> {};
|
||||||
|
WX_DEFINE_ARRAY(SeqBlock *, BlockPtrArray);
|
||||||
|
|
||||||
class Sequence: public XMLTagHandler {
|
class Sequence: public XMLTagHandler {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Temporary: only until we delete TrackArtist once and for all
|
|
||||||
friend class TrackArtist;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Static methods
|
// Static methods
|
||||||
//
|
//
|
||||||
@ -66,7 +79,7 @@ class Sequence: public XMLTagHandler {
|
|||||||
return new Sequence(*this, projDirManager);
|
return new Sequence(*this, projDirManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Sequence();
|
~Sequence();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Editing
|
// Editing
|
||||||
@ -86,7 +99,7 @@ class Sequence: public XMLTagHandler {
|
|||||||
// where[p] up to (but excluding) where[p + 1].
|
// where[p] up to (but excluding) where[p + 1].
|
||||||
// bl is negative wherever data are not yet available.
|
// bl is negative wherever data are not yet available.
|
||||||
// Return true if successful.
|
// Return true if successful.
|
||||||
bool GetWaveDisplay(float *min, float *max, float *rms,int* bl,
|
bool GetWaveDisplay(float *min, float *max, float *rms, int* bl,
|
||||||
int len, const sampleCount *where);
|
int len, const sampleCount *where);
|
||||||
|
|
||||||
bool Copy(sampleCount s0, sampleCount s1, Sequence **dest);
|
bool Copy(sampleCount s0, sampleCount s1, Sequence **dest);
|
||||||
@ -98,7 +111,7 @@ class Sequence: public XMLTagHandler {
|
|||||||
bool Delete(sampleCount start, sampleCount len);
|
bool Delete(sampleCount start, sampleCount len);
|
||||||
bool AppendAlias(wxString fullPath,
|
bool AppendAlias(wxString fullPath,
|
||||||
sampleCount start,
|
sampleCount start,
|
||||||
sampleCount len, int channel,bool useOD);
|
sampleCount len, int channel, bool useOD);
|
||||||
|
|
||||||
bool AppendCoded(wxString fName, sampleCount start,
|
bool AppendCoded(wxString fName, sampleCount start,
|
||||||
sampleCount len, int channel, int decodeType);
|
sampleCount len, int channel, int decodeType);
|
||||||
@ -146,7 +159,7 @@ class Sequence: public XMLTagHandler {
|
|||||||
//
|
//
|
||||||
|
|
||||||
sampleFormat GetSampleFormat() const;
|
sampleFormat GetSampleFormat() const;
|
||||||
bool SetSampleFormat(sampleFormat format);
|
// bool SetSampleFormat(sampleFormat format);
|
||||||
bool ConvertToSampleFormat(sampleFormat format, bool* pbChanged);
|
bool ConvertToSampleFormat(sampleFormat format, bool* pbChanged);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -172,12 +185,27 @@ class Sequence: public XMLTagHandler {
|
|||||||
// you're doing!
|
// you're doing!
|
||||||
//
|
//
|
||||||
|
|
||||||
BlockArray *GetBlockArray() {return mBlock;}
|
BlockArray &GetBlockArray() {return mBlock;}
|
||||||
|
|
||||||
///
|
///
|
||||||
void LockDeleteUpdateMutex(){mDeleteUpdateMutex.Lock();}
|
void LockDeleteUpdateMutex(){mDeleteUpdateMutex.Lock();}
|
||||||
void UnlockDeleteUpdateMutex(){mDeleteUpdateMutex.Unlock();}
|
void UnlockDeleteUpdateMutex(){mDeleteUpdateMutex.Unlock();}
|
||||||
|
|
||||||
|
// RAII idiom wrapping the functions above
|
||||||
|
struct DeleteUpdateMutexLocker {
|
||||||
|
DeleteUpdateMutexLocker(Sequence &sequence)
|
||||||
|
: mSequence(sequence)
|
||||||
|
{
|
||||||
|
mSequence.LockDeleteUpdateMutex();
|
||||||
|
}
|
||||||
|
~DeleteUpdateMutexLocker()
|
||||||
|
{
|
||||||
|
mSequence.UnlockDeleteUpdateMutex();
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
Sequence &mSequence;
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -192,7 +220,7 @@ class Sequence: public XMLTagHandler {
|
|||||||
|
|
||||||
DirManager *mDirManager;
|
DirManager *mDirManager;
|
||||||
|
|
||||||
BlockArray *mBlock;
|
BlockArray mBlock;
|
||||||
sampleFormat mSampleFormat;
|
sampleFormat mSampleFormat;
|
||||||
sampleCount mNumSamples;
|
sampleCount mNumSamples;
|
||||||
|
|
||||||
@ -208,29 +236,24 @@ class Sequence: public XMLTagHandler {
|
|||||||
// Private methods
|
// Private methods
|
||||||
//
|
//
|
||||||
|
|
||||||
void CalcSummaryInfo();
|
void DerefAllFiles();
|
||||||
|
|
||||||
int FindBlock(sampleCount pos) const;
|
int FindBlock(sampleCount pos) const;
|
||||||
int FindBlock(sampleCount pos, sampleCount lo,
|
|
||||||
sampleCount guess, sampleCount hi) const;
|
|
||||||
|
|
||||||
bool AppendBlock(SeqBlock *b);
|
bool AppendBlock(const SeqBlock &b);
|
||||||
|
|
||||||
bool Read(samplePtr buffer, sampleFormat format,
|
bool Read(samplePtr buffer, sampleFormat format,
|
||||||
SeqBlock * b,
|
const SeqBlock &b,
|
||||||
sampleCount start, sampleCount len) const;
|
sampleCount start, sampleCount len) const;
|
||||||
|
|
||||||
// These are the two ways to write data to a block
|
bool CopyWrite(SampleBuffer &scratch,
|
||||||
bool FirstWrite(samplePtr buffer, SeqBlock * b, sampleCount len);
|
samplePtr buffer, SeqBlock &b,
|
||||||
bool CopyWrite(samplePtr buffer, SeqBlock * b,
|
|
||||||
sampleCount start, sampleCount len);
|
sampleCount start, sampleCount len);
|
||||||
|
|
||||||
// Both block-writing methods and AppendAlias call this
|
void Blockify(BlockArray &list, sampleCount start, samplePtr buffer, sampleCount len);
|
||||||
// method to write the summary data
|
|
||||||
void *GetSummary(samplePtr buffer, sampleCount len,
|
|
||||||
float *min, float *max, float *rms);
|
|
||||||
|
|
||||||
BlockArray *Blockify(samplePtr buffer, sampleCount len);
|
bool Get(int b, samplePtr buffer, sampleFormat format,
|
||||||
|
sampleCount start, sampleCount len) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -240,11 +263,11 @@ class Sequence: public XMLTagHandler {
|
|||||||
|
|
||||||
// This function makes sure that the track isn't messed up
|
// This function makes sure that the track isn't messed up
|
||||||
// because of inconsistent block starts & lengths
|
// because of inconsistent block starts & lengths
|
||||||
bool ConsistencyCheck(const wxChar *whereStr);
|
bool ConsistencyCheck(const wxChar *whereStr) const;
|
||||||
|
|
||||||
// This function prints information to stdout about the blocks in the
|
// This function prints information to stdout about the blocks in the
|
||||||
// tracks and indicates if there are inconsistencies.
|
// tracks and indicates if there are inconsistencies.
|
||||||
void DebugPrintf(wxString *dest);
|
void DebugPrintf(wxString *dest) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __AUDACITY_SEQUENCE__
|
#endif // __AUDACITY_SEQUENCE__
|
||||||
|
@ -383,7 +383,7 @@ void ThemeBase::RegisterImage( int &iIndex, const wxImage &Image, const wxString
|
|||||||
wxASSERT( iIndex == -1 ); // Don't initialise same bitmap twice!
|
wxASSERT( iIndex == -1 ); // Don't initialise same bitmap twice!
|
||||||
mImages.Add( Image );
|
mImages.Add( Image );
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __APPLE__
|
||||||
// On Mac, bitmaps with alpha don't work.
|
// On Mac, bitmaps with alpha don't work.
|
||||||
// So we convert to a mask and use that.
|
// So we convert to a mask and use that.
|
||||||
// It isn't quite as good, as alpha gives smoother edges.
|
// It isn't quite as good, as alpha gives smoother edges.
|
||||||
|
@ -80,9 +80,9 @@ void UndoManager::CalculateSpaceUsage()
|
|||||||
{
|
{
|
||||||
// Scan all blockfiles within current clip
|
// Scan all blockfiles within current clip
|
||||||
BlockArray *blocks = it->GetData()->GetSequenceBlockArray();
|
BlockArray *blocks = it->GetData()->GetSequenceBlockArray();
|
||||||
for (size_t b = 0, cnt = blocks->GetCount(); b < cnt; b++)
|
for (size_t b = 0, cnt = blocks->size(); b < cnt; b++)
|
||||||
{
|
{
|
||||||
BlockFile *file = blocks->Item(b)->f;
|
BlockFile *file = blocks->at(b).f;
|
||||||
|
|
||||||
// Accumulate space used by the file if the file didn't exist
|
// Accumulate space used by the file if the file didn't exist
|
||||||
// in the previous level
|
// in the previous level
|
||||||
|
@ -366,7 +366,7 @@ bool WaveClip::SetSamples(samplePtr buffer, sampleFormat format,
|
|||||||
|
|
||||||
BlockArray* WaveClip::GetSequenceBlockArray()
|
BlockArray* WaveClip::GetSequenceBlockArray()
|
||||||
{
|
{
|
||||||
return mSequence->GetBlockArray();
|
return &mSequence->GetBlockArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
double WaveClip::GetStartTime() const
|
double WaveClip::GetStartTime() const
|
||||||
@ -1708,7 +1708,7 @@ void WaveClip::CloseLock()
|
|||||||
{
|
{
|
||||||
GetSequence()->CloseLock();
|
GetSequence()->CloseLock();
|
||||||
for (WaveClipList::compatibility_iterator it = mCutLines.GetFirst(); it; it=it->GetNext())
|
for (WaveClipList::compatibility_iterator it = mCutLines.GetFirst(); it; it=it->GetNext())
|
||||||
it->GetData()->Lock();
|
it->GetData()->CloseLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveClip::Unlock()
|
void WaveClip::Unlock()
|
||||||
|
@ -190,7 +190,7 @@ void ODComputeSummaryTask::Update()
|
|||||||
seq = clip->GetSequence();
|
seq = clip->GetSequence();
|
||||||
//This lock may be way too big since the whole file is one sequence.
|
//This lock may be way too big since the whole file is one sequence.
|
||||||
//TODO: test for large files and find a way to break it down.
|
//TODO: test for large files and find a way to break it down.
|
||||||
seq->LockDeleteUpdateMutex();
|
Sequence::DeleteUpdateMutexLocker locker(*seq);
|
||||||
|
|
||||||
//See Sequence::Delete() for why need this for now..
|
//See Sequence::Delete() for why need this for now..
|
||||||
//We don't need the mBlockFilesMutex here because it is only for the vector list.
|
//We don't need the mBlockFilesMutex here because it is only for the vector list.
|
||||||
@ -202,25 +202,27 @@ void ODComputeSummaryTask::Update()
|
|||||||
|
|
||||||
insertCursor =0;//OD TODO:see if this works, removed from inner loop (bfore was n*n)
|
insertCursor =0;//OD TODO:see if this works, removed from inner loop (bfore was n*n)
|
||||||
|
|
||||||
for(i=0; i<(int)blocks->GetCount(); i++)
|
for(i=0; i<(int)blocks->size(); i++)
|
||||||
{
|
{
|
||||||
//if there is data but no summary, this blockfile needs summarizing.
|
//if there is data but no summary, this blockfile needs summarizing.
|
||||||
if(blocks->Item(i)->f->IsDataAvailable() && !blocks->Item(i)->f->IsSummaryAvailable())
|
SeqBlock &block = blocks->at(i);
|
||||||
|
BlockFile *const file = block.f;
|
||||||
|
if(file->IsDataAvailable() && !file->IsSummaryAvailable())
|
||||||
{
|
{
|
||||||
blocks->Item(i)->f->Ref();
|
file->Ref();
|
||||||
((ODPCMAliasBlockFile*)blocks->Item(i)->f)->SetStart(blocks->Item(i)->start);
|
ODPCMAliasBlockFile *const odpcmaFile = static_cast<ODPCMAliasBlockFile*>(file);
|
||||||
((ODPCMAliasBlockFile*)blocks->Item(i)->f)->SetClipOffset((sampleCount)(clip->GetStartTime()*clip->GetRate()));
|
odpcmaFile->SetStart(block.start);
|
||||||
|
odpcmaFile->SetClipOffset((sampleCount)(clip->GetStartTime()*clip->GetRate()));
|
||||||
|
|
||||||
//these will always be linear within a sequence-lets take advantage of this by keeping a cursor.
|
//these will always be linear within a sequence-lets take advantage of this by keeping a cursor.
|
||||||
while(insertCursor<(int)tempBlocks.size()&&
|
while(insertCursor<(int)tempBlocks.size()&&
|
||||||
(sampleCount)(tempBlocks[insertCursor]->GetStart()+tempBlocks[insertCursor]->GetClipOffset()) <
|
(sampleCount)(tempBlocks[insertCursor]->GetStart()+tempBlocks[insertCursor]->GetClipOffset()) <
|
||||||
(sampleCount)(((ODPCMAliasBlockFile*)blocks->Item(i)->f)->GetStart()+((ODPCMAliasBlockFile*)blocks->Item(i)->f)->GetClipOffset()))
|
(sampleCount)(odpcmaFile->GetStart()+odpcmaFile->GetClipOffset()))
|
||||||
insertCursor++;
|
insertCursor++;
|
||||||
|
|
||||||
tempBlocks.insert(tempBlocks.begin()+insertCursor++,(ODPCMAliasBlockFile*)blocks->Item(i)->f);
|
tempBlocks.insert(tempBlocks.begin() + insertCursor++, odpcmaFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
seq->UnlockDeleteUpdateMutex();
|
|
||||||
node = node->GetNext();
|
node = node->GetNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,22 +154,26 @@ void ODDecodeTask::Update()
|
|||||||
int insertCursor;
|
int insertCursor;
|
||||||
|
|
||||||
insertCursor =0;//OD TODO:see if this works, removed from inner loop (bfore was n*n)
|
insertCursor =0;//OD TODO:see if this works, removed from inner loop (bfore was n*n)
|
||||||
for(i=0; i<(int)blocks->GetCount(); i++)
|
for (i = 0; i<(int)blocks->size(); i++)
|
||||||
{
|
{
|
||||||
//since we have more than one ODBlockFile, we will need type flags to cast.
|
//since we have more than one ODBlockFile, we will need type flags to cast.
|
||||||
if(!blocks->Item(i)->f->IsDataAvailable() && ((ODDecodeBlockFile*)blocks->Item(i)->f)->GetDecodeType()==this->GetODType())
|
SeqBlock &block = blocks->at(i);
|
||||||
|
BlockFile *const file = block.f;
|
||||||
|
ODDecodeBlockFile *oddbFile;
|
||||||
|
if (!file->IsDataAvailable() &&
|
||||||
|
(oddbFile = static_cast<ODDecodeBlockFile*>(file))->GetDecodeType() == this->GetODType())
|
||||||
{
|
{
|
||||||
blocks->Item(i)->f->Ref();
|
file->Ref();
|
||||||
((ODDecodeBlockFile*)blocks->Item(i)->f)->SetStart(blocks->Item(i)->start);
|
oddbFile->SetStart(block.start);
|
||||||
((ODDecodeBlockFile*)blocks->Item(i)->f)->SetClipOffset((sampleCount)(clip->GetStartTime()*clip->GetRate()));
|
oddbFile->SetClipOffset((sampleCount)(clip->GetStartTime()*clip->GetRate()));
|
||||||
|
|
||||||
//these will always be linear within a sequence-lets take advantage of this by keeping a cursor.
|
//these will always be linear within a sequence-lets take advantage of this by keeping a cursor.
|
||||||
while(insertCursor<(int)tempBlocks.size()&&
|
while(insertCursor<(int)tempBlocks.size()&&
|
||||||
(sampleCount)(tempBlocks[insertCursor]->GetStart()+tempBlocks[insertCursor]->GetClipOffset()) <
|
(sampleCount)(tempBlocks[insertCursor]->GetStart()+tempBlocks[insertCursor]->GetClipOffset()) <
|
||||||
(sampleCount)(((ODDecodeBlockFile*)blocks->Item(i)->f)->GetStart()+((ODDecodeBlockFile*)blocks->Item(i)->f)->GetClipOffset()))
|
(sampleCount)((oddbFile->GetStart()+oddbFile->GetClipOffset())))
|
||||||
insertCursor++;
|
insertCursor++;
|
||||||
|
|
||||||
tempBlocks.insert(tempBlocks.begin()+insertCursor++,(ODDecodeBlockFile*)blocks->Item(i)->f);
|
tempBlocks.insert(tempBlocks.begin()+insertCursor++, oddbFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user