Audacity 3.2.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
MixerBoardFrame Class Referencefinal

#include <MixerBoard.h>

Inheritance diagram for MixerBoardFrame:
[legend]
Collaboration diagram for MixerBoardFrame:
[legend]

Public Member Functions

 MixerBoardFrame (AudacityProject *parent)
 
virtual ~MixerBoardFrame ()
 
void Recreate (AudacityProject *pProject)
 
- Public Member Functions inherited from TopLevelKeystrokeHandlingWindow
virtual ~TopLevelKeystrokeHandlingWindow ()
 
virtual bool HandleCommandKeystrokes ()
 

Public Attributes

MixerBoardmMixerBoard
 

Private Member Functions

void OnCloseWindow (wxCloseEvent &WXUNUSED(event))
 
void OnMaximize (wxMaximizeEvent &event)
 
void OnSize (wxSizeEvent &evt)
 
void OnKeyEvent (wxKeyEvent &evt)
 
void SetWindowTitle ()
 

Private Attributes

Observer::Subscription mTitleChangeSubscription
 
AudacityProjectmProject
 

Detailed Description

Definition at line 276 of file MixerBoard.h.

Constructor & Destructor Documentation

◆ MixerBoardFrame()

MixerBoardFrame::MixerBoardFrame ( AudacityProject parent)

Definition at line 1429 of file MixerBoard.cpp.

1430: wxFrame( &GetProjectFrame( *parent ), -1, wxString{},
1431 wxDefaultPosition, kDefaultSize,
1432 wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT)
1433 , mProject(parent)
1434{
1437 .Subscribe([this](ProjectFileIOMessage message){
1440 });
1441
1442 mMixerBoard = safenew MixerBoard(parent, this, wxDefaultPosition, kDefaultSize);
1443
1444 this->SetSizeHints(MIXER_BOARD_MIN_WIDTH, MIXER_BOARD_MIN_HEIGHT);
1445
1447
1448 // loads either the XPM or the windows resource, depending on the platform
1449#if !defined(__WXMAC__) && !defined(__WXX11__)
1450 {
1451#ifdef __WXMSW__
1452 wxIcon ic{ wxICON(AudacityLogo) };
1453#else
1454 wxIcon ic{wxICON(AudacityLogo48x48)};
1455#endif
1456 SetIcon(ic);
1457 }
1458#endif
1459 Center();
1460}
#define safenew
Definition: MemoryX.h:9
#define MIXER_BOARD_MIN_WIDTH
Definition: MixerBoard.cpp:880
#define MIXER_BOARD_MIN_HEIGHT
Definition: MixerBoard.cpp:877
const wxSize kDefaultSize
ProjectFileIOMessage
Subscribe to ProjectFileIO to receive messages; always in idle time.
Definition: ProjectFileIO.h:50
@ ProjectTitleChange
A normal occurrence.
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Observer::Subscription mTitleChangeSubscription
Definition: MixerBoard.h:295
AudacityProject * mProject
Definition: MixerBoard.h:296
MixerBoard * mMixerBoard
Definition: MixerBoard.h:298
void UpdateTrackClusters()
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
Definition: Observer.h:199
static ProjectFileIO & Get(AudacityProject &project)

◆ ~MixerBoardFrame()

MixerBoardFrame::~MixerBoardFrame ( )
virtual

Definition at line 1462 of file MixerBoard.cpp.

1463{
1464}

Member Function Documentation

◆ OnCloseWindow()

void MixerBoardFrame::OnCloseWindow ( wxCloseEvent &  WXUNUSEDevent)
private

Definition at line 1468 of file MixerBoard.cpp.

1469{
1470 // Fix for bug #2175.
1471 //
1472 // If the mixerboard enters fullscreen, the main project will be
1473 // "lowered", so ensure it's visible after the mixerboard closes.
1474#if defined(__WXMAC__)
1475 dynamic_cast<wxFrame*>(GetParent())->Raise();
1476#endif
1477
1478 this->Hide();
1479}

◆ OnKeyEvent()

void MixerBoardFrame::OnKeyEvent ( wxKeyEvent &  evt)
private

Definition at line 1493 of file MixerBoard.cpp.

1494{
1495 if (auto project = mMixerBoard->mProject)
1496 MenuCreator::FilterKeyEvent(*project, event, true);
1497}
const auto project
static bool FilterKeyEvent(AudacityProject &project, const wxKeyEvent &evt, bool permit=false)
AudacityProject * mProject
Definition: MixerBoard.h:265

References MenuCreator::FilterKeyEvent(), mMixerBoard, MixerBoard::mProject, and project.

Here is the call graph for this function:

◆ OnMaximize()

void MixerBoardFrame::OnMaximize ( wxMaximizeEvent &  event)
private

Definition at line 1481 of file MixerBoard.cpp.

1482{
1483 // Update the size hints to show all tracks before skipping to let default handling happen.
1485 event.Skip();
1486}
void UpdateWidth()

References mMixerBoard, and MixerBoard::UpdateWidth().

Here is the call graph for this function:

◆ OnSize()

void MixerBoardFrame::OnSize ( wxSizeEvent &  evt)
private

Definition at line 1488 of file MixerBoard.cpp.

1489{
1490 mMixerBoard->SetSize(this->GetClientSize());
1491}

References mMixerBoard.

◆ Recreate()

void MixerBoardFrame::Recreate ( AudacityProject pProject)

Definition at line 1499 of file MixerBoard.cpp.

1500{
1501 wxPoint pos = mMixerBoard->GetPosition();
1502 wxSize siz = mMixerBoard->GetSize();
1503 wxSize siz2 = this->GetSize();
1504
1505 //wxLogDebug("Got rid of board %p", mMixerBoard );
1506 mMixerBoard->Destroy();
1507 mMixerBoard = NULL;
1508 mMixerBoard = safenew MixerBoard(pProject, this, pos, siz);
1509 //wxLogDebug("Created NEW board %p", mMixerBoard );
1511 mMixerBoard->SetSize( siz );
1512
1513 this->SetSize( siz2 );
1515}

References mMixerBoard, safenew, SetWindowTitle(), and MixerBoard::UpdateTrackClusters().

Here is the call graph for this function:

◆ SetWindowTitle()

void MixerBoardFrame::SetWindowTitle ( )
private

Definition at line 1517 of file MixerBoard.cpp.

1518{
1519 wxString name = mProject->GetProjectName();
1520 if (!name.empty())
1521 {
1522 name.Prepend(wxT(" - "));
1523 }
1524
1525 SetTitle(AudacityMixerBoardTitle.Format(name).Translation());
1526}
wxT("CloseDown"))
const TranslatableString name
Definition: Distortion.cpp:76
#define AudacityMixerBoardTitle
Definition: MixerBoard.cpp:71
const wxString & GetProjectName() const
Definition: Project.cpp:100

References AudacityMixerBoardTitle, TranslatableString::empty(), AudacityProject::GetProjectName(), mProject, name, and wxT().

Referenced by Recreate().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mMixerBoard

MixerBoard* MixerBoardFrame::mMixerBoard

Definition at line 298 of file MixerBoard.h.

Referenced by OnKeyEvent(), OnMaximize(), OnSize(), and Recreate().

◆ mProject

AudacityProject* MixerBoardFrame::mProject
private

Definition at line 296 of file MixerBoard.h.

Referenced by SetWindowTitle().

◆ mTitleChangeSubscription

Observer::Subscription MixerBoardFrame::mTitleChangeSubscription
private

Definition at line 295 of file MixerBoard.h.


The documentation for this class was generated from the following files: