1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 16:49:41 +02:00

ViewInfo has a base class, ZoomInfo, containing only what TrackArtist needs besides the SelectedRegion

This commit is contained in:
Paul-Licameli 2015-04-19 11:14:02 -04:00 committed by Paul Licameli
parent ab21f75c77
commit 8ba9ea5621
2 changed files with 33 additions and 12 deletions

View File

@ -13,21 +13,29 @@ Paul Licameli
#include "Internat.h"
#include "xml/XMLWriter.h"
ViewInfo::ViewInfo(double start, double screenDuration, double pixelsPerSecond)
: selectedRegion()
, track(0)
, vpos(0)
ZoomInfo::ZoomInfo(double start, double screenDuration, double pixelsPerSecond)
: vpos(0)
, h(start)
, screen(screenDuration)
, total(screen)
, zoom(pixelsPerSecond)
{
}
ZoomInfo::~ZoomInfo()
{
}
ViewInfo::ViewInfo(double start, double screenDuration, double pixelsPerSecond)
: ZoomInfo(start, screenDuration, pixelsPerSecond)
, selectedRegion()
, track(NULL)
, total(screen)
, sbarH(0)
, sbarScreen(1)
, sbarTotal(1)
, sbarScale(1.0)
, scrollStep(16)
, bUpdateTrackIndicator(true)
{
}

View File

@ -18,10 +18,28 @@ const double gMaxZoom = 6000000,
class Track;
class AUDACITY_DLL_API ViewInfo
// The subset of ViewInfo information (other than selection)
// that is sufficient for purposes of TrackArtist,
// and for computing conversions between track times and pixel positions.
class AUDACITY_DLL_API ZoomInfo
{
public:
ZoomInfo(double start, double duration, double pixelsPerSecond);
~ZoomInfo();
int vpos; // vertical scroll pos
double h; // h pos in secs
double screen; // screen width in secs
double zoom; // pixels per second
};
class AUDACITY_DLL_API ViewInfo
: public ZoomInfo
{
public:
ViewInfo(double start, double screenDuration, double pixelsPerSecond);
// Current selection
@ -31,13 +49,8 @@ public:
// Scroll info
Track *track; // first visible track
int vpos; // vertical scroll pos
double h; // h pos in secs
double screen; // screen width in secs
double total; // total width in secs
double zoom; // pixels per second
// Current horizontal scroll bar positions, in pixels
wxInt64 sbarH;
wxInt64 sbarScreen;