Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9821
Modified Files:
Experimental.h LabelTrack.cpp Menus.cpp TrackPanel.cpp
WaveTrack.cpp
Log Message:
Removal of EXPERIMENTAL_FULL_LINKING, EXPERIMENTAL_STICKY_TRACKS,
EXPERIMENTAL_POSITION_LINKING and EXPERIMENTAL_LABEL_LINKING
Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.435
retrieving revision 1.436
diff -u -d -r1.435 -r1.436
--- Menus.cpp 5 Feb 2009 22:14:09 -0000 1.435
+++ Menus.cpp 6 Feb 2009 00:43:40 -0000 1.436
@@ -704,10 +704,6 @@
#endif // EXPERIMENTAL_SCOREALIGN
c->AddSeparator();
-#ifdef EXPERIMENTAL_POSITION_LINKING
- c->AddItem(wxT("StickyLabels"), _("Link Audio and Label Tracks"),
FN(OnStickyLabel), 0);
- c->AddSeparator();
-#endif
c->AddItem(wxT("AddLabel"), _("Add &Label At Selection\tCtrl+B"),
FN(OnAddLabel));
c->AddItem(wxT("AddLabelPlaying"), _("Add Label At &Playback
Position\tCtrl+M"), FN(OnAddLabelPlaying));
c->SetCommandFlags(wxT("AddLabel"), 0, 0);
Index: LabelTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/LabelTrack.cpp,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- LabelTrack.cpp 13 Dec 2008 21:32:08 -0000 1.98
+++ LabelTrack.cpp 6 Feb 2009 00:43:40 -0000 1.99
@@ -131,9 +131,6 @@
for (int i = 0; i < len; i++)
delete mLabels[i];
-#ifdef EXPERIMENTAL_STICKY_TRACKS
- if (mStickyTrack) mStickyTrack->SetStickyTrack(NULL);
-#endif
}
void LabelTrack::SetOffset(double dOffset)
@@ -2021,7 +2018,7 @@
bool LabelTrack::Clear(double t0, double t1)
{
-#ifdef EXPERIMENTAL_FULL_LINKING
+
AudacityProject *p = GetActiveProject();
if (p && p->IsSticky()){
bool onlyLabelTrackSel = true;
@@ -2058,21 +2055,6 @@
}else{
ShiftLabelsOnClear(t0, t1);
}
-#else
- int len = mLabels.Count();
-
- for (int i = 0; i < len; i++) {
- if (t0 <= mLabels[i]->t && mLabels[i]->t <= t1) {
- mLabels.RemoveAt(i);
- len--;
- i--;
- }
- else if (mLabels[i]->t > t1) {
- mLabels[i]->t -= (t1 - t0);
- mLabels[i]->t1 -= (t1 - t0);
- }
- }
-#endif
return true;
}
Index: WaveTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/WaveTrack.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- WaveTrack.cpp 2 Feb 2009 16:14:43 -0000 1.135
+++ WaveTrack.cpp 6 Feb 2009 00:43:40 -0000 1.136
@@ -441,7 +441,6 @@
return true;
}
-#ifdef EXPERIMENTAL_FULL_LINKING
bool WaveTrack::Paste(double t0, Track *src)
{
AudacityProject *p = GetActiveProject();
@@ -451,215 +450,26 @@
return HandlePaste(t0, src);
}
-#else
-bool WaveTrack::Paste(double t0, Track *src)
-{
- bool editClipCanMove = true;
- gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
-
- //printf("paste: entering WaveTrack::Paste\n");
-
- // JKC Added...
- if( src == NULL )
- return false;
-
- if (src->GetKind() != Track::Wave)
- return false;
-
- //printf("paste: we have a wave track\n");
-
- WaveTrack* other = (WaveTrack*)src;
-
- //
- // Pasting is a bit complicated, because with the existence of multiclip
mode,
- // we must guess the behaviour the user wants.
- //
- // Currently, two modes are implemented:
- //
- // - If a single clip should be pasted, and it should be pasted inside
another
- // clip, no new clips are generated. The audio is simply inserted.
- // This resembles the old (pre-multiclip support) behaviour. However, if
- // the clip is pasted outside of any clip, a new clip is generated. This
is
- // the only behaviour which is different to what was done before, but it
- // shouldn't confuse users too much.
- //
- // - If multiple clips should be pasted, these are always pasted as single
- // clips, and the current clip is splitted, when necessary. This may seem
- // strange at first, but it probably is better than trying to auto-merge
- // anything. The user can still merge the clips by hand (which should be
- // a simple command reachable by a hotkey or single mouse click).
- //
-
- if (other->GetNumClips() == 0)
- return false;
-
- //printf("paste: we have at least one clip\n");
-
- double insertDuration = other->GetEndTime();
- WaveClipList::Node* it;
-
- #ifdef EXPERIMENTAL_STICKY_TRACKS
- if (mStickyLabelTrack)
mStickyLabelTrack->ShiftLabelsOnInsert(insertDuration, t0);
- #endif
- #ifdef EXPERIMENTAL_LABEL_LINKING
- AudacityProject *p = GetActiveProject();
- if( p && p->IsSticky()){
- TrackListIterator iter(p->GetTracks());
- Track *t = iter.First();
-
- while (t && t!=this) t = iter.Next(true);
- while (t && t->GetKind()==Track::Wave) t = iter.Next();
-
- while (t && t->GetKind()==Track::Label){
- //printf("t: %x\n", t);
- ((LabelTrack *)t)->ShiftLabelsOnInsert(insertDuration, t0);
- t = iter.Next();
- }
- }
- #endif
- //printf("Check if we need to make room for the pasted data\n");
-
- // Make room for the pasted data, unless the space being pasted in is empty
of
- // any clips
- if (!IsEmpty(t0, t0+insertDuration-1.0/mRate) && editClipCanMove) {
- if (other->GetNumClips() > 1) {
- // We need to insert multiple clips, so split the current clip and
- // move everything to the right, then try to paste again
- Track *tmp = NULL;
- Cut(t0, GetEndTime()+1.0/mRate, &tmp);
- Paste(t0 + insertDuration, tmp);
- delete tmp;
- } else
- {
- // We only need to insert one single clip, so just move all clips
- // to the right of the paste point out of the way
- for (it=GetClipIterator(); it; it=it->GetNext())
- {
- WaveClip* clip = it->GetData();
- if (clip->GetStartTime() > t0-(1.0/mRate))
- clip->Offset(insertDuration);
- }
- }
- }
-
- if (other->GetNumClips() == 1)
- {
- // Single clip mode
- // printf("paste: checking for single clip mode!\n");
-
- WaveClip *insideClip = NULL;
-
- for (it=GetClipIterator(); it; it=it->GetNext())
- {
- WaveClip *clip = it->GetData();
-
- // The 1.0/mRate is the time for one sample - kind of a fudge factor,
- // because an overlap of less than a sample should not trigger
- // traditional behaviour.
-
- if (editClipCanMove)
- {
- if (t0+src->GetEndTime()-1.0/mRate > clip->GetStartTime() &&
- t0 < clip->GetEndTime() - 1.0/mRate)
- {
- //printf("t0=%.6f: inside clip is %.6f ... %.6f\n",
- // t0, clip->GetStartTime(), clip->GetEndTime());
- insideClip = clip;
- break;
- }
- } else
- {
- if (t0 >= clip->GetStartTime() && t0 < clip->GetEndTime())
- {
- insideClip = clip;
- break;
- }
- }
- }
-
- if (insideClip)
- {
- // Exhibit traditional behaviour
- //printf("paste: traditional behaviour\n");
- if (!editClipCanMove)
- {
- // We did not move other clips out of the way already, so
- // check if we can paste without having to move other clips
- for (it=GetClipIterator(); it; it=it->GetNext())
- {
- WaveClip *clip = it->GetData();
-
- if (clip->GetStartTime() > insideClip->GetStartTime() &&
- insideClip->GetEndTime() + insertDuration >
- clip->GetStartTime())
- {
- wxMessageBox(
- _("There is not enough room available to paste the
selection"),
- _("Error"), wxICON_STOP);
- return false;
- }
- }
- }
-
- return insideClip->Paste(t0, other->GetClipByIndex(0));
- }
-
- // Just fall through and exhibit new behaviour
- }
-
- // Insert new clips
- //printf("paste: multi clip mode!\n");
-
- if (!editClipCanMove && !IsEmpty(t0, t0+insertDuration-1.0/mRate))
- {
- wxMessageBox(
- _("There is not enough room available to paste the selection"),
- _("Error"), wxICON_STOP);
- return false;
- }
-
- for (it=other->GetClipIterator(); it; it=it->GetNext())
- {
- WaveClip* clip = it->GetData();
-
- WaveClip* newClip = new WaveClip(*clip, mDirManager);
- newClip->Resample(mRate);
- newClip->Offset(t0);
- newClip->MarkChanged();
- mClips.Append(newClip);
- }
- return true;
-}
-#endif
-
bool WaveTrack::Clear(double t0, double t1)
{
bool addCutLines = false;
bool split = false;
-#ifdef EXPERIMENTAL_FULL_LINKING
AudacityProject *p = GetActiveProject();
if( p && p->IsSticky())
return HandleGroupClear(t0, t1, addCutLines, split);
else
return HandleClear(t0, t1, addCutLines, split);
-#else
- return HandleClear(t0, t1, addCutLines, split);
-#endif
}
bool WaveTrack::ClearAndAddCutLine(double t0, double t1)
{
bool addCutLines = true;
bool split = false;
-#ifdef EXPERIMENTAL_FULL_LINKING
AudacityProject *p = GetActiveProject();
if( p && p->IsSticky() )
return HandleGroupClear(t0, t1, addCutLines, split);
else
return HandleClear(t0, t1, addCutLines, split);
-#else
- return HandleClear(t0, t1, addCutLines, split);
-#endif
}
bool WaveTrack::SplitDelete(double t0, double t1)
@@ -716,28 +526,6 @@
if (t1 < t0)
return false;
-#ifdef EXPERIMENTAL_STICKY_TRACKS
- if (!split){
- if (mStickyLabelTrack) mStickyLabelTrack->ShiftLabelsOnClear(t0, t1);
- }
-#endif
-#ifdef EXPERIMENTAL_LABEL_LINKING
- AudacityProject *p = GetActiveProject();
- if( p && p->IsSticky() && !split){
- TrackListIterator iter(p->GetTracks());
- Track *t = iter.First();
-
- while (t && t!=this) t = iter.Next(true);
- while (t && t->GetKind()==Track::Wave) t = iter.Next();
-
- while (t && t->GetKind()==Track::Label){
- //printf("t: %x\n", t);
- ((LabelTrack *)t)->ShiftLabelsOnClear(t0, t1);
- t = iter.Next();
- }
- }
-#endif
-
bool editClipCanMove = true;
gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
@@ -958,25 +746,6 @@
double insertDuration = other->GetEndTime();
WaveClipList::Node* it;
-#ifdef EXPERIMENTAL_STICKY_TRACKS
- if (mStickyLabelTrack)
mStickyLabelTrack->ShiftLabelsOnInsert(insertDuration, t0);
-#endif
-#ifdef EXPERIMENTAL_LABEL_LINKING
- AudacityProject *p = GetActiveProject();
- if( p && p->IsSticky()){
- TrackListIterator iter(p->GetTracks());
- Track *t = iter.First();
-
- while (t && t!=this) t = iter.Next(true);
- while (t && t->GetKind()==Track::Wave) t = iter.Next();
-
- while (t && t->GetKind()==Track::Label){
- //printf("t: %x\n", t);
- ((LabelTrack *)t)->ShiftLabelsOnInsert(insertDuration, t0);
- t = iter.Next();
- }
- }
-#endif
//printf("Check if we need to make room for the pasted data\n");
// Make room for the pasted data, unless the space being pasted in is empty
of
Index: Experimental.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Experimental.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- Experimental.h 2 Feb 2009 16:14:43 -0000 1.47
+++ Experimental.h 6 Feb 2009 00:43:40 -0000 1.48
@@ -35,18 +35,6 @@
//#define EXPERIMENTAL_THEMING
#define EXPERIMENTAL_THEME_PREFS
-//The next few enable different kinds of label/wavetrack pairing.
-//You should probably only enable one at a time.
-//The next line enables a menu-based system
-//#define EXPERIMENTAL_STICKY_TRACKS
-//The next block enables a positional-based system.
-//LABEL_LINKING only links label tracks, while FULL_LINKING links wave and
label tracks
-#define EXPERIMENTAL_POSITION_LINKING
-#ifdef EXPERIMENTAL_POSITION_LINKING
- #define EXPERIMENTAL_FULL_LINKING
- //#define EXPERIMENTAL_LABEL_LINKING
-#endif
-
//Next line enables Mic monitoring at times when it was previously off.
//More work is needed as after recording or playing it results in an
//unwanted record-cursor on the wave track.
Index: TrackPanel.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackPanel.cpp,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -d -r1.425 -r1.426
--- TrackPanel.cpp 2 Feb 2009 16:14:43 -0000 1.425
+++ TrackPanel.cpp 6 Feb 2009 00:43:40 -0000 1.426
@@ -5759,43 +5759,6 @@
#endif
if (t->GetKind() == Track::Label){
-#ifdef EXPERIMENTAL_STICKY_TRACKS
- delete mLabelTrackMenu;
- mLabelTrackMenu = new wxMenu();
-
- AudacityProject *p = GetActiveProject();
- if (!p) return;
- TrackListIterator iter(p->GetTracks());
- WaveTrack *wt = (WaveTrack *) iter.First();
- int count=1;
- mStickyLabelMenu = new wxMenu();
- while (wt) {
- if (wt->GetKind()==Track::Wave){
- wxString name;
- name = wt->GetName();
- if (name == wxT("Audio Track"))
- name.Printf(wxT("Wave Track #%d"), count);
- mStickyLabelMenu->AppendCheckItem(OnStickySubmenuID + count, name);
- if (wt->GetStickyTrack()){
- if (wt->GetStickyTrack() == t)
- mStickyLabelMenu->Check(OnStickySubmenuID + count, true);
- else
- mStickyLabelMenu->Enable(OnStickySubmenuID + count, false);
- }
- count++;
- }
- wt = (WaveTrack *) iter.Next();
- }
-
- mLabelTrackMenu->Append(OnSetNameID, _("Name..."));
- mLabelTrackMenu->AppendSeparator();
- mLabelTrackMenu->Append(OnSetFontID, _("Font..."));
- mLabelTrackMenu->AppendSeparator();
- mLabelTrackMenu->Append(OnMoveUpID, _("Move Track Up"));
- mLabelTrackMenu->Append(OnMoveDownID, _("Move Track Down"));
- mLabelTrackMenu->Append(0, _("Group with Wave Track"), mStickyLabelMenu);
- mLabelTrackMenu->Append(12999, _("Clear any grouping"));
-#endif
theMenu = mLabelTrackMenu;
}
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs