mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
Remove EXPERIMENTAL_OUTPUT_DISPLAY...
... Maybe a good feature idea, but the implementation pollutes the code in too many places. It's a special case of the more general idea of many-to-one associations between screen rectangles and track objects. More generalized ways to accommodate that should be sought.
This commit is contained in:
parent
ad221b3e82
commit
5407079c62
@ -179,10 +179,6 @@
|
|||||||
//#define EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
|
//#define EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// John (Thales) work to make the display show the result of the pan and gain sliders, rather than their input.
|
|
||||||
// First committed by Martyn, 30th May 2013.
|
|
||||||
//#define EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
|
|
||||||
// Module prefs provides a panel in prefs where users can choose which modules
|
// Module prefs provides a panel in prefs where users can choose which modules
|
||||||
// to enable.
|
// to enable.
|
||||||
#define EXPERIMENTAL_MODULE_PREFS
|
#define EXPERIMENTAL_MODULE_PREFS
|
||||||
|
@ -107,19 +107,6 @@ bool AudacityPrintout::OnPrintPage(int WXUNUSED(page))
|
|||||||
dc->SetPen(*wxBLACK_PEN);
|
dc->SetPen(*wxBLACK_PEN);
|
||||||
AColor::Line(*dc, 0, r.y, width, r.y);
|
AColor::Line(*dc, 0, r.y, width, r.y);
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if(MONO_WAVE_PAN(n)){
|
|
||||||
y += r.height;
|
|
||||||
r.x = 0;
|
|
||||||
r.y = y;
|
|
||||||
r.width = width;
|
|
||||||
r.height = (int)(n->GetHeight(true) * scale);
|
|
||||||
artist.DrawTrack(
|
|
||||||
n, *dc, r, SelectedRegion{}, zoomInfo, false, false, false, false);
|
|
||||||
dc->SetPen(*wxBLACK_PEN);
|
|
||||||
AColor::Line(*dc, 0, r.y, width, r.y);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
n = iter.Next();
|
n = iter.Next();
|
||||||
y += r.height;
|
y += r.height;
|
||||||
};
|
};
|
||||||
|
110
src/Track.cpp
110
src/Track.cpp
@ -62,12 +62,6 @@ Track::Track(const std::shared_ptr<DirManager> &projDirManager)
|
|||||||
mY = 0;
|
mY = 0;
|
||||||
mHeight = DefaultHeight;
|
mHeight = DefaultHeight;
|
||||||
mIndex = 0;
|
mIndex = 0;
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
mYv = mHeight;
|
|
||||||
mHeightv = mHeight;
|
|
||||||
mPerY = 0.5;
|
|
||||||
mVirtualStereo = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mMinimized = false;
|
mMinimized = false;
|
||||||
|
|
||||||
@ -81,9 +75,6 @@ Track::Track(const Track &orig)
|
|||||||
{
|
{
|
||||||
mY = 0;
|
mY = 0;
|
||||||
mIndex = 0;
|
mIndex = 0;
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
mPerY = 0.5;
|
|
||||||
#endif
|
|
||||||
Init(orig);
|
Init(orig);
|
||||||
mOffset = orig.mOffset;
|
mOffset = orig.mOffset;
|
||||||
}
|
}
|
||||||
@ -101,11 +92,6 @@ void Track::Init(const Track &orig)
|
|||||||
mHeight = orig.mHeight;
|
mHeight = orig.mHeight;
|
||||||
mMinimized = orig.mMinimized;
|
mMinimized = orig.mMinimized;
|
||||||
mChannel = orig.mChannel;
|
mChannel = orig.mChannel;
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
mVirtualStereo = orig.mVirtualStereo;
|
|
||||||
mHeightv = orig.mHeightv;
|
|
||||||
mYv = orig.mYv;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Track::SetSelected(bool s)
|
void Track::SetSelected(bool s)
|
||||||
@ -161,43 +147,6 @@ void Track::SetIndex(int index)
|
|||||||
mIndex = index;
|
mIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
int Track::GetY(bool vStereo) const
|
|
||||||
{
|
|
||||||
if(vStereo && mChannel == Track::MonoChannel) return mYv;
|
|
||||||
return mY;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Track::SetY(int y, bool vStereo)
|
|
||||||
{
|
|
||||||
if(vStereo && mChannel == Track::MonoChannel) mYv = y;
|
|
||||||
else mY = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Track::GetHeight(bool vStereo) const
|
|
||||||
{
|
|
||||||
if (mMinimized) {
|
|
||||||
return GetMinimizedHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(vStereo && mChannel == Track::MonoChannel) return mHeightv;
|
|
||||||
return mHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Track::SetHeight(int h, bool vStereo)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(vStereo && mChannel == Track::MonoChannel) mHeightv = h;
|
|
||||||
else mHeight = h;
|
|
||||||
|
|
||||||
if (mList) {
|
|
||||||
mList->RecalcPositions(mNode);
|
|
||||||
mList->ResizedEvent(mNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#else // EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
|
|
||||||
int Track::GetY() const
|
int Track::GetY() const
|
||||||
{
|
{
|
||||||
return mY;
|
return mY;
|
||||||
@ -226,7 +175,6 @@ void Track::SetHeight(int h)
|
|||||||
pList->ResizingEvent(mNode);
|
pList->ResizingEvent(mNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
|
|
||||||
bool Track::GetMinimized() const
|
bool Track::GetMinimized() const
|
||||||
{
|
{
|
||||||
@ -281,17 +229,6 @@ Track *Track::GetLink() const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
void Track::ReorderList(bool resize)
|
|
||||||
{
|
|
||||||
if (mList) {
|
|
||||||
mList->RecalcPositions(mNode);
|
|
||||||
if(resize)
|
|
||||||
mList->ResizedEvent(mNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool Track::IsSyncLockSelected() const
|
bool Track::IsSyncLockSelected() const
|
||||||
{
|
{
|
||||||
#ifdef EXPERIMENTAL_SYNC_LOCK
|
#ifdef EXPERIMENTAL_SYNC_LOCK
|
||||||
@ -824,36 +761,6 @@ void TrackList::RecalcPositions(TrackNodePointer node)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
int cnt = 0;
|
|
||||||
if (hasPrev(node)) {
|
|
||||||
auto prev = node;
|
|
||||||
--prev;
|
|
||||||
t = prev->get();
|
|
||||||
i = t->GetIndex() + 1;
|
|
||||||
if(MONO_WAVE_PAN(t))
|
|
||||||
y = t->GetY(true) + t->GetHeight(true);
|
|
||||||
else
|
|
||||||
y = t->GetY() + t->GetHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto n = node; n != end(); ++n) {
|
|
||||||
t = n->get();
|
|
||||||
if(MONO_WAVE_PAN(t))
|
|
||||||
cnt++;
|
|
||||||
|
|
||||||
if(cnt != 2){
|
|
||||||
t->SetIndex(i++);
|
|
||||||
t->SetY(y);
|
|
||||||
y += t->GetHeight();
|
|
||||||
}
|
|
||||||
if(cnt != 0){
|
|
||||||
t->SetY(y,true);
|
|
||||||
y += t->GetHeight(true);
|
|
||||||
}
|
|
||||||
cnt = 0;
|
|
||||||
}
|
|
||||||
#else // EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if (hasPrev(node)) {
|
if (hasPrev(node)) {
|
||||||
auto prev = node;
|
auto prev = node;
|
||||||
--prev;
|
--prev;
|
||||||
@ -869,7 +776,6 @@ void TrackList::RecalcPositions(TrackNodePointer node)
|
|||||||
t->SetY(y);
|
t->SetY(y);
|
||||||
y += t->GetHeight();
|
y += t->GetHeight();
|
||||||
}
|
}
|
||||||
#endif // EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackList::PermutationEvent()
|
void TrackList::PermutationEvent()
|
||||||
@ -1097,11 +1003,6 @@ int TrackList::GetGroupHeight(Track * t) const
|
|||||||
if (t) {
|
if (t) {
|
||||||
height += t->GetHeight();
|
height += t->GetHeight();
|
||||||
}
|
}
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
else if(MONO_WAVE_PAN(t)){
|
|
||||||
height += t->GetHeight(true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1363,20 +1264,11 @@ int TrackList::GetHeight() const
|
|||||||
{
|
{
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if (!empty()) {
|
|
||||||
const Track *t = rbegin()->get();
|
|
||||||
if(MONO_WAVE_PAN(t))
|
|
||||||
height = t->GetY(true) + t->GetHeight(true);
|
|
||||||
else
|
|
||||||
height = t->GetY() + t->GetHeight();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (!empty()) {
|
if (!empty()) {
|
||||||
const auto &track = back();
|
const auto &track = back();
|
||||||
height = track->GetY() + track->GetHeight();
|
height = track->GetY() + track->GetHeight();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
src/Track.h
26
src/Track.h
@ -78,12 +78,6 @@ class AUDACITY_DLL_API Track /* not final */
|
|||||||
int mIndex;
|
int mIndex;
|
||||||
int mY;
|
int mY;
|
||||||
int mHeight;
|
int mHeight;
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
int mYv; //For mono a virtual Y value is necessary.
|
|
||||||
int mHeightv; // For mono a virtual height value is necessary.
|
|
||||||
float mPerY; //mY as a percent of mYv + mY
|
|
||||||
bool mVirtualStereo;
|
|
||||||
#endif
|
|
||||||
wxString mName;
|
wxString mName;
|
||||||
wxString mDefaultName;
|
wxString mDefaultName;
|
||||||
|
|
||||||
@ -157,25 +151,12 @@ class AUDACITY_DLL_API Track /* not final */
|
|||||||
|
|
||||||
int GetIndex() const;
|
int GetIndex() const;
|
||||||
void SetIndex(int index);
|
void SetIndex(int index);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
int GetY(bool vStereo = false) const;
|
|
||||||
void SetY(int y, bool vStereo = false);
|
|
||||||
int GetHeight(bool vStereo = false) const;
|
|
||||||
void SetHeight(int h, bool vStereo = false);
|
|
||||||
#else
|
|
||||||
int GetY() const;
|
int GetY() const;
|
||||||
void SetY(int y);
|
void SetY(int y);
|
||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
virtual void SetHeight(int h);
|
virtual void SetHeight(int h);
|
||||||
#endif
|
|
||||||
bool GetMinimized() const;
|
bool GetMinimized() const;
|
||||||
virtual void SetMinimized(bool isMinimized);
|
virtual void SetMinimized(bool isMinimized);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
float GetVirtualTrackPercentage() const { return mPerY;}
|
|
||||||
void SetVirtualTrackPercentage(float val) { mPerY = val;}
|
|
||||||
bool GetVirtualStereo() { return mVirtualStereo;}
|
|
||||||
void SetVirtualStereo(bool vStereo) { mVirtualStereo = vStereo;}
|
|
||||||
#endif
|
|
||||||
Track *GetLink() const;
|
Track *GetLink() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -192,9 +173,6 @@ class AUDACITY_DLL_API Track /* not final */
|
|||||||
mutable std::shared_ptr<DirManager> mDirManager;
|
mutable std::shared_ptr<DirManager> mDirManager;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
void ReorderList(bool resize = true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -249,11 +227,7 @@ class AUDACITY_DLL_API Track /* not final */
|
|||||||
virtual void SetOffset (double o) { mOffset = o; }
|
virtual void SetOffset (double o) { mOffset = o; }
|
||||||
|
|
||||||
void SetChannel(int c) { mChannel = c; }
|
void SetChannel(int c) { mChannel = c; }
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
virtual bool SetPan( float ){ return false; }
|
|
||||||
#else
|
|
||||||
virtual void SetPan( float ){ ;}
|
virtual void SetPan( float ){ ;}
|
||||||
#endif
|
|
||||||
virtual void SetPanFromChannelType(){ ;};
|
virtual void SetPanFromChannelType(){ ;};
|
||||||
|
|
||||||
// AS: Note that the dirManager is mutable. This is
|
// AS: Note that the dirManager is mutable. This is
|
||||||
|
@ -419,12 +419,6 @@ void TrackArtist::DrawTracks(TrackPanelDrawingContext &context,
|
|||||||
stereoTrackRect.height += link->GetHeight();
|
stereoTrackRect.height += link->GetHeight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if(MONO_WAVE_PAN(t)){
|
|
||||||
stereoTrackRect.height += t->GetHeight(true);
|
|
||||||
t->SetVirtualStereo(false);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (stereoTrackRect.Intersects(clip) && reg.Contains(stereoTrackRect)) {
|
if (stereoTrackRect.Intersects(clip) && reg.Contains(stereoTrackRect)) {
|
||||||
wxRect rr = trackRect;
|
wxRect rr = trackRect;
|
||||||
@ -437,26 +431,6 @@ void TrackArtist::DrawTracks(TrackPanelDrawingContext &context,
|
|||||||
drawEnvelope, bigPoints, drawSliders, hasSolo);
|
drawEnvelope, bigPoints, drawSliders, hasSolo);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if(MONO_WAVE_PAN(t)){
|
|
||||||
trackRect.y = t->GetY(true) - zoomInfo.vpos;
|
|
||||||
trackRect.height = t->GetHeight(true);
|
|
||||||
stereoTrackRect = trackRect;
|
|
||||||
stereoTrackRect.y -= t->GetHeight();
|
|
||||||
stereoTrackRect.height += t->GetHeight();
|
|
||||||
t->SetVirtualStereo(true);
|
|
||||||
if (stereoTrackRect.Intersects(clip) && reg.Contains(stereoTrackRect)) {
|
|
||||||
wxRect rr = trackRect;
|
|
||||||
rr.x += mMarginLeft;
|
|
||||||
rr.y += mMarginTop;
|
|
||||||
rr.width -= (mMarginLeft + mMarginRight);
|
|
||||||
rr.height -= (mMarginTop + mMarginBottom);
|
|
||||||
DrawTrack(t, dc, rr, selectedRegion, zoomInfo,
|
|
||||||
drawEnvelope, bigPoints, drawSliders, hasSolo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
t = iter.Next();
|
t = iter.Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1192,11 +1166,7 @@ void TrackArtist::DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[
|
|||||||
float zoomMin, float zoomMax,
|
float zoomMin, float zoomMax,
|
||||||
bool dB, float dBRange,
|
bool dB, float dBRange,
|
||||||
const float *min, const float *max, const float *rms, const int *bl,
|
const float *min, const float *max, const float *rms, const int *bl,
|
||||||
bool /* showProgress */, bool muted
|
bool /* showProgress */, bool muted)
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
, const float gain
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// Display a line representing the
|
// Display a line representing the
|
||||||
// min and max of the samples in this region
|
// min and max of the samples in this region
|
||||||
@ -1223,12 +1193,7 @@ void TrackArtist::DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[
|
|||||||
for (int x0 = 0; x0 < rect.width; ++x0) {
|
for (int x0 = 0; x0 < rect.width; ++x0) {
|
||||||
int xx = rect.x + x0;
|
int xx = rect.x + x0;
|
||||||
double v;
|
double v;
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
//JWA: "gain" variable passed to function includes the pan value and is used below 4/14/13
|
|
||||||
v = min[x0] * env[x0] * gain;
|
|
||||||
#else
|
|
||||||
v = min[x0] * env[x0];
|
v = min[x0] * env[x0];
|
||||||
#endif
|
|
||||||
if (clipped && mShowClipping && (v <= -MAX_AUDIO))
|
if (clipped && mShowClipping && (v <= -MAX_AUDIO))
|
||||||
{
|
{
|
||||||
if (clipcnt == 0 || clipped[clipcnt - 1] != xx) {
|
if (clipcnt == 0 || clipped[clipcnt - 1] != xx) {
|
||||||
@ -1238,11 +1203,7 @@ void TrackArtist::DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[
|
|||||||
h1 = GetWaveYPos(v, zoomMin, zoomMax,
|
h1 = GetWaveYPos(v, zoomMin, zoomMax,
|
||||||
rect.height, dB, true, dBRange, true);
|
rect.height, dB, true, dBRange, true);
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
v = max[x0] * env[x0] * gain;
|
|
||||||
#else
|
|
||||||
v = max[x0] * env[x0];
|
v = max[x0] * env[x0];
|
||||||
#endif
|
|
||||||
if (clipped && mShowClipping && (v >= MAX_AUDIO))
|
if (clipped && mShowClipping && (v >= MAX_AUDIO))
|
||||||
{
|
{
|
||||||
if (clipcnt == 0 || clipped[clipcnt - 1] != xx) {
|
if (clipcnt == 0 || clipped[clipcnt - 1] != xx) {
|
||||||
@ -1265,17 +1226,10 @@ void TrackArtist::DrawMinMaxRMS(wxDC &dc, const wxRect & rect, const double env[
|
|||||||
lasth1 = h1;
|
lasth1 = h1;
|
||||||
lasth2 = h2;
|
lasth2 = h2;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
r1[x0] = GetWaveYPos(-rms[x0] * env[x0]*gain, zoomMin, zoomMax,
|
|
||||||
rect.height, dB, true, dBRange, true);
|
|
||||||
r2[x0] = GetWaveYPos(rms[x0] * env[x0]*gain, zoomMin, zoomMax,
|
|
||||||
rect.height, dB, true, dBRange, true);
|
|
||||||
#else
|
|
||||||
r1[x0] = GetWaveYPos(-rms[x0] * env[x0], zoomMin, zoomMax,
|
r1[x0] = GetWaveYPos(-rms[x0] * env[x0], zoomMin, zoomMax,
|
||||||
rect.height, dB, true, dBRange, true);
|
rect.height, dB, true, dBRange, true);
|
||||||
r2[x0] = GetWaveYPos(rms[x0] * env[x0], zoomMin, zoomMax,
|
r2[x0] = GetWaveYPos(rms[x0] * env[x0], zoomMin, zoomMax,
|
||||||
rect.height, dB, true, dBRange, true);
|
rect.height, dB, true, dBRange, true);
|
||||||
#endif
|
|
||||||
// Make sure the rms isn't larger than the waveform min/max
|
// Make sure the rms isn't larger than the waveform min/max
|
||||||
if (r1[x0] > h1 - 1) {
|
if (r1[x0] > h1 - 1) {
|
||||||
r1[x0] = h1 - 1;
|
r1[x0] = h1 - 1;
|
||||||
@ -2012,11 +1966,7 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
|
|||||||
zoomMin, zoomMax,
|
zoomMin, zoomMax,
|
||||||
dB, dBRange,
|
dB, dBRange,
|
||||||
useMin, useMax, useRms, useBl,
|
useMin, useMax, useRms, useBl,
|
||||||
isLoadingOD, muted
|
isLoadingOD, muted);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
, track->GetChannelGain(track->GetChannel())
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bool highlight = false;
|
bool highlight = false;
|
||||||
|
@ -160,11 +160,7 @@ class AUDACITY_DLL_API TrackArtist {
|
|||||||
float zoomMin, float zoomMax,
|
float zoomMin, float zoomMax,
|
||||||
bool dB, float dBRange,
|
bool dB, float dBRange,
|
||||||
const float *min, const float *max, const float *rms, const int *bl,
|
const float *min, const float *max, const float *rms, const int *bl,
|
||||||
bool /* showProgress */, bool muted
|
bool /* showProgress */, bool muted);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
, const float gain
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
void DrawIndividualSamples(wxDC & dc, int leftOffset, const wxRect & rect,
|
void DrawIndividualSamples(wxDC & dc, int leftOffset, const wxRect & rect,
|
||||||
float zoomMin, float zoomMax,
|
float zoomMin, float zoomMax,
|
||||||
bool dB, float dBRange,
|
bool dB, float dBRange,
|
||||||
|
@ -406,33 +406,6 @@ LWSlider *TrackPanel::VelocitySlider( const NoteTrack *nt )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
void TrackPanel::UpdateVirtualStereoOrder()
|
|
||||||
{
|
|
||||||
TrackListOfKindIterator iter(Track::Wave, GetTracks());
|
|
||||||
Track *t;
|
|
||||||
int temp;
|
|
||||||
|
|
||||||
for (t = iter.First(); t; t = iter.Next()) {
|
|
||||||
const auto wt = static_cast<WaveTrack*>(t);
|
|
||||||
if(t->GetChannel() == Track::MonoChannel){
|
|
||||||
|
|
||||||
if(WaveTrack::mMonoAsVirtualStereo && wt->GetPan() != 0){
|
|
||||||
temp = wt->GetHeight();
|
|
||||||
wt->SetHeight(temp*wt->GetVirtualTrackPercentage());
|
|
||||||
wt->SetHeight(temp - wt->GetHeight(),true);
|
|
||||||
}else if(!WaveTrack::mMonoAsVirtualStereo && wt->GetPan() != 0){
|
|
||||||
wt->SetHeight(wt->GetHeight() + wt->GetHeight(true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
t = iter.First();
|
|
||||||
if(t){
|
|
||||||
t->ReorderList(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxString TrackPanel::gSoloPref;
|
wxString TrackPanel::gSoloPref;
|
||||||
|
|
||||||
void TrackPanel::UpdatePrefs()
|
void TrackPanel::UpdatePrefs()
|
||||||
@ -441,15 +414,6 @@ void TrackPanel::UpdatePrefs()
|
|||||||
true);
|
true);
|
||||||
gPrefs->Read(wxT("/GUI/Solo"), &gSoloPref, wxT("Simple"));
|
gPrefs->Read(wxT("/GUI/Solo"), &gSoloPref, wxT("Simple"));
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
bool temp = WaveTrack::mMonoAsVirtualStereo;
|
|
||||||
gPrefs->Read(wxT("/GUI/MonoAsVirtualStereo"), &WaveTrack::mMonoAsVirtualStereo,
|
|
||||||
false);
|
|
||||||
|
|
||||||
if(WaveTrack::mMonoAsVirtualStereo != temp)
|
|
||||||
UpdateVirtualStereoOrder();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mViewInfo->UpdatePrefs();
|
mViewInfo->UpdatePrefs();
|
||||||
|
|
||||||
if (mTrackArtist) {
|
if (mTrackArtist) {
|
||||||
@ -1818,12 +1782,6 @@ void TrackPanel::RefreshTrack(Track *trk, bool refreshbacking)
|
|||||||
rect.height += link->GetHeight();
|
rect.height += link->GetHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
else if(MONO_WAVE_PAN(trk)){
|
|
||||||
rect.height += trk->GetHeight(true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if( refreshbacking )
|
if( refreshbacking )
|
||||||
{
|
{
|
||||||
mRefreshBacking = true;
|
mRefreshBacking = true;
|
||||||
@ -1925,12 +1883,6 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
|
|||||||
skipBorder = true;
|
skipBorder = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if(MONO_WAVE_PAN(t)){
|
|
||||||
rect.height += t->GetHeight(true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// If the previous track is linked to this one but isn't on the screen
|
// If the previous track is linked to this one but isn't on the screen
|
||||||
// (and thus would have been skipped by VisibleTrackIterator) we need to
|
// (and thus would have been skipped by VisibleTrackIterator) we need to
|
||||||
// draw that track's border instead.
|
// draw that track's border instead.
|
||||||
@ -1973,21 +1925,6 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
|
|||||||
rect.height -= (kTopMargin + kBottomMargin);
|
rect.height -= (kTopMargin + kBottomMargin);
|
||||||
mTrackArtist->DrawVRuler(context, t, rect);
|
mTrackArtist->DrawVRuler(context, t, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if(MONO_WAVE_PAN(t)){
|
|
||||||
trackRect.y = t->GetY(true) - mViewInfo->vpos;
|
|
||||||
trackRect.height = t->GetHeight(true);
|
|
||||||
if (region.Contains(0, trackRect.y, GetLeftOffset(), trackRect.height)) {
|
|
||||||
wxRect rect = trackRect;
|
|
||||||
rect.x += GetVRulerOffset();
|
|
||||||
rect.y += kTopMargin;
|
|
||||||
rect.width = GetVRulerWidth();
|
|
||||||
rect.height -= (kTopMargin + kBottomMargin);
|
|
||||||
mTrackArtist->DrawVRuler(context, t, rect);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto target = Target();
|
auto target = Target();
|
||||||
@ -2421,11 +2358,7 @@ void TrackInfo::Status1DrawFunction
|
|||||||
/// stereo and what sample rate it's using.
|
/// stereo and what sample rate it's using.
|
||||||
auto rate = wt ? wt->GetRate() : 44100.0;
|
auto rate = wt ? wt->GetRate() : 44100.0;
|
||||||
wxString s;
|
wxString s;
|
||||||
if (!wt || (wt->GetLinked()
|
if (!wt || (wt->GetLinked()))
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
&& wt->GetChannel() != Track::MonoChannel
|
|
||||||
#endif
|
|
||||||
))
|
|
||||||
s = _("Stereo, %dHz");
|
s = _("Stereo, %dHz");
|
||||||
else {
|
else {
|
||||||
if (wt->GetChannel() == Track::MonoChannel)
|
if (wt->GetChannel() == Track::MonoChannel)
|
||||||
@ -2529,11 +2462,7 @@ void TrackPanel::DrawOutsideOfTrack
|
|||||||
dc->DrawRectangle(side);
|
dc->DrawRectangle(side);
|
||||||
|
|
||||||
// Area between tracks of stereo group
|
// Area between tracks of stereo group
|
||||||
if (t->GetLinked()
|
if (t->GetLinked()) {
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
|| MONO_WAVE_PAN(t)
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
// Paint the channel separator over (what would be) the shadow of the top
|
// Paint the channel separator over (what would be) the shadow of the top
|
||||||
// channel, and the top inset of the bottom channel
|
// channel, and the top inset of the bottom channel
|
||||||
side = rect;
|
side = rect;
|
||||||
@ -2611,12 +2540,6 @@ void TrackPanel::UpdateTrackVRuler(const Track *t)
|
|||||||
rect.height = l->GetHeight() - (kTopMargin + kBottomMargin);
|
rect.height = l->GetHeight() - (kTopMargin + kBottomMargin);
|
||||||
mTrackArtist->UpdateVRuler(l, rect);
|
mTrackArtist->UpdateVRuler(l, rect);
|
||||||
}
|
}
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
else if(MONO_WAVE_PAN(t)){
|
|
||||||
rect.height = t->GetHeight(true) - (kTopMargin + kBottomMargin);
|
|
||||||
mTrackArtist->UpdateVRuler(t, rect);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackPanel::UpdateVRulerSize()
|
void TrackPanel::UpdateVRulerSize()
|
||||||
@ -2717,11 +2640,6 @@ void TrackPanel::EnsureVisible(Track * t)
|
|||||||
nt = iter.Next();
|
nt = iter.Next();
|
||||||
trackHeight += nt->GetHeight();
|
trackHeight += nt->GetHeight();
|
||||||
}
|
}
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
else if(MONO_WAVE_PAN(it)){
|
|
||||||
trackHeight += it->GetHeight(true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else {
|
else {
|
||||||
nt = it;
|
nt = it;
|
||||||
}
|
}
|
||||||
@ -2770,11 +2688,6 @@ void TrackPanel::VerticalScroll( float fracPosition){
|
|||||||
nt = iter.Next();
|
nt = iter.Next();
|
||||||
trackHeight += nt->GetHeight();
|
trackHeight += nt->GetHeight();
|
||||||
}
|
}
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
else if(MONO_WAVE_PAN(it)){
|
|
||||||
trackHeight += it->GetHeight(true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else {
|
else {
|
||||||
nt = it;
|
nt = it;
|
||||||
}
|
}
|
||||||
@ -2814,11 +2727,7 @@ void TrackPanel::DrawBordersAroundTrack(Track * t, wxDC * dc,
|
|||||||
|
|
||||||
// The lines at bottom of 1st track and top of second track of stereo group
|
// The lines at bottom of 1st track and top of second track of stereo group
|
||||||
// Possibly replace with DrawRectangle to add left border.
|
// Possibly replace with DrawRectangle to add left border.
|
||||||
if (t->GetLinked()
|
if (t->GetLinked()) {
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
|| MONO_WAVE_PAN(t)
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
// The given rect has had the top inset subtracted
|
// The given rect has had the top inset subtracted
|
||||||
int h1 = rect.y + t->GetHeight() - kTopInset;
|
int h1 = rect.y + t->GetHeight() - kTopInset;
|
||||||
// h1 is the top coordinate of the second tracks' rectangle
|
// h1 is the top coordinate of the second tracks' rectangle
|
||||||
@ -3518,7 +3427,6 @@ auto TrackPanelCellIterator::operator* () const -> value_type
|
|||||||
|
|
||||||
void TrackPanelCellIterator::UpdateRect()
|
void TrackPanelCellIterator::UpdateRect()
|
||||||
{
|
{
|
||||||
// TODO: cooperate with EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
const auto size = mPanel->GetSize();
|
const auto size = mPanel->GetSize();
|
||||||
if ( mpTrack ) {
|
if ( mpTrack ) {
|
||||||
mRect = {
|
mRect = {
|
||||||
|
@ -437,10 +437,6 @@ public:
|
|||||||
(const std::shared_ptr< TrackPanelCell > &pCell);
|
(const std::shared_ptr< TrackPanelCell > &pCell);
|
||||||
std::shared_ptr< TrackPanelCell > GetBackgroundCell();
|
std::shared_ptr< TrackPanelCell > GetBackgroundCell();
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
void UpdateVirtualStereoOrder();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Accessors...
|
// Accessors...
|
||||||
static bool HasSoloButton(){ return gSoloPref!=wxT("None");}
|
static bool HasSoloButton(){ return gSoloPref!=wxT("None");}
|
||||||
|
@ -24,10 +24,6 @@ Paul Licameli split from TrackPanel.cpp
|
|||||||
#include "TrackPanelMouseEvent.h"
|
#include "TrackPanelMouseEvent.h"
|
||||||
#include "tracks/ui/TrackControls.h"
|
#include "tracks/ui/TrackControls.h"
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
#include "WaveTrack.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HitTestPreview TrackPanelResizeHandle::HitPreview(bool bLinked)
|
HitTestPreview TrackPanelResizeHandle::HitPreview(bool bLinked)
|
||||||
{
|
{
|
||||||
static wxCursor resizeCursor{ wxCURSOR_SIZENS };
|
static wxCursor resizeCursor{ wxCURSOR_SIZENS };
|
||||||
@ -67,59 +63,35 @@ TrackPanelResizeHandle::TrackPanelResizeHandle
|
|||||||
: mpTrack{ track }
|
: mpTrack{ track }
|
||||||
, mMouseClickY( y )
|
, mMouseClickY( y )
|
||||||
{
|
{
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
auto tracks = pProject->GetTracks();
|
||||||
if (MONO_WAVE_PAN(track)){
|
Track *prev = tracks->GetPrev(track.get());
|
||||||
//STM: Determine whether we should rescale one or two tracks
|
Track *next = tracks->GetNext(track.get());
|
||||||
if (track->GetVirtualStereo()) {
|
|
||||||
// mpTrack is the lower track
|
|
||||||
mInitialTrackHeight = track->GetHeight(true);
|
|
||||||
mInitialActualHeight = mInitialUpperActualHeight = track->GetActualHeight();
|
|
||||||
mInitialMinimized = track->GetMinimized();
|
|
||||||
mInitialUpperTrackHeight = track->GetHeight();
|
|
||||||
mMode = IsResizingBelowLinkedTracks;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// mpTrack is the upper track
|
|
||||||
mInitialTrackHeight = track->GetHeight(true);
|
|
||||||
mInitialActualHeight = mInitialUpperActualHeight = track->GetActualHeight();
|
|
||||||
mInitialMinimized = track->GetMinimized();
|
|
||||||
mInitialUpperTrackHeight = track->GetHeight();
|
|
||||||
mMode = IsResizingBetweenLinkedTracks;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
auto tracks = pProject->GetTracks();
|
|
||||||
Track *prev = tracks->GetPrev(track.get());
|
|
||||||
Track *next = tracks->GetNext(track.get());
|
|
||||||
|
|
||||||
//STM: Determine whether we should rescale one or two tracks
|
//STM: Determine whether we should rescale one or two tracks
|
||||||
if (prev && prev->GetLink() == track.get()) {
|
if (prev && prev->GetLink() == track.get()) {
|
||||||
// mpTrack is the lower track
|
// mpTrack is the lower track
|
||||||
mInitialTrackHeight = track->GetHeight();
|
mInitialTrackHeight = track->GetHeight();
|
||||||
mInitialActualHeight = track->GetActualHeight();
|
mInitialActualHeight = track->GetActualHeight();
|
||||||
mInitialMinimized = track->GetMinimized();
|
mInitialMinimized = track->GetMinimized();
|
||||||
mInitialUpperTrackHeight = prev->GetHeight();
|
mInitialUpperTrackHeight = prev->GetHeight();
|
||||||
mInitialUpperActualHeight = prev->GetActualHeight();
|
mInitialUpperActualHeight = prev->GetActualHeight();
|
||||||
mMode = IsResizingBelowLinkedTracks;
|
mMode = IsResizingBelowLinkedTracks;
|
||||||
}
|
}
|
||||||
else if (next && track->GetLink() == next) {
|
else if (next && track->GetLink() == next) {
|
||||||
// mpTrack is the upper track
|
// mpTrack is the upper track
|
||||||
mInitialTrackHeight = next->GetHeight();
|
mInitialTrackHeight = next->GetHeight();
|
||||||
mInitialActualHeight = next->GetActualHeight();
|
mInitialActualHeight = next->GetActualHeight();
|
||||||
mInitialMinimized = next->GetMinimized();
|
mInitialMinimized = next->GetMinimized();
|
||||||
mInitialUpperTrackHeight = track->GetHeight();
|
mInitialUpperTrackHeight = track->GetHeight();
|
||||||
mInitialUpperActualHeight = track->GetActualHeight();
|
mInitialUpperActualHeight = track->GetActualHeight();
|
||||||
mMode = IsResizingBetweenLinkedTracks;
|
mMode = IsResizingBetweenLinkedTracks;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// DM: Save the initial mouse location and the initial height
|
// DM: Save the initial mouse location and the initial height
|
||||||
mInitialTrackHeight = track->GetHeight();
|
mInitialTrackHeight = track->GetHeight();
|
||||||
mInitialActualHeight = track->GetActualHeight();
|
mInitialActualHeight = track->GetActualHeight();
|
||||||
mInitialMinimized = track->GetMinimized();
|
mInitialMinimized = track->GetMinimized();
|
||||||
mMode = IsResizing;
|
mMode = IsResizing;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,13 +126,6 @@ UIHandle::Result TrackPanelResizeHandle::Drag
|
|||||||
mInitialUpperTrackHeight = link->GetHeight();
|
mInitialUpperTrackHeight = link->GetHeight();
|
||||||
mInitialTrackHeight = pTrack->GetHeight();
|
mInitialTrackHeight = pTrack->GetHeight();
|
||||||
}
|
}
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
else if (MONO_WAVE_PAN(mpTrack)){
|
|
||||||
mpTrack->SetMinimized(false);
|
|
||||||
mInitialUpperTrackHeight = mpTrack->GetHeight();
|
|
||||||
mInitialTrackHeight = mpTrack->GetHeight(true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common pieces of code for MONO_WAVE_PAN and otherwise.
|
// Common pieces of code for MONO_WAVE_PAN and otherwise.
|
||||||
@ -180,11 +145,7 @@ UIHandle::Result TrackPanelResizeHandle::Drag
|
|||||||
if (newUpperTrackHeight < prev->GetMinimizedHeight())
|
if (newUpperTrackHeight < prev->GetMinimizedHeight())
|
||||||
newUpperTrackHeight = prev->GetMinimizedHeight();
|
newUpperTrackHeight = prev->GetMinimizedHeight();
|
||||||
|
|
||||||
pTrack->SetHeight(newTrackHeight
|
pTrack->SetHeight(newTrackHeight);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
, vStereo
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
prev->SetHeight(newUpperTrackHeight);
|
prev->SetHeight(newUpperTrackHeight);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -204,21 +165,8 @@ UIHandle::Result TrackPanelResizeHandle::Drag
|
|||||||
mInitialUpperTrackHeight + mInitialTrackHeight - pTrack->GetMinimizedHeight();
|
mInitialUpperTrackHeight + mInitialTrackHeight - pTrack->GetMinimizedHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if (vStereo) {
|
|
||||||
float temp = 1.0f;
|
|
||||||
if(newUpperTrackHeight != 0.0f)
|
|
||||||
temp = (float)newUpperTrackHeight/(float)(newUpperTrackHeight + newTrackHeight);
|
|
||||||
mpTrack->SetVirtualTrackPercentage(temp);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pTrack->SetHeight(newUpperTrackHeight);
|
pTrack->SetHeight(newUpperTrackHeight);
|
||||||
next->SetHeight(newTrackHeight
|
next->SetHeight(newTrackHeight);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
, vStereo
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
auto doResize = [&] {
|
auto doResize = [&] {
|
||||||
@ -232,58 +180,28 @@ UIHandle::Result TrackPanelResizeHandle::Drag
|
|||||||
// If two, resize proportionally if we are dragging the lower track, and
|
// If two, resize proportionally if we are dragging the lower track, and
|
||||||
// adjust compensatively if we are dragging the upper track.
|
// adjust compensatively if we are dragging the upper track.
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
switch( mMode )
|
||||||
if(MONO_WAVE_PAN(mpTrack)) {
|
|
||||||
switch( mMode )
|
|
||||||
{
|
|
||||||
case IsResizingBelowLinkedTracks:
|
|
||||||
{
|
|
||||||
doResizeBelow( mpTrack, true );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case IsResizingBetweenLinkedTracks:
|
|
||||||
{
|
|
||||||
doResizeBetween( mpTrack, true );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case IsResizing:
|
|
||||||
{
|
|
||||||
// Should imply !MONO_WAVE_PAN(mCapturedTrack),
|
|
||||||
// so impossible, but anyway:
|
|
||||||
doResize();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
// don't refresh in this case.
|
|
||||||
return RefreshCode::RefreshNone;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
switch( mMode )
|
case IsResizingBelowLinkedTracks:
|
||||||
{
|
{
|
||||||
case IsResizingBelowLinkedTracks:
|
Track *prev = tracks->GetPrev(pTrack.get());
|
||||||
{
|
doResizeBelow(prev, false);
|
||||||
Track *prev = tracks->GetPrev(pTrack.get());
|
break;
|
||||||
doResizeBelow(prev, false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case IsResizingBetweenLinkedTracks:
|
|
||||||
{
|
|
||||||
Track *next = tracks->GetNext(pTrack.get());
|
|
||||||
doResizeBetween(next, false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case IsResizing:
|
|
||||||
{
|
|
||||||
doResize();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
// don't refresh in this case.
|
|
||||||
return RefreshCode::RefreshNone;
|
|
||||||
}
|
}
|
||||||
|
case IsResizingBetweenLinkedTracks:
|
||||||
|
{
|
||||||
|
Track *next = tracks->GetNext(pTrack.get());
|
||||||
|
doResizeBetween(next, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case IsResizing:
|
||||||
|
{
|
||||||
|
doResize();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
// don't refresh in this case.
|
||||||
|
return RefreshCode::RefreshNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RefreshCode::RefreshAll;
|
return RefreshCode::RefreshAll;
|
||||||
@ -329,13 +247,8 @@ UIHandle::Result TrackPanelResizeHandle::Cancel(AudacityProject *pProject)
|
|||||||
Track *const next = tracks->GetNext(pTrack.get());
|
Track *const next = tracks->GetNext(pTrack.get());
|
||||||
pTrack->SetHeight(mInitialUpperActualHeight);
|
pTrack->SetHeight(mInitialUpperActualHeight);
|
||||||
pTrack->SetMinimized(mInitialMinimized);
|
pTrack->SetMinimized(mInitialMinimized);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
next->SetHeight(mInitialActualHeight);
|
||||||
if( !MONO_WAVE_PAN(pTrack) )
|
next->SetMinimized(mInitialMinimized);
|
||||||
#endif
|
|
||||||
{
|
|
||||||
next->SetHeight(mInitialActualHeight);
|
|
||||||
next->SetMinimized(mInitialMinimized);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IsResizingBelowLinkedTracks:
|
case IsResizingBelowLinkedTracks:
|
||||||
@ -343,13 +256,8 @@ UIHandle::Result TrackPanelResizeHandle::Cancel(AudacityProject *pProject)
|
|||||||
Track *const prev = tracks->GetPrev(pTrack.get());
|
Track *const prev = tracks->GetPrev(pTrack.get());
|
||||||
pTrack->SetHeight(mInitialActualHeight);
|
pTrack->SetHeight(mInitialActualHeight);
|
||||||
pTrack->SetMinimized(mInitialMinimized);
|
pTrack->SetMinimized(mInitialMinimized);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
prev->SetHeight(mInitialUpperActualHeight);
|
||||||
if( !MONO_WAVE_PAN(pTrack) )
|
prev->SetMinimized(mInitialMinimized);
|
||||||
#endif
|
|
||||||
{
|
|
||||||
prev->SetHeight(mInitialUpperActualHeight);
|
|
||||||
prev->SetMinimized(mInitialMinimized);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -68,10 +68,6 @@ Track classes.
|
|||||||
|
|
||||||
using std::max;
|
using std::max;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
bool WaveTrack::mMonoAsVirtualStereo;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WaveTrack::Holder TrackFactory::DuplicateWaveTrack(const WaveTrack &orig)
|
WaveTrack::Holder TrackFactory::DuplicateWaveTrack(const WaveTrack &orig)
|
||||||
{
|
{
|
||||||
return std::unique_ptr<WaveTrack>
|
return std::unique_ptr<WaveTrack>
|
||||||
@ -430,41 +426,6 @@ float WaveTrack::GetPan() const
|
|||||||
return mPan;
|
return mPan;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
bool WaveTrack::SetPan(float newPan)
|
|
||||||
{
|
|
||||||
float p=mPan;
|
|
||||||
bool panZero=false;
|
|
||||||
int temp;
|
|
||||||
|
|
||||||
if (newPan > 1.0)
|
|
||||||
mPan = 1.0;
|
|
||||||
else if (newPan < -1.0)
|
|
||||||
mPan = -1.0;
|
|
||||||
else
|
|
||||||
mPan = newPan;
|
|
||||||
|
|
||||||
if(mDisplay == WaveTrack::Waveform &&
|
|
||||||
mChannel == Track::MonoChannel &&
|
|
||||||
((p == 0.0f) != (newPan == 0.0f)) &&
|
|
||||||
mMonoAsVirtualStereo)
|
|
||||||
{
|
|
||||||
panZero=true;
|
|
||||||
if(!mPan) {
|
|
||||||
mHeight = mHeight + mHeightv;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
temp = mHeight;
|
|
||||||
mHeight = temp*mPerY;
|
|
||||||
mHeightv = temp - mHeight;
|
|
||||||
}
|
|
||||||
ReorderList();
|
|
||||||
}
|
|
||||||
|
|
||||||
return panZero;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else // EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
void WaveTrack::SetPan(float newPan)
|
void WaveTrack::SetPan(float newPan)
|
||||||
{
|
{
|
||||||
if (newPan > 1.0)
|
if (newPan > 1.0)
|
||||||
@ -474,65 +435,12 @@ void WaveTrack::SetPan(float newPan)
|
|||||||
else
|
else
|
||||||
mPan = newPan;
|
mPan = newPan;
|
||||||
}
|
}
|
||||||
#endif // EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
void WaveTrack::SetVirtualState(bool state, bool half)
|
|
||||||
{
|
|
||||||
int temp;
|
|
||||||
|
|
||||||
if(half)
|
|
||||||
mPerY = 0.5;
|
|
||||||
|
|
||||||
if(state){
|
|
||||||
if(mPan){
|
|
||||||
temp = mHeight;
|
|
||||||
mHeight = temp*mPerY;
|
|
||||||
mHeightv = temp - mHeight;
|
|
||||||
}
|
|
||||||
ReorderList();
|
|
||||||
}else{
|
|
||||||
if(mPan){
|
|
||||||
mHeight = mHeight + mHeightv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int WaveTrack::GetMinimizedHeight() const
|
|
||||||
{
|
|
||||||
if (GetLink()) {
|
|
||||||
return 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(GetChannel() == MonoChannel && GetPan() != 0 && mMonoAsVirtualStereo && mDisplay == Waveform)
|
|
||||||
return 20;
|
|
||||||
else
|
|
||||||
return 40;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WaveTrack::VirtualStereoInit()
|
|
||||||
{
|
|
||||||
int temp;
|
|
||||||
|
|
||||||
if(mChannel == Track::MonoChannel && mPan != 0.0f && mMonoAsVirtualStereo){
|
|
||||||
temp = mHeight;
|
|
||||||
mHeight = temp*mPerY;
|
|
||||||
mHeightv = temp - mHeight;
|
|
||||||
ReorderList(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float WaveTrack::GetChannelGain(int channel) const
|
float WaveTrack::GetChannelGain(int channel) const
|
||||||
{
|
{
|
||||||
float left = 1.0;
|
float left = 1.0;
|
||||||
float right = 1.0;
|
float right = 1.0;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if(mVirtualStereo)
|
|
||||||
channel = 3;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mPan < 0)
|
if (mPan < 0)
|
||||||
right = (mPan + 1.0);
|
right = (mPan + 1.0);
|
||||||
else if (mPan > 0)
|
else if (mPan > 0)
|
||||||
@ -1800,9 +1708,6 @@ bool WaveTrack::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
|
|||||||
// Don't use SetWaveColorIndex as it sets the clips too.
|
// Don't use SetWaveColorIndex as it sets the clips too.
|
||||||
mWaveColorIndex = nValue;
|
mWaveColorIndex = nValue;
|
||||||
} // while
|
} // while
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
VirtualStereoInit();
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1864,16 +1769,7 @@ void WaveTrack::WriteXML(XMLWriter &xmlFile) const
|
|||||||
xmlFile.WriteAttr(wxT("channel"), mChannel);
|
xmlFile.WriteAttr(wxT("channel"), mChannel);
|
||||||
xmlFile.WriteAttr(wxT("linked"), mLinked);
|
xmlFile.WriteAttr(wxT("linked"), mLinked);
|
||||||
this->PlayableTrack::WriteXMLAttributes(xmlFile);
|
this->PlayableTrack::WriteXMLAttributes(xmlFile);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
int height;
|
|
||||||
if(MONO_PAN)
|
|
||||||
height = mHeight + mHeightv;
|
|
||||||
else
|
|
||||||
height = this->GetActualHeight();
|
|
||||||
xmlFile.WriteAttr(wxT("height"), height);
|
|
||||||
#else
|
|
||||||
xmlFile.WriteAttr(wxT("height"), this->GetActualHeight());
|
xmlFile.WriteAttr(wxT("height"), this->GetActualHeight());
|
||||||
#endif
|
|
||||||
xmlFile.WriteAttr(wxT("minimized"), this->GetMinimized());
|
xmlFile.WriteAttr(wxT("minimized"), this->GetMinimized());
|
||||||
xmlFile.WriteAttr(wxT("isSelected"), this->GetSelected());
|
xmlFile.WriteAttr(wxT("isSelected"), this->GetSelected());
|
||||||
xmlFile.WriteAttr(wxT("rate"), mRate);
|
xmlFile.WriteAttr(wxT("rate"), mRate);
|
||||||
|
@ -37,22 +37,6 @@ class EnvelopeHandle;
|
|||||||
//
|
//
|
||||||
#define WAVETRACK_MERGE_POINT_TOLERANCE 0.01
|
#define WAVETRACK_MERGE_POINT_TOLERANCE 0.01
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
#define MONO_WAVE_PAN(T) \
|
|
||||||
(T != NULL && \
|
|
||||||
T->GetChannel() == Track::MonoChannel && \
|
|
||||||
T->GetKind() == Track::Wave && \
|
|
||||||
((const WaveTrack *)T)->GetPan() != 0 && \
|
|
||||||
WaveTrack::mMonoAsVirtualStereo && \
|
|
||||||
((const WaveTrack *)T)->GetDisplay() == WaveTrack::Waveform)
|
|
||||||
|
|
||||||
#define MONO_PAN \
|
|
||||||
(mPan != 0.0 && \
|
|
||||||
mChannel == MonoChannel && \
|
|
||||||
mDisplay == Waveform && \
|
|
||||||
mMonoAsVirtualStereo)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \brief Structure to hold region of a wavetrack and a comparison function
|
/// \brief Structure to hold region of a wavetrack and a comparison function
|
||||||
/// for sortability.
|
/// for sortability.
|
||||||
struct Region
|
struct Region
|
||||||
@ -92,15 +76,9 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
|
|||||||
|
|
||||||
Track::Holder Duplicate() const override;
|
Track::Holder Duplicate() const override;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
void VirtualStereoInit();
|
|
||||||
#endif
|
|
||||||
friend class TrackFactory;
|
friend class TrackFactory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
static bool mMonoAsVirtualStereo;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef WaveTrackLocation Location;
|
typedef WaveTrackLocation Location;
|
||||||
using Holder = std::unique_ptr<WaveTrack>;
|
using Holder = std::unique_ptr<WaveTrack>;
|
||||||
@ -135,9 +113,7 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
|
|||||||
//
|
//
|
||||||
|
|
||||||
int GetKind() const override { return Wave; }
|
int GetKind() const override { return Wave; }
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
int GetMinimizedHeight() const override;
|
|
||||||
#endif
|
|
||||||
//
|
//
|
||||||
// WaveTrack parameters
|
// WaveTrack parameters
|
||||||
//
|
//
|
||||||
@ -151,16 +127,10 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
|
|||||||
|
|
||||||
// -1.0 (left) -> 1.0 (right)
|
// -1.0 (left) -> 1.0 (right)
|
||||||
float GetPan() const;
|
float GetPan() const;
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
bool SetPan(float newPan);
|
|
||||||
#else
|
|
||||||
void SetPan(float newPan) override;
|
void SetPan(float newPan) override;
|
||||||
#endif
|
|
||||||
// Takes gain and pan into account
|
// Takes gain and pan into account
|
||||||
float GetChannelGain(int channel) const;
|
float GetChannelGain(int channel) const;
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
void SetVirtualState(bool state, bool half=false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void SetMinimized(bool isMinimized) override;
|
void SetMinimized(bool isMinimized) override;
|
||||||
|
|
||||||
|
@ -204,11 +204,6 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
S.TieCheckBox(_("B&lend system and Audacity theme"),
|
S.TieCheckBox(_("B&lend system and Audacity theme"),
|
||||||
wxT("/GUI/BlendThemes"),
|
wxT("/GUI/BlendThemes"),
|
||||||
true);
|
true);
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
S.TieCheckBox(_("&Display a mono channel as virtual stereo"),
|
|
||||||
wxT("/GUI/MonoAsVirtualStereo"),
|
|
||||||
false);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
S.EndStatic();
|
S.EndStatic();
|
||||||
}
|
}
|
||||||
|
@ -738,14 +738,6 @@ void WaveTrackMenuTable::OnSetDisplay(wxCommandEvent & event)
|
|||||||
? WaveformSettings::stLinear
|
? WaveformSettings::stLinear
|
||||||
: WaveformSettings::stLogarithmic;
|
: WaveformSettings::stLogarithmic;
|
||||||
}
|
}
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if (pTrack->GetDisplay() == WaveTrack::Waveform) {
|
|
||||||
pTrack->SetVirtualState(false);
|
|
||||||
}
|
|
||||||
else if (id == WaveTrack::Waveform) {
|
|
||||||
pTrack->SetVirtualState(true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
AudacityProject *const project = ::GetActiveProject();
|
AudacityProject *const project = ::GetActiveProject();
|
||||||
project->ModifyState(true);
|
project->ModifyState(true);
|
||||||
@ -853,13 +845,6 @@ void WaveTrackMenuTable::OnMergeStereo(wxCommandEvent &)
|
|||||||
// Assume partner is wave or null
|
// Assume partner is wave or null
|
||||||
const auto partner = static_cast<WaveTrack*>(pTrack->GetLink());
|
const auto partner = static_cast<WaveTrack*>(pTrack->GetLink());
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if (MONO_WAVE_PAN(pTrack))
|
|
||||||
pTrack->SetVirtualState(false);
|
|
||||||
if (MONO_WAVE_PAN(partner))
|
|
||||||
static_cast<WaveTrack*>(partner)->SetVirtualState(false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (partner) {
|
if (partner) {
|
||||||
// Set partner's parameters to match target.
|
// Set partner's parameters to match target.
|
||||||
partner->Merge(*pTrack);
|
partner->Merge(*pTrack);
|
||||||
@ -918,13 +903,6 @@ void WaveTrackMenuTable::SplitStereo(bool stereo)
|
|||||||
if (!partner)
|
if (!partner)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if (!stereo && MONO_WAVE_PAN(pTrack))
|
|
||||||
pTrack->SetVirtualState(true, true);
|
|
||||||
if (!stereo && MONO_WAVE_PAN(partner))
|
|
||||||
partner->SetVirtualState(true, true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (partner)
|
if (partner)
|
||||||
{
|
{
|
||||||
// Keep original stereo track name.
|
// Keep original stereo track name.
|
||||||
|
@ -131,12 +131,7 @@ UIHandle::Result PanSliderHandle::SetValue(AudacityProject *pProject, float newV
|
|||||||
auto pTrack = GetWaveTrack();
|
auto pTrack = GetWaveTrack();
|
||||||
|
|
||||||
if (pTrack) {
|
if (pTrack) {
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
bool panZero = false;
|
|
||||||
panZero = static_cast<WaveTrack*>(mpTrack)->SetPan(newValue);
|
|
||||||
#else
|
|
||||||
pTrack->SetPan(newValue);
|
pTrack->SetPan(newValue);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Assume linked track is wave or null
|
// Assume linked track is wave or null
|
||||||
const auto link = static_cast<WaveTrack*>(pTrack->GetLink());
|
const auto link = static_cast<WaveTrack*>(pTrack->GetLink());
|
||||||
@ -146,11 +141,6 @@ UIHandle::Result PanSliderHandle::SetValue(AudacityProject *pProject, float newV
|
|||||||
MixerBoard *const pMixerBoard = pProject->GetMixerBoard();
|
MixerBoard *const pMixerBoard = pProject->GetMixerBoard();
|
||||||
if (pMixerBoard)
|
if (pMixerBoard)
|
||||||
pMixerBoard->UpdatePan(pTrack.get());
|
pMixerBoard->UpdatePan(pTrack.get());
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if(panZero)
|
|
||||||
result |= FixScrollbars;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -20,10 +20,6 @@ Paul Licameli split from TrackPanel.cpp
|
|||||||
#include "../../TrackPanelAx.h"
|
#include "../../TrackPanelAx.h"
|
||||||
#include "../../ViewInfo.h"
|
#include "../../ViewInfo.h"
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
#include "../../WaveTrack.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <wx/dc.h>
|
#include <wx/dc.h>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -117,16 +113,6 @@ void EditCursorOverlay::Draw(OverlayPanel &panel, wxDC &dc)
|
|||||||
AColor::Line(dc, mLastCursorX, rect.GetTop(), mLastCursorX, rect.GetBottom());
|
AColor::Line(dc, mLastCursorX, rect.GetTop(), mLastCursorX, rect.GetBottom());
|
||||||
// ^^^ The whole point of this routine.
|
// ^^^ The whole point of this routine.
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
||||||
if (MONO_WAVE_PAN(pTrack)){
|
|
||||||
auto y = pTrack->GetY(true) - viewInfo.vpos;
|
|
||||||
auto top = y + kTopMargin;
|
|
||||||
auto height = pTrack->GetHeight(true) - (kTopMargin + kBottomMargin);
|
|
||||||
// - 1 because AColor::Line is inclusive of endpoint
|
|
||||||
AColor::Line(dc, mLastCursorX, top, mLastCursorX, top + height - 1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user