本文整理汇总了C++中Track::Duplicate方法的典型用法代码示例。如果您正苦于以下问题:C++ Track::Duplicate方法的具体用法?C++ Track::Duplicate怎么用?C++ Track::Duplicate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track::Duplicate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ModifyState
void UndoManager::ModifyState(TrackList * l, double sel0, double sel1)
{
// Delete current
TrackListIterator iter(stack[current]->tracks);
Track *t = iter.First();
while (t) {
delete t;
t = iter.Next();
}
// Duplicate
TrackList *tracksCopy = new TrackList();
TrackListIterator iter2(l);
t = iter2.First();
while (t) {
tracksCopy->Add(t->Duplicate());
t = iter2.Next();
}
// Replace
stack[current]->tracks = tracksCopy;
stack[current]->sel0 = sel0;
stack[current]->sel1 = sel1;
}
示例2: CopyInputTracks
//
// private methods
//
// Use these two methods to copy the input tracks to mOutputTracks, if
// doing the processing on them, and replacing the originals only on success (and not cancel).
// Copy the group tracks that have tracks selected
void Effect::CopyInputTracks(int trackType)
{
// Reset map
mIMap.Clear();
mOMap.Clear();
mOutputTracks = new TrackList();
mOutputTracksType = trackType;
//iterate over tracks of type trackType (All types if Track::All)
TrackListOfKindIterator aIt(trackType, mTracks);
t2bHash added;
for (Track *aTrack = aIt.First(); aTrack; aTrack = aIt.Next()) {
// Include selected tracks, plus sync-lock selected tracks for Track::All.
if (aTrack->GetSelected() ||
(trackType == Track::All && aTrack->IsSyncLockSelected()))
{
Track *o = aTrack->Duplicate();
mOutputTracks->Add(o);
mIMap.Add(aTrack);
mOMap.Add(o);
}
}
}
示例3: ModifyState
void UndoManager::ModifyState(TrackList * l,
const SelectedRegion &selectedRegion)
{
if (current == wxNOT_FOUND) {
return;
}
SonifyBeginModifyState();
// Delete current
stack[current]->tracks->Clear(true);
delete stack[current]->tracks;
// Duplicate
TrackList *tracksCopy = new TrackList();
TrackListIterator iter(l);
Track *t = iter.First();
while (t) {
tracksCopy->Add(t->Duplicate());
t = iter.Next();
}
// Replace
stack[current]->tracks = tracksCopy;
stack[current]->selectedRegion = selectedRegion;
SonifyEndModifyState();
}
示例4: PushState
void UndoManager::PushState(TrackList * l, double sel0, double sel1,
wxString longDescription,
wxString shortDescription,
int flags)
{
unsigned int i;
// If consolidate is set to true, group up to 3 identical operations.
if (((flags&PUSH_CONSOLIDATE)!=0) && lastAction == longDescription &&
consolidationCount < 2) {
consolidationCount++;
ModifyState(l, sel0, sel1);
// MB: If the "saved" state was modified by ModifyState, reset
// it so that UnsavedChanges returns true.
if (current == saved) {
saved = -1;
}
return;
}
consolidationCount = 0;
i = current + 1;
while (i < stack.Count()) {
RemoveStateAt(i);
}
TrackList *tracksCopy = new TrackList();
TrackListIterator iter(l);
Track *t = iter.First();
while (t) {
tracksCopy->Add(t->Duplicate());
t = iter.Next();
}
UndoStackElem *push = new UndoStackElem();
push->tracks = tracksCopy;
push->sel0 = sel0;
push->sel1 = sel1;
push->description = longDescription;
push->shortDescription = shortDescription;
push->spaceUsage = 0; // Calculate actual value after it's on the stack.
stack.Add(push);
current++;
if( (flags&PUSH_CALC_SPACE)!=0)
push->spaceUsage = this->CalculateSpaceUsage(current);
if (saved >= current) {
saved = -1;
}
lastAction = longDescription;
}
示例5: PushState
void UndoManager::PushState(TrackList * l, double sel0, double sel1,
wxString longDescription,
wxString shortDescription,
bool consolidate)
{
unsigned int i;
// If consolidate is set to true
if (consolidate && lastAction == longDescription &&
consolidationCount < 2) {
consolidationCount++;
ModifyState(l, sel0, sel1);
return;
}
consolidationCount = 0;
for (i = current + 1; i < stack.Count(); i++) {
TrackListIterator iter(stack[i]->tracks);
Track *t = iter.First();
while (t) {
delete t;
t = iter.Next();
}
}
i = stack.Count() - 1;
while (i > (unsigned int)current)
stack.RemoveAt(i--);
TrackList *tracksCopy = new TrackList();
TrackListIterator iter(l);
Track *t = iter.First();
while (t) {
tracksCopy->Add(t->Duplicate());
t = iter.Next();
}
UndoStackElem *push = new UndoStackElem();
push->tracks = tracksCopy;
push->sel0 = sel0;
push->sel1 = sel1;
push->description = longDescription;
push->shortDescription = shortDescription;
stack.Add(push);
current++;
if (saved >= current)
saved = -1;
lastAction = longDescription;
}
示例6: PushState
void UndoManager::PushState(TrackList * l,
const SelectedRegion &selectedRegion,
const wxString &longDescription,
const wxString &shortDescription,
int flags)
{
unsigned int i;
// If consolidate is set to true, group up to 3 identical operations.
if (((flags&PUSH_CONSOLIDATE)!=0) && lastAction == longDescription &&
consolidationCount < 2) {
consolidationCount++;
ModifyState(l, selectedRegion);
// MB: If the "saved" state was modified by ModifyState, reset
// it so that UnsavedChanges returns true.
if (current == saved) {
saved = -1;
}
return;
}
consolidationCount = 0;
i = current + 1;
while (i < stack.Count()) {
RemoveStateAt(i);
}
TrackList *tracksCopy = new TrackList();
TrackListIterator iter(l);
Track *t = iter.First();
while (t) {
tracksCopy->Add(t->Duplicate());
t = iter.Next();
}
UndoStackElem *push = new UndoStackElem();
push->tracks = tracksCopy;
push->selectedRegion = selectedRegion;
push->description = longDescription;
push->shortDescription = shortDescription;
stack.Add(push);
current++;
if (saved >= current) {
saved = -1;
}
lastAction = longDescription;
}
示例7: ModifyState
void UndoManager::ModifyState(TrackList * l, double sel0, double sel1)
{
SonifyBeginModifyState();
// Delete current
stack[current]->tracks->Clear(true);
delete stack[current]->tracks;
// Duplicate
TrackList *tracksCopy = new TrackList();
TrackListIterator iter(l);
Track *t = iter.First();
while (t) {
tracksCopy->Add(t->Duplicate());
t = iter.Next();
}
// Replace
stack[current]->tracks = tracksCopy;
stack[current]->sel0 = sel0;
stack[current]->sel1 = sel1;
SonifyEndModifyState();
}
示例8: PushState
void UndoManager::PushState(TrackList * l, double sel0, double sel1,
wxString desc)
{
unsigned int i;
for (i = current + 1; i < stack.Count(); i++) {
TrackListIterator iter(stack[i]->tracks);
Track *t = iter.First();
while (t) {
delete t;
t = iter.Next();
}
}
i = stack.Count() - 1;
while (i > (unsigned int)current)
stack.RemoveAt(i--);
TrackList *tracksCopy = new TrackList();
TrackListIterator iter(l);
Track *t = iter.First();
while (t) {
tracksCopy->Add(t->Duplicate());
t = iter.Next();
}
UndoStackElem *push = new UndoStackElem();
push->tracks = tracksCopy;
push->sel0 = sel0;
push->sel1 = sel1;
push->description = desc;
stack.Add(push);
current++;
if (saved >= current)
saved = -1;
}