14#include <wx/dcclient.h>
15#include <wx/dcmemory.h>
27 wxArrayString trackNames,
28 const wxPoint& pos, const wxSize&
size):
30 , mMixerSpec{mixerSpec}
31 , mChannelRects{ mMixerSpec->GetMaxNumChannels() }
32 , mTrackRects{ mMixerSpec->GetNumTracks() }
37 mSelectedTrack = mSelectedChannel = -1;
39 mTrackNames = trackNames;
50 int l = 0, u = 13, m, w, h;
51 wxFont font = memDC.GetFont();
55 font.SetPointSize( m );
56 memDC.SetFont( font );
57 memDC.GetTextExtent( text, &w, &h );
59 if( w < width && h < height )
64 font.SetPointSize( l );
65 memDC.SetFont( font );
73 GetSize( &width, &height );
82 wxColour bkgnd = GetBackgroundColour();
83 wxBrush bkgndBrush( bkgnd, wxBRUSHSTYLE_SOLID );
95 memDC.SetBrush( *wxWHITE_BRUSH );
96 memDC.SetPen( *wxBLACK_PEN );
97 memDC.DrawRectangle( bkgndRect );
110 static double PI = 2 * acos( 0.0 );
112 double radius =
mHeight / ( 2.0 * sin(
PI - 2.0 * angle ) );
113 double totAngle = ( asin(
mHeight / ( 2.0 * radius ) ) * 2.0 );
129 cos( totAngle / 2.0 - angle * ( i + 1 ) ) -
mBoxWidth + 0.5 );
131 sin( totAngle * 0.5 - angle * ( i + 1.0 ) ) -
137 memDC.SetPen(
mSelectedTrack == (
int)i ? *wxRED_PEN : *wxBLACK_PEN );
148 angle = ( asin(
mHeight / ( 2.0 * radius ) ) * 2.0 ) /
152 memDC.GetTextExtent(
wxT(
"Channel: XX" ), &w, &h );
157 cos( totAngle * 0.5 - angle * ( i + 1 ) ) + 0.5 );
159 sin( totAngle * 0.5 - angle * ( i + 1 ) ) -
168 memDC.DrawText( wxString::Format(
_(
"Channel: %2d" ), i + 1 ),
174 memDC.SetPen( wxPen( *wxBLACK,
mHeight / 200 ) );
182 dc.Blit( 0, 0,
mWidth,
mHeight, &memDC, 0, 0, wxCOPY, FALSE );
187 return sqrt( pow( a.x - b.x, 2.0 ) + pow( a.y - b.y, 2.0 ) );
198 if( event.ButtonDown() )
203 if(
mTrackRects[ i ].Contains( event.m_x, event.m_y ) )
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static wxBrush playRegionBrush[1]
static wxBrush envelopeBrush
Panel that displays mixing for advanced mixing option.
void OnMouseEvent(wxMouseEvent &event)
MixerOptions::Downmix * mMixerSpec
void SetFont(wxMemoryDC &memDC, const wxString &text, int width, int height)
std::unique_ptr< wxBitmap > mBitmap
bool IsOnLine(wxPoint p, wxPoint la, wxPoint lb)
void OnPaint(wxPaintEvent &event)
double Distance(wxPoint &a, wxPoint &b)
ArrayOf< wxRect > mChannelRects
ArrayOf< wxRect > mTrackRects
virtual ~ExportMixerPanel()
wxArrayString mTrackNames
unsigned GetNumTracks() const
unsigned GetNumChannels() const
__finl float_x4 __vecc sqrt(const float_x4 &a)