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 269 of file MixerBoard.h.

Constructor & Destructor Documentation

◆ MixerBoardFrame()

MixerBoardFrame::MixerBoardFrame ( AudacityProject parent)

Definition at line 1408 of file MixerBoard.cpp.

1409: wxFrame( &GetProjectFrame( *parent ), -1, wxString{},
1410 wxDefaultPosition, kDefaultSize,
1411 wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT)
1412 , mProject(parent)
1413{
1416 .Subscribe([this](ProjectFileIOMessage message){
1419 });
1420
1421 mMixerBoard = safenew MixerBoard(parent, this, wxDefaultPosition, kDefaultSize);
1422
1423 this->SetSizeHints(MIXER_BOARD_MIN_WIDTH, MIXER_BOARD_MIN_HEIGHT);
1424
1426
1427 // loads either the XPM or the windows resource, depending on the platform
1428#if !defined(__WXMAC__) && !defined(__WXX11__)
1429 {
1430#ifdef __WXMSW__
1431 wxIcon ic{ wxICON(AudacityLogo) };
1432#else
1433 wxIcon ic{wxICON(AudacityLogo48x48)};
1434#endif
1435 SetIcon(ic);
1436 }
1437#endif
1438 Center();
1439}
#define safenew
Definition: MemoryX.h:9
#define MIXER_BOARD_MIN_WIDTH
Definition: MixerBoard.cpp:861
#define MIXER_BOARD_MIN_HEIGHT
Definition: MixerBoard.cpp:858
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:288
AudacityProject * mProject
Definition: MixerBoard.h:289
MixerBoard * mMixerBoard
Definition: MixerBoard.h:291
void UpdateTrackClusters()
Definition: MixerBoard.cpp:985
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 1441 of file MixerBoard.cpp.

1442{
1443}

Member Function Documentation

◆ OnCloseWindow()

void MixerBoardFrame::OnCloseWindow ( wxCloseEvent &  WXUNUSEDevent)
private

Definition at line 1447 of file MixerBoard.cpp.

1448{
1449 // Fix for bug #2175.
1450 //
1451 // If the mixerboard enters fullscreen, the main project will be
1452 // "lowered", so ensure it's visible after the mixerboard closes.
1453#if defined(__WXMAC__)
1454 dynamic_cast<wxFrame*>(GetParent())->Raise();
1455#endif
1456
1457 this->Hide();
1458}

◆ OnKeyEvent()

void MixerBoardFrame::OnKeyEvent ( wxKeyEvent &  evt)
private

Definition at line 1472 of file MixerBoard.cpp.

1473{
1474 if (auto project = mMixerBoard->mProject)
1475 MenuCreator::FilterKeyEvent(*project, event, true);
1476}
const auto project
static bool FilterKeyEvent(AudacityProject &project, const wxKeyEvent &evt, bool permit=false)
AudacityProject * mProject
Definition: MixerBoard.h:258

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 1460 of file MixerBoard.cpp.

1461{
1462 // Update the size hints to show all tracks before skipping to let default handling happen.
1464 event.Skip();
1465}
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 1467 of file MixerBoard.cpp.

1468{
1469 mMixerBoard->SetSize(this->GetClientSize());
1470}

References mMixerBoard.

◆ Recreate()

void MixerBoardFrame::Recreate ( AudacityProject pProject)

Definition at line 1478 of file MixerBoard.cpp.

1479{
1480 wxPoint pos = mMixerBoard->GetPosition();
1481 wxSize siz = mMixerBoard->GetSize();
1482 wxSize siz2 = this->GetSize();
1483
1484 //wxLogDebug("Got rid of board %p", mMixerBoard );
1485 mMixerBoard->Destroy();
1486 mMixerBoard = NULL;
1487 mMixerBoard = safenew MixerBoard(pProject, this, pos, siz);
1488 //wxLogDebug("Created NEW board %p", mMixerBoard );
1490 mMixerBoard->SetSize( siz );
1491
1492 this->SetSize( siz2 );
1494}

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

Here is the call graph for this function:

◆ SetWindowTitle()

void MixerBoardFrame::SetWindowTitle ( )
private

Definition at line 1496 of file MixerBoard.cpp.

1497{
1498 wxString name = mProject->GetProjectName();
1499 if (!name.empty())
1500 {
1501 name.Prepend(wxT(" - "));
1502 }
1503
1504 SetTitle(AudacityMixerBoardTitle.Format(name).Translation());
1505}
wxT("CloseDown"))
const TranslatableString name
Definition: Distortion.cpp:76
#define AudacityMixerBoardTitle
Definition: MixerBoard.cpp:72
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 291 of file MixerBoard.h.

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

◆ mProject

AudacityProject* MixerBoardFrame::mProject
private

Definition at line 289 of file MixerBoard.h.

Referenced by SetWindowTitle().

◆ mTitleChangeSubscription

Observer::Subscription MixerBoardFrame::mTitleChangeSubscription
private

Definition at line 288 of file MixerBoard.h.


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