2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
TrackPanel.h
|
|
|
|
|
|
|
|
Dominic Mazzoni
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef __AUDACITY_TRACK_PANEL__
|
|
|
|
#define __AUDACITY_TRACK_PANEL__
|
|
|
|
|
2016-02-14 18:23:08 +00:00
|
|
|
#include "MemoryX.h"
|
2015-04-12 16:39:11 +00:00
|
|
|
#include <vector>
|
2014-10-18 14:19:38 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
#include <wx/timer.h>
|
|
|
|
|
2014-10-18 14:19:38 +00:00
|
|
|
#include "Experimental.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-18 01:37:41 +00:00
|
|
|
#include "HitTestResult.h"
|
|
|
|
|
2016-02-24 16:41:26 +00:00
|
|
|
#include "SelectedRegion.h"
|
2015-07-03 04:20:21 +00:00
|
|
|
|
2016-05-07 17:00:48 +00:00
|
|
|
#include "widgets/OverlayPanel.h"
|
2015-07-09 04:38:42 +00:00
|
|
|
|
2017-06-11 11:20:01 +00:00
|
|
|
#include "SelectionState.h"
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
class wxMenu;
|
|
|
|
class wxRect;
|
|
|
|
|
2014-10-05 17:10:09 +00:00
|
|
|
class LabelTrack;
|
2014-10-18 14:19:38 +00:00
|
|
|
class SpectrumAnalyst;
|
2015-07-08 21:17:43 +00:00
|
|
|
class Track;
|
|
|
|
class TrackList;
|
2010-01-23 19:44:49 +00:00
|
|
|
class TrackPanel;
|
2015-07-07 03:12:16 +00:00
|
|
|
class TrackPanelCell;
|
2010-01-23 19:44:49 +00:00
|
|
|
class TrackArtist;
|
|
|
|
class Ruler;
|
|
|
|
class SnapManager;
|
|
|
|
class AdornedRulerPanel;
|
|
|
|
class LWSlider;
|
|
|
|
class ControlToolBar; //Needed because state of controls can affect what gets drawn.
|
|
|
|
class ToolsToolBar; //Needed because state of controls can affect what gets drawn.
|
2010-07-21 04:53:38 +00:00
|
|
|
class MixerBoard;
|
2010-01-23 19:44:49 +00:00
|
|
|
class AudacityProject;
|
|
|
|
|
|
|
|
class TrackPanelAx;
|
2017-06-17 02:57:08 +00:00
|
|
|
class TrackPanelCellIterator;
|
2017-06-08 21:27:41 +00:00
|
|
|
struct TrackPanelMouseEvent;
|
2017-06-29 03:21:20 +00:00
|
|
|
struct TrackPanelMouseState;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-19 16:21:31 +00:00
|
|
|
class ViewInfo;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-07-08 21:17:43 +00:00
|
|
|
class NoteTrack;
|
2015-07-03 04:20:21 +00:00
|
|
|
class WaveTrack;
|
2015-07-04 22:12:25 +00:00
|
|
|
class WaveClip;
|
2015-07-07 03:12:16 +00:00
|
|
|
class UIHandle;
|
Changed lifetime management of UIHandle objects, no singletons...
... Rather, construct them during hit tests (also capturing more state sooner
rather than at Click time, and adding some accessors for later use)
This also fixes bug 1677 by other means and avoids similar problems.
A cell may be implemented to re-use a previously hit handle object, not yet
clicked, in a later hit test, by remembering a weak pointer, but TrackPanel
holds the strong pointers that determine when the object is destroyed.
And the objects will surely be destroyed after drag-release, or ESC key.
For now they are also destroyed whenever not dragging, and hit-testing is
re-invoked; that will be changed later, so that the re-use mentioned above
becomes effective, but still they will be destroyed when the pointer moves
from one cell to another.
2017-07-05 20:45:55 +00:00
|
|
|
using UIHandlePtr = std::shared_ptr<UIHandle>;
|
2015-07-03 04:20:21 +00:00
|
|
|
|
2014-10-18 14:19:38 +00:00
|
|
|
// Declared elsewhere, to reduce compilation dependencies
|
|
|
|
class TrackPanelListener;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-07-07 11:56:49 +00:00
|
|
|
struct TrackPanelDrawingContext;
|
|
|
|
|
2016-02-25 01:45:49 +00:00
|
|
|
enum class UndoPush : unsigned char;
|
|
|
|
|
2011-11-25 20:40:26 +00:00
|
|
|
// JKC Nov 2011: Disabled warning C4251 which is to do with DLL linkage
|
|
|
|
// and only a worry when there are DLLs using the structures.
|
2015-07-09 04:38:42 +00:00
|
|
|
// Array classes are private in TrackInfo, so we will not
|
2011-11-25 20:40:26 +00:00
|
|
|
// access them directly from the DLL.
|
2014-06-03 20:30:19 +00:00
|
|
|
// TrackClipArray in TrackPanel needs to be handled with care in the derived
|
2011-11-25 20:40:26 +00:00
|
|
|
// class, but the C4251 warning is no worry in core Audacity.
|
2014-06-03 20:30:19 +00:00
|
|
|
// wxWidgets doesn't cater to the exact details we need in
|
2011-11-25 20:40:26 +00:00
|
|
|
// WX_DECLARE_EXPORTED_OBJARRAY to be able to use that for these two arrays.
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning( push )
|
|
|
|
#pragma warning( disable: 4251 )
|
|
|
|
#endif
|
|
|
|
|
2015-07-12 12:47:56 +00:00
|
|
|
DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_TRACK_PANEL_TIMER, -1);
|
|
|
|
|
2015-08-27 05:13:46 +00:00
|
|
|
enum {
|
|
|
|
kTimerInterval = 50, // milliseconds
|
|
|
|
};
|
|
|
|
|
2017-06-12 16:28:20 +00:00
|
|
|
|
2011-11-25 20:40:26 +00:00
|
|
|
class AUDACITY_DLL_API TrackInfo
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
public:
|
Fix for bug #949
This removes the TrackInfo's slider "cache".
Originally, the cache would build to the maximum number of tracks you
had created in an Audacity session. So, if you created 128 tracks
and then reduced that to 1, you'd still have 256 sliders, 1 gain and
1 pan per track.
But, the only real thing the cache did was prevent continuous allocations
of sliders since the allocated sliders position and values wer still
being updated nearly with ever interaction since they were redrawn each
time.
In April 2010, the slider cache was changed to reduce its size by
creating a sort of ring buffer based on how many tracks were displayed
and how many tracks were in the project (I guess). Unfortunately, it
didn't really handle large number of tracks and this bug was born.
While trying to find the proper fix for this, I realized that the
cache really wasn't saving anything. Maybe a little when dragging
the thumb, but during normal track redraws and interaction, it really
didn't serve a purpose, other than use additional memory.
So, I've removed the cache and have allocated a single gain and a
single pan slider. As before, their position and value are changed
as needed when drawn and manipulated.
2015-05-25 03:54:10 +00:00
|
|
|
TrackInfo(TrackPanel * pParentIn);
|
2010-01-23 19:44:49 +00:00
|
|
|
~TrackInfo();
|
2017-04-05 19:16:12 +00:00
|
|
|
void ReCreateSliders();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-07-14 15:53:17 +00:00
|
|
|
static unsigned MinimumTrackHeight();
|
|
|
|
|
2017-06-12 16:28:20 +00:00
|
|
|
struct TCPLine;
|
|
|
|
|
|
|
|
static void DrawItems
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track &track );
|
2017-06-12 16:28:20 +00:00
|
|
|
|
|
|
|
static void DrawItems
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack,
|
2017-06-13 17:34:12 +00:00
|
|
|
const std::vector<TCPLine> &topLines,
|
2017-07-07 11:56:49 +00:00
|
|
|
const std::vector<TCPLine> &bottomLines );
|
2017-06-12 16:28:20 +00:00
|
|
|
|
2017-06-12 17:23:00 +00:00
|
|
|
static void CloseTitleDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-12 17:23:00 +00:00
|
|
|
|
2017-06-12 19:17:26 +00:00
|
|
|
static void MinimizeSyncLockDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-12 19:17:26 +00:00
|
|
|
|
2017-06-12 19:51:06 +00:00
|
|
|
static void MidiControlsDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-12 19:51:06 +00:00
|
|
|
|
2017-06-12 20:10:03 +00:00
|
|
|
template<typename TrackClass>
|
|
|
|
static void SliderDrawFunction
|
|
|
|
( LWSlider *(*Selector)
|
|
|
|
(const wxRect &sliderRect, const TrackClass *t, bool captured,
|
|
|
|
wxWindow*),
|
2017-06-25 22:15:54 +00:00
|
|
|
wxDC *dc, const wxRect &rect, const Track *pTrack,
|
|
|
|
bool captured, bool highlight );
|
2017-06-12 20:10:03 +00:00
|
|
|
|
|
|
|
static void PanSliderDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-12 20:10:03 +00:00
|
|
|
|
|
|
|
static void GainSliderDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-12 20:10:03 +00:00
|
|
|
|
|
|
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
|
|
|
static void VelocitySliderDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-12 20:10:03 +00:00
|
|
|
#endif
|
|
|
|
|
2017-06-13 12:02:44 +00:00
|
|
|
static void MuteOrSoloDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( wxDC *dc, const wxRect &rect, const Track *pTrack, bool down,
|
2017-06-22 03:16:46 +00:00
|
|
|
bool captured, bool solo, bool hit );
|
2017-06-13 12:02:44 +00:00
|
|
|
|
|
|
|
static void WideMuteDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-13 12:02:44 +00:00
|
|
|
|
|
|
|
static void WideSoloDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-13 12:02:44 +00:00
|
|
|
|
|
|
|
static void MuteAndSoloDrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-13 12:02:44 +00:00
|
|
|
|
2017-06-13 13:14:58 +00:00
|
|
|
static void StatusDrawFunction
|
|
|
|
( const wxString &string, wxDC *dc, const wxRect &rect );
|
|
|
|
|
|
|
|
static void Status1DrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-13 13:14:58 +00:00
|
|
|
|
|
|
|
static void Status2DrawFunction
|
2017-07-07 11:56:49 +00:00
|
|
|
( TrackPanelDrawingContext &context,
|
|
|
|
const wxRect &rect, const Track *pTrack );
|
2017-06-13 13:14:58 +00:00
|
|
|
|
2015-07-07 03:12:16 +00:00
|
|
|
public:
|
Fix for bug #949
This removes the TrackInfo's slider "cache".
Originally, the cache would build to the maximum number of tracks you
had created in an Audacity session. So, if you created 128 tracks
and then reduced that to 1, you'd still have 256 sliders, 1 gain and
1 pan per track.
But, the only real thing the cache did was prevent continuous allocations
of sliders since the allocated sliders position and values wer still
being updated nearly with ever interaction since they were redrawn each
time.
In April 2010, the slider cache was changed to reduce its size by
creating a sort of ring buffer based on how many tracks were displayed
and how many tracks were in the project (I guess). Unfortunately, it
didn't really handle large number of tracks and this bug was born.
While trying to find the proper fix for this, I realized that the
cache really wasn't saving anything. Maybe a little when dragging
the thumb, but during normal track redraws and interaction, it really
didn't serve a purpose, other than use additional memory.
So, I've removed the cache and have allocated a single gain and a
single pan slider. As before, their position and value are changed
as needed when drawn and manipulated.
2015-05-25 03:54:10 +00:00
|
|
|
int GetTrackInfoWidth() const;
|
2017-06-12 19:02:28 +00:00
|
|
|
static void SetTrackInfoFont(wxDC *dc);
|
Fix for bug #949
This removes the TrackInfo's slider "cache".
Originally, the cache would build to the maximum number of tracks you
had created in an Audacity session. So, if you created 128 tracks
and then reduced that to 1, you'd still have 256 sliders, 1 gain and
1 pan per track.
But, the only real thing the cache did was prevent continuous allocations
of sliders since the allocated sliders position and values wer still
being updated nearly with ever interaction since they were redrawn each
time.
In April 2010, the slider cache was changed to reduce its size by
creating a sort of ring buffer based on how many tracks were displayed
and how many tracks were in the project (I guess). Unfortunately, it
didn't really handle large number of tracks and this bug was born.
While trying to find the proper fix for this, I realized that the
cache really wasn't saving anything. Maybe a little when dragging
the thumb, but during normal track redraws and interaction, it really
didn't serve a purpose, other than use additional memory.
So, I've removed the cache and have allocated a single gain and a
single pan slider. As before, their position and value are changed
as needed when drawn and manipulated.
2015-05-25 03:54:10 +00:00
|
|
|
|
2017-04-02 22:07:13 +00:00
|
|
|
|
2015-08-03 17:49:53 +00:00
|
|
|
void DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected, bool bHasMuteSolo, const int labelw, const int vrul) const;
|
2017-06-05 16:47:29 +00:00
|
|
|
void DrawBordersWithin(wxDC * dc, const wxRect & rect, const Track &track ) const;
|
(Sync-Lock)
Commented out the one call to TrackInfo::DrawBordersWithin(). This eliminates all the dark lines within the TrackInfo, in an effort to make the sync-lock icon not look like a button. It leaves some lighter borders, and I think that's an aesthetic improvement, though it make be worse in terms of accessibility. I can also remove the light border above the sync-lock icon, but I think this looks best overall.
In Track::IsSyncLockSelected(), for the "// Not in a sync-locked group." conditional, it returned true if the track was selected. I made it do so only if track kind is Wave or Label. Among other things, this means Time and Note tracks will never show the sync-lock icon. I think this is correct by definition, but Al, please let me know if this will have negative repercussions elsewhere. There are *lots* of calls to that method and I can move the track-type check to the code that draws the sync-lock icon..
Fixed the bug Gale pointed out where, if a WaveTrack is shrunk such that the sync-lock icon is over a TrackInfo control, such as pan slider, it didn't intercept the mouse event, and passed it on to the control. Now, clicking on the sync-lock icon does nothing.
Fixed a bug where the sync-lock icon was redrawn dark when the minimize button is down. Now not redrawn at all in that case.
Added some clarifying comments, especially about the term "Label" as used in TrackPanel.*.
2010-09-09 00:46:40 +00:00
|
|
|
|
2017-06-12 17:39:23 +00:00
|
|
|
static void GetCloseBoxHorizontalBounds( const wxRect & rect, wxRect &dest );
|
2017-06-12 17:33:07 +00:00
|
|
|
static void GetCloseBoxRect(const wxRect & rect, wxRect &dest);
|
2017-06-12 17:39:23 +00:00
|
|
|
|
|
|
|
static void GetTitleBarHorizontalBounds( const wxRect & rect, wxRect &dest );
|
2017-06-12 17:33:07 +00:00
|
|
|
static void GetTitleBarRect(const wxRect & rect, wxRect &dest);
|
2017-06-12 17:39:23 +00:00
|
|
|
|
|
|
|
static void GetNarrowMuteHorizontalBounds
|
|
|
|
( const wxRect & rect, wxRect &dest );
|
|
|
|
static void GetNarrowSoloHorizontalBounds
|
|
|
|
( const wxRect & rect, wxRect &dest );
|
|
|
|
static void GetWideMuteSoloHorizontalBounds
|
|
|
|
( const wxRect & rect, wxRect &dest );
|
|
|
|
static void GetMuteSoloRect
|
|
|
|
(const wxRect & rect, wxRect &dest, bool solo, bool bHasSoloButton,
|
|
|
|
const Track *pTrack);
|
|
|
|
|
|
|
|
static void GetSliderHorizontalBounds( const wxPoint &topleft, wxRect &dest );
|
|
|
|
|
2017-06-12 17:33:07 +00:00
|
|
|
static void GetGainRect(const wxPoint & topLeft, wxRect &dest);
|
2017-06-12 17:39:23 +00:00
|
|
|
|
2017-06-12 17:33:07 +00:00
|
|
|
static void GetPanRect(const wxPoint & topLeft, wxRect &dest);
|
2017-06-12 17:39:23 +00:00
|
|
|
|
2017-02-22 02:05:35 +00:00
|
|
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
2017-06-12 17:33:07 +00:00
|
|
|
static void GetVelocityRect(const wxPoint & topLeft, wxRect &dest);
|
2017-02-22 02:05:35 +00:00
|
|
|
#endif
|
2017-06-12 17:39:23 +00:00
|
|
|
|
|
|
|
static void GetMinimizeHorizontalBounds( const wxRect &rect, wxRect &dest );
|
2017-06-12 17:33:07 +00:00
|
|
|
static void GetMinimizeRect(const wxRect & rect, wxRect &dest);
|
2017-06-12 17:39:23 +00:00
|
|
|
|
|
|
|
static void GetSyncLockHorizontalBounds( const wxRect &rect, wxRect &dest );
|
2017-06-12 17:33:07 +00:00
|
|
|
static void GetSyncLockIconRect(const wxRect & rect, wxRect &dest);
|
2017-06-12 17:39:23 +00:00
|
|
|
|
2017-03-28 18:29:40 +00:00
|
|
|
#ifdef USE_MIDI
|
2017-06-12 17:39:23 +00:00
|
|
|
static void GetMidiControlsHorizontalBounds
|
|
|
|
( const wxRect &rect, wxRect &dest );
|
2017-06-12 17:33:07 +00:00
|
|
|
static void GetMidiControlsRect(const wxRect & rect, wxRect &dest);
|
2017-03-28 18:29:40 +00:00
|
|
|
#endif
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-07 14:39:47 +00:00
|
|
|
static bool HideTopItem( const wxRect &rect, const wxRect &subRect,
|
|
|
|
int allowance = 0 );
|
|
|
|
|
2017-06-07 01:40:58 +00:00
|
|
|
static unsigned DefaultNoteTrackHeight();
|
2017-06-07 02:37:24 +00:00
|
|
|
static unsigned DefaultWaveTrackHeight();
|
2017-06-07 01:40:58 +00:00
|
|
|
|
2017-06-12 20:54:12 +00:00
|
|
|
static LWSlider * GainSlider
|
|
|
|
(const wxRect &sliderRect, const WaveTrack *t, bool captured,
|
|
|
|
wxWindow *pParent);
|
|
|
|
static LWSlider * PanSlider
|
|
|
|
(const wxRect &sliderRect, const WaveTrack *t, bool captured,
|
|
|
|
wxWindow *pParent);
|
2010-04-21 05:03:24 +00:00
|
|
|
|
2016-04-09 19:10:05 +00:00
|
|
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
2017-06-12 20:54:12 +00:00
|
|
|
static LWSlider * VelocitySlider
|
|
|
|
(const wxRect &sliderRect, const NoteTrack *t, bool captured,
|
|
|
|
wxWindow *pParent);
|
2016-04-09 19:10:05 +00:00
|
|
|
#endif
|
|
|
|
|
Fix for bug #949
This removes the TrackInfo's slider "cache".
Originally, the cache would build to the maximum number of tracks you
had created in an Audacity session. So, if you created 128 tracks
and then reduced that to 1, you'd still have 256 sliders, 1 gain and
1 pan per track.
But, the only real thing the cache did was prevent continuous allocations
of sliders since the allocated sliders position and values wer still
being updated nearly with ever interaction since they were redrawn each
time.
In April 2010, the slider cache was changed to reduce its size by
creating a sort of ring buffer based on how many tracks were displayed
and how many tracks were in the project (I guess). Unfortunately, it
didn't really handle large number of tracks and this bug was born.
While trying to find the proper fix for this, I realized that the
cache really wasn't saving anything. Maybe a little when dragging
the thumb, but during normal track redraws and interaction, it really
didn't serve a purpose, other than use additional memory.
So, I've removed the cache and have allocated a single gain and a
single pan slider. As before, their position and value are changed
as needed when drawn and manipulated.
2015-05-25 03:54:10 +00:00
|
|
|
private:
|
2016-05-01 21:55:48 +00:00
|
|
|
void UpdatePrefs();
|
|
|
|
|
Fix for bug #949
This removes the TrackInfo's slider "cache".
Originally, the cache would build to the maximum number of tracks you
had created in an Audacity session. So, if you created 128 tracks
and then reduced that to 1, you'd still have 256 sliders, 1 gain and
1 pan per track.
But, the only real thing the cache did was prevent continuous allocations
of sliders since the allocated sliders position and values wer still
being updated nearly with ever interaction since they were redrawn each
time.
In April 2010, the slider cache was changed to reduce its size by
creating a sort of ring buffer based on how many tracks were displayed
and how many tracks were in the project (I guess). Unfortunately, it
didn't really handle large number of tracks and this bug was born.
While trying to find the proper fix for this, I realized that the
cache really wasn't saving anything. Maybe a little when dragging
the thumb, but during normal track redraws and interaction, it really
didn't serve a purpose, other than use additional memory.
So, I've removed the cache and have allocated a single gain and a
single pan slider. As before, their position and value are changed
as needed when drawn and manipulated.
2015-05-25 03:54:10 +00:00
|
|
|
TrackPanel * pParent;
|
2017-06-12 19:02:28 +00:00
|
|
|
static wxFont gFont;
|
2017-06-14 15:12:07 +00:00
|
|
|
// These are on separate lines to work around an MSVC 2013 compiler bug.
|
|
|
|
static std::unique_ptr<LWSlider> gGainCaptured;
|
|
|
|
static std::unique_ptr<LWSlider> gPanCaptured;
|
|
|
|
static std::unique_ptr<LWSlider> gGain;
|
|
|
|
static std::unique_ptr<LWSlider> gPan;
|
2017-02-22 02:05:35 +00:00
|
|
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
2017-06-14 15:12:07 +00:00
|
|
|
static std::unique_ptr<LWSlider> gVelocityCaptured;
|
|
|
|
static std::unique_ptr<LWSlider> gVelocity;
|
2017-02-22 02:05:35 +00:00
|
|
|
#endif
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
friend class TrackPanel;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const int DragThreshold = 3;// Anything over 3 pixels is a drag, else a click.
|
|
|
|
|
|
|
|
|
2016-05-07 17:00:48 +00:00
|
|
|
class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
TrackPanel(wxWindow * parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint & pos,
|
|
|
|
const wxSize & size,
|
2016-08-20 17:58:56 +00:00
|
|
|
const std::shared_ptr<TrackList> &tracks,
|
2010-01-23 19:44:49 +00:00
|
|
|
ViewInfo * viewInfo,
|
|
|
|
TrackPanelListener * listener,
|
|
|
|
AdornedRulerPanel * ruler );
|
|
|
|
|
|
|
|
virtual ~ TrackPanel();
|
|
|
|
|
2017-06-17 02:57:08 +00:00
|
|
|
IteratorRange< TrackPanelCellIterator > Cells();
|
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void UpdatePrefs();
|
|
|
|
void ApplyUpdatedTheme();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void OnPaint(wxPaintEvent & event);
|
|
|
|
void OnMouseEvent(wxMouseEvent & event);
|
|
|
|
void OnCaptureLost(wxMouseCaptureLostEvent & event);
|
|
|
|
void OnCaptureKey(wxCommandEvent & event);
|
|
|
|
void OnKeyDown(wxKeyEvent & event);
|
|
|
|
void OnChar(wxKeyEvent & event);
|
|
|
|
void OnKeyUp(wxKeyEvent & event);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void OnSetFocus(wxFocusEvent & event);
|
|
|
|
void OnKillFocus(wxFocusEvent & event);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void OnContextMenu(wxContextMenuEvent & event);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 19:39:38 +00:00
|
|
|
void OnPlayback(wxCommandEvent &);
|
2017-06-25 05:33:31 +00:00
|
|
|
void OnTrackListResizing(wxCommandEvent & event);
|
|
|
|
void OnTrackListDeletion(wxCommandEvent & event);
|
2017-06-16 16:39:40 +00:00
|
|
|
void UpdateViewIfNoTracks(); // Call this to update mViewInfo, etc, after track(s) removal, before Refresh().
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
double GetMostRecentXPos();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void OnIdle(wxIdleEvent & event);
|
|
|
|
void OnTimer(wxTimerEvent& event);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
int GetLeftOffset() const { return GetLabelWidth() + 1;}
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-08-21 15:49:49 +00:00
|
|
|
// Width and height, relative to upper left corner at (GetLeftOffset(), 0)
|
2015-08-21 16:02:48 +00:00
|
|
|
// Either argument may be NULL
|
2017-06-16 16:39:40 +00:00
|
|
|
void GetTracksUsableArea(int *width, int *height) const;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:36:13 +00:00
|
|
|
void Refresh
|
|
|
|
(bool eraseBackground = true, const wxRect *rect = (const wxRect *) NULL)
|
|
|
|
override;
|
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void RefreshTrack(Track *trk, bool refreshbacking = true);
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void DisplaySelection();
|
2011-11-25 20:40:26 +00:00
|
|
|
|
|
|
|
// These two are neither used nor defined as of Nov-2011
|
2017-06-16 16:39:40 +00:00
|
|
|
// void SetSelectionFormat(int iformat)
|
|
|
|
// void SetSnapTo(int snapto)
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void HandleInterruptedDrag();
|
2017-07-13 11:03:30 +00:00
|
|
|
void Uncapture( wxMouseState *pState = nullptr );
|
2017-07-16 00:13:18 +00:00
|
|
|
bool CancelDragging();
|
2017-06-16 16:39:40 +00:00
|
|
|
bool HandleEscapeKey(bool down);
|
2017-06-29 03:21:20 +00:00
|
|
|
void UpdateMouseState(const wxMouseState &state);
|
|
|
|
void HandleModifierKey();
|
2017-06-16 16:39:40 +00:00
|
|
|
void HandlePageUpKey();
|
|
|
|
void HandlePageDownKey();
|
|
|
|
AudacityProject * GetProject() const;
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void ScrollIntoView(double pos);
|
|
|
|
void ScrollIntoView(int x);
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void OnTrackMenu(Track *t = NULL);
|
|
|
|
Track * GetFirstSelectedTrack();
|
|
|
|
bool IsMouseCaptured();
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void EnsureVisible(Track * t);
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
Track *GetFocusedTrack();
|
|
|
|
void SetFocusedTrack(Track *t);
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-07-12 03:47:47 +00:00
|
|
|
void HandleCursorForPresentMouseState(bool doHit = true);
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void UpdateVRulers();
|
|
|
|
void UpdateVRuler(Track *t);
|
|
|
|
void UpdateTrackVRuler(const Track *t);
|
|
|
|
void UpdateVRulerSize();
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2015-08-21 17:22:44 +00:00
|
|
|
// Returns the time corresponding to the pixel column one past the track area
|
|
|
|
// (ignoring any fisheye)
|
2017-06-16 16:39:40 +00:00
|
|
|
double GetScreenEndTime() const;
|
2015-08-21 17:22:44 +00:00
|
|
|
|
2011-11-25 20:40:26 +00:00
|
|
|
protected:
|
2017-06-16 16:39:40 +00:00
|
|
|
bool IsAudioActive();
|
2017-06-08 21:27:41 +00:00
|
|
|
void HandleClick( const TrackPanelMouseEvent &tpmEvent );
|
2015-08-13 14:59:42 +00:00
|
|
|
|
2015-08-09 17:48:27 +00:00
|
|
|
public:
|
|
|
|
size_t GetTrackCount() const;
|
|
|
|
size_t GetSelectedTrackCount() const;
|
2015-05-19 16:30:02 +00:00
|
|
|
|
2015-06-08 13:50:43 +00:00
|
|
|
protected:
|
2017-06-16 16:39:40 +00:00
|
|
|
void UpdateSelectionDisplay();
|
2014-10-18 14:19:38 +00:00
|
|
|
|
2015-08-28 14:40:19 +00:00
|
|
|
public:
|
2017-06-16 16:39:40 +00:00
|
|
|
void UpdateAccessibility();
|
2016-10-18 14:50:42 +00:00
|
|
|
void MessageForScreenReader(const wxString& message);
|
2015-08-28 14:40:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// MM: Handle mouse wheel rotation
|
2017-06-08 21:27:41 +00:00
|
|
|
void HandleWheelRotation( TrackPanelMouseEvent &tpmEvent );
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void MakeParentRedrawScrollbars();
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2015-07-07 03:12:16 +00:00
|
|
|
protected:
|
2017-06-16 16:39:40 +00:00
|
|
|
void MakeParentModifyState(bool bWantsAutoSave); // if true, writes auto-save file. Should set only if you really want the state change restored after
|
2013-12-30 00:41:18 +00:00
|
|
|
// a crash, as it can take many seconds for large (eg. 10 track-hours) projects
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
// Find track info by coordinate
|
2017-01-10 20:53:19 +00:00
|
|
|
struct FoundCell {
|
2017-06-26 20:53:12 +00:00
|
|
|
std::shared_ptr<Track> pTrack;
|
|
|
|
std::shared_ptr<TrackPanelCell> pCell;
|
2017-01-10 20:53:19 +00:00
|
|
|
wxRect rect;
|
|
|
|
};
|
2017-06-16 16:39:40 +00:00
|
|
|
FoundCell FindCell(int mouseX, int mouseY);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-07-12 03:47:47 +00:00
|
|
|
void HandleMotion( wxMouseState &state, bool doHit = true );
|
|
|
|
void HandleMotion
|
|
|
|
( const TrackPanelMouseState &tpmState, bool doHit = true );
|
2017-06-08 21:27:41 +00:00
|
|
|
|
2017-06-04 14:55:46 +00:00
|
|
|
// If label, rectangle includes track control panel only.
|
|
|
|
// If !label, rectangle includes all of that, and the vertical ruler, and
|
|
|
|
// the proper track area.
|
2017-06-16 16:39:40 +00:00
|
|
|
wxRect FindTrackRect( const Track * target, bool label );
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
int GetVRulerWidth() const;
|
|
|
|
int GetVRulerOffset() const { return mTrackInfo.GetTrackInfoWidth(); }
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
int GetLabelWidth() const { return mTrackInfo.GetTrackInfoWidth() + GetVRulerWidth(); }
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2011-11-25 20:40:26 +00:00
|
|
|
// JKC Nov-2011: These four functions only used from within a dll such as mod-track-panel
|
|
|
|
// They work around some messy problems with constructors.
|
|
|
|
public:
|
2015-08-09 17:48:27 +00:00
|
|
|
const TrackList * GetTracks() const { return mTracks.get(); }
|
|
|
|
TrackList * GetTracks() { return mTracks.get(); }
|
2015-04-19 21:12:06 +00:00
|
|
|
ViewInfo * GetViewInfo(){ return mViewInfo;}
|
|
|
|
TrackPanelListener * GetListener(){ return mListener;}
|
|
|
|
AdornedRulerPanel * GetRuler(){ return mRuler;}
|
2016-02-13 15:43:16 +00:00
|
|
|
// JKC and here is a factory function which just does 'NEW' in standard Audacity.
|
2016-02-14 07:54:25 +00:00
|
|
|
// Precondition: parent != NULL
|
2011-11-25 20:40:26 +00:00
|
|
|
static TrackPanel *(*FactoryFunction)(wxWindow * parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint & pos,
|
|
|
|
const wxSize & size,
|
2016-08-20 17:58:56 +00:00
|
|
|
const std::shared_ptr<TrackList> &tracks,
|
2011-11-25 20:40:26 +00:00
|
|
|
ViewInfo * viewInfo,
|
|
|
|
TrackPanelListener * listener,
|
|
|
|
AdornedRulerPanel * ruler);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2011-11-25 20:40:26 +00:00
|
|
|
protected:
|
2017-06-16 16:39:40 +00:00
|
|
|
void DrawTracks(wxDC * dc);
|
2011-11-25 20:40:26 +00:00
|
|
|
|
2017-06-23 23:28:38 +00:00
|
|
|
void DrawEverythingElse(TrackPanelDrawingContext &context,
|
|
|
|
const wxRegion & region,
|
2015-04-23 16:30:38 +00:00
|
|
|
const wxRect & clip);
|
2017-06-23 23:28:38 +00:00
|
|
|
void DrawOutside
|
|
|
|
(TrackPanelDrawingContext &context,
|
2017-07-11 18:16:58 +00:00
|
|
|
Track *t, const wxRect & rec);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-16 16:39:40 +00:00
|
|
|
void HighlightFocusedTrack (wxDC* dc, const wxRect &rect);
|
|
|
|
void DrawShadow (Track *t, wxDC* dc, const wxRect & rect);
|
|
|
|
void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect & rect, const int labelw, const int vrul);
|
2017-06-23 23:28:38 +00:00
|
|
|
void DrawOutsideOfTrack
|
|
|
|
(TrackPanelDrawingContext &context,
|
2017-07-11 18:16:58 +00:00
|
|
|
Track *t, const wxRect & rect);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-07-07 03:12:16 +00:00
|
|
|
public:
|
|
|
|
// Set the object that performs catch-all event handling when the pointer
|
|
|
|
// is not in any track or ruler or control panel.
|
2017-06-16 16:39:40 +00:00
|
|
|
void SetBackgroundCell
|
2015-07-07 03:12:16 +00:00
|
|
|
(const std::shared_ptr< TrackPanelCell > &pCell);
|
2017-06-17 05:26:36 +00:00
|
|
|
std::shared_ptr< TrackPanelCell > GetBackgroundCell();
|
2015-07-07 03:12:16 +00:00
|
|
|
|
2013-05-30 23:14:25 +00:00
|
|
|
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|
|
|
|
void UpdateVirtualStereoOrder();
|
|
|
|
#endif
|
2017-06-13 12:05:17 +00:00
|
|
|
|
|
|
|
public:
|
2010-01-23 19:44:49 +00:00
|
|
|
// Accessors...
|
2017-06-13 12:05:17 +00:00
|
|
|
static bool HasSoloButton(){ return gSoloPref!=wxT("None");}
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2017-06-13 12:05:17 +00:00
|
|
|
protected:
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
TrackInfo mTrackInfo;
|
2017-06-12 20:54:12 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
LWSlider *GainSlider( const WaveTrack *wt );
|
|
|
|
LWSlider *PanSlider( const WaveTrack *wt );
|
|
|
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
|
|
|
LWSlider *VelocitySlider( const NoteTrack *nt );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
TrackInfo *GetTrackInfo() { return &mTrackInfo; }
|
|
|
|
const TrackInfo *GetTrackInfo() const { return &mTrackInfo; }
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-08-28 19:53:11 +00:00
|
|
|
protected:
|
2010-01-23 19:44:49 +00:00
|
|
|
TrackPanelListener *mListener;
|
|
|
|
|
2016-08-20 17:58:56 +00:00
|
|
|
std::shared_ptr<TrackList> mTracks;
|
2010-01-23 19:44:49 +00:00
|
|
|
ViewInfo *mViewInfo;
|
|
|
|
|
|
|
|
AdornedRulerPanel *mRuler;
|
|
|
|
|
2016-08-03 01:25:05 +00:00
|
|
|
std::unique_ptr<TrackArtist> mTrackArtist;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-02-24 06:06:39 +00:00
|
|
|
class AUDACITY_DLL_API AudacityTimer final : public wxTimer {
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
2016-02-24 06:06:47 +00:00
|
|
|
void Notify() override{
|
2015-08-26 03:50:23 +00:00
|
|
|
// (From Debian)
|
|
|
|
//
|
|
|
|
// Don't call parent->OnTimer(..) directly here, but instead post
|
|
|
|
// an event. This ensures that this is a pure wxWidgets event
|
|
|
|
// (no GDK event behind it) and that it therefore isn't processed
|
|
|
|
// within the YieldFor(..) of the clipboard operations (workaround
|
|
|
|
// for Debian bug #765341).
|
2016-08-08 13:54:53 +00:00
|
|
|
// QueueEvent() will take ownership of the event
|
|
|
|
parent->GetEventHandler()->QueueEvent(safenew wxTimerEvent(*this));
|
2015-08-26 03:50:23 +00:00
|
|
|
}
|
2010-01-23 19:44:49 +00:00
|
|
|
TrackPanel *parent;
|
|
|
|
} mTimer;
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
int mTimeCount;
|
|
|
|
|
|
|
|
bool mRefreshBacking;
|
|
|
|
|
2014-10-18 14:19:38 +00:00
|
|
|
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
2014-11-29 16:53:28 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2014-10-18 14:19:38 +00:00
|
|
|
#endif
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
bool mRedrawAfterStop;
|
|
|
|
|
2017-06-29 03:21:20 +00:00
|
|
|
wxMouseState mLastMouseState;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
int mMouseMostRecentX;
|
|
|
|
int mMouseMostRecentY;
|
|
|
|
|
|
|
|
friend class TrackPanelAx;
|
|
|
|
|
2016-08-03 01:24:53 +00:00
|
|
|
#if wxUSE_ACCESSIBILITY
|
|
|
|
TrackPanelAx *mAx{};
|
|
|
|
#else
|
|
|
|
std::unique_ptr<TrackPanelAx> mAx;
|
|
|
|
#endif
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-08-25 17:35:32 +00:00
|
|
|
public:
|
|
|
|
TrackPanelAx &GetAx() { return *mAx; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2017-06-13 12:05:17 +00:00
|
|
|
static wxString gSoloPref;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
// The screenshot class needs to access internals
|
|
|
|
friend class ScreenshotCommand;
|
|
|
|
|
2016-05-23 21:56:06 +00:00
|
|
|
SelectedRegion mLastDrawnSelectedRegion {};
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
|
|
|
wxSize vrulerSize;
|
|
|
|
|
2015-07-07 03:12:16 +00:00
|
|
|
protected:
|
2017-06-18 01:37:41 +00:00
|
|
|
std::weak_ptr<TrackPanelCell> mLastCell;
|
2017-07-12 03:47:47 +00:00
|
|
|
std::vector<UIHandlePtr> mTargets;
|
|
|
|
size_t mTarget {};
|
2017-06-18 01:37:41 +00:00
|
|
|
unsigned mMouseOverUpdateFlags{};
|
|
|
|
|
|
|
|
public:
|
2017-07-04 04:48:09 +00:00
|
|
|
UIHandlePtr Target()
|
2017-06-18 01:37:41 +00:00
|
|
|
{
|
2017-07-12 03:47:47 +00:00
|
|
|
if (mTargets.size())
|
|
|
|
return mTargets[mTarget];
|
|
|
|
else
|
|
|
|
return {};
|
2017-06-18 01:37:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void ClearTargets()
|
|
|
|
{
|
|
|
|
// Forget the rotation of hit test candidates when the mouse moves from
|
|
|
|
// cell to cell or outside of the TrackPanel entirely.
|
|
|
|
mLastCell.reset();
|
2017-07-12 03:47:47 +00:00
|
|
|
mTargets.clear();
|
|
|
|
mTarget = 0;
|
2017-06-18 01:37:41 +00:00
|
|
|
mMouseOverUpdateFlags = 0;
|
|
|
|
}
|
|
|
|
|
2017-07-12 17:56:16 +00:00
|
|
|
bool HasRotation();
|
2017-07-16 00:13:18 +00:00
|
|
|
bool HasEscape();
|
2017-07-12 03:47:47 +00:00
|
|
|
|
2017-07-16 00:13:18 +00:00
|
|
|
bool ChangeTarget(bool forward, bool cycle);
|
2017-07-12 03:47:47 +00:00
|
|
|
|
2017-06-27 18:35:30 +00:00
|
|
|
std::weak_ptr<Track> mpClickedTrack;
|
Changed lifetime management of UIHandle objects, no singletons...
... Rather, construct them during hit tests (also capturing more state sooner
rather than at Click time, and adding some accessors for later use)
This also fixes bug 1677 by other means and avoids similar problems.
A cell may be implemented to re-use a previously hit handle object, not yet
clicked, in a later hit test, by remembering a weak pointer, but TrackPanel
holds the strong pointers that determine when the object is destroyed.
And the objects will surely be destroyed after drag-release, or ESC key.
For now they are also destroyed whenever not dragging, and hit-testing is
re-invoked; that will be changed later, so that the re-use mentioned above
becomes effective, but still they will be destroyed when the pointer moves
from one cell to another.
2017-07-05 20:45:55 +00:00
|
|
|
UIHandlePtr mUIHandle;
|
2015-07-07 03:12:16 +00:00
|
|
|
|
|
|
|
std::shared_ptr<TrackPanelCell> mpBackground;
|
|
|
|
|
2017-07-13 12:09:39 +00:00
|
|
|
bool mEnableTab{};
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2016-04-27 22:39:47 +00:00
|
|
|
// See big pictorial comment in TrackPanel for explanation of these numbers
|
|
|
|
enum : int {
|
|
|
|
kLeftInset = 4,
|
|
|
|
kRightInset = kLeftInset,
|
|
|
|
kTopInset = 4,
|
|
|
|
kShadowThickness = 1,
|
|
|
|
kBorderThickness = 1,
|
|
|
|
kTopMargin = kTopInset + kBorderThickness,
|
|
|
|
kBottomMargin = kShadowThickness + kBorderThickness,
|
|
|
|
kLeftMargin = kLeftInset + kBorderThickness,
|
|
|
|
kRightMargin = kRightInset + kShadowThickness + kBorderThickness,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum : int {
|
|
|
|
kTrackInfoWidth = 100,
|
2017-06-05 00:13:48 +00:00
|
|
|
kTrackInfoBtnSize = 18, // widely used dimension, usually height
|
|
|
|
kTrackInfoSliderHeight = 25,
|
2017-06-06 15:24:03 +00:00
|
|
|
kTrackInfoSliderWidth = 84,
|
2017-06-07 01:19:57 +00:00
|
|
|
kTrackInfoSliderAllowance = 5,
|
2017-06-07 01:40:58 +00:00
|
|
|
kTrackInfoSliderExtra = 5,
|
2016-04-27 22:39:47 +00:00
|
|
|
};
|
|
|
|
|
2017-03-28 18:29:40 +00:00
|
|
|
#ifdef USE_MIDI
|
|
|
|
enum : int {
|
|
|
|
kMidiCellWidth = (kTrackInfoWidth / 4) - 2,
|
|
|
|
kMidiCellHeight = kTrackInfoBtnSize
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2011-11-25 20:40:26 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning( pop )
|
|
|
|
#endif
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
#endif
|