Audacity 3.2.0
Classes | Enumerations | Functions | Variables
CommonTrackControls.cpp File Reference
#include "CommonTrackControls.h"
#include "TrackButtonHandles.h"
#include "TrackSelectHandle.h"
#include "AColor.h"
#include "../../RefreshCode.h"
#include "Project.h"
#include "ProjectHistory.h"
#include "../../ProjectWindows.h"
#include "../../TrackArtist.h"
#include "CommonTrackInfo.h"
#include "../../TrackPanelDrawingContext.h"
#include "../../TrackPanelMouseEvent.h"
#include "../../TrackUtilities.h"
#include <wx/textdlg.h>
#include "../../commands/AudacityCommand.h"
#include "CommandManager.h"
#include "ShuttleGui.h"
#include "Track.h"
#include "../../widgets/PopupMenuTable.h"
#include <wx/dc.h>
#include <wx/frame.h>
Include dependency graph for CommonTrackControls.cpp:

Go to the source code of this file.

Classes

class  TrackMenuTable
 
class  SetTrackNameCommand
 

Enumerations

enum  {
  OnSetNameID = 2000 , OnMoveUpID , OnMoveDownID , OnMoveTopID ,
  OnMoveBottomID
}
 

Functions

 AppendItem ("Name", OnSetNameID, XXO("Re&name Track..."), POPUP_MENU_FN(OnSetName))
 
 BeginSection ("Move")
 
 AppendItem ("Up", OnMoveUpID, XXO("Move Track &Up").Join(Verbatim(CommandManager::Get(mpData->project). GetKeyFromName(wxT("TrackMoveUp")).GET()), wxT("\t")), POPUP_MENU_FN(OnMoveTrack), enableIfCanMove(true))
 
 AppendItem ("Down", OnMoveDownID, XXO("Move Track &Down").Join(Verbatim(CommandManager::Get(mpData->project). GetKeyFromName(wxT("TrackMoveDown")).GET()), wxT("\t")), POPUP_MENU_FN(OnMoveTrack), enableIfCanMove(false))
 
 AppendItem ("Top", OnMoveTopID, XXO("Move Track to &Top").Join(Verbatim(CommandManager::Get(mpData->project). GetKeyFromName(wxT("TrackMoveTop")).GET()), wxT("\t")), POPUP_MENU_FN(OnMoveTrack), enableIfCanMove(true))
 
 AppendItem ("Bottom", OnMoveBottomID, XXO("Move Track to &Bottom").Join(Verbatim(CommandManager::Get(mpData->project). GetKeyFromName(wxT("TrackMoveBottom")).GET()), wxT("\t")), POPUP_MENU_FN(OnMoveTrack), enableIfCanMove(false))
 
 EndSection ()
 

Variables

static const auto enableIfCanMove
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OnSetNameID 
OnMoveUpID 
OnMoveDownID 
OnMoveTopID 
OnMoveBottomID 

Definition at line 69 of file CommonTrackControls.cpp.

70{
71 OnSetNameID = 2000,
76};
@ OnMoveBottomID
@ OnSetNameID
@ OnMoveDownID
@ OnMoveTopID
@ OnMoveUpID

Function Documentation

◆ AppendItem() [1/5]

AppendItem ( "Bottom"  ,
OnMoveBottomID  ,
XXO("Move Track to &Bottom").Join(Verbatim(CommandManager::Get(mpData->project). GetKeyFromName(wxT("TrackMoveBottom")).GET()), wxT("\t"))  ,
POPUP_MENU_FN(OnMoveTrack)  ,
enableIfCanMove(false)   
)

◆ AppendItem() [2/5]

AppendItem ( "Down"  ,
OnMoveDownID  ,
XXO("Move Track &Down").Join(Verbatim(CommandManager::Get(mpData->project). GetKeyFromName(wxT("TrackMoveDown")).GET()), wxT("\t"))  ,
POPUP_MENU_FN(OnMoveTrack)  ,
enableIfCanMove(false)   
)

◆ AppendItem() [3/5]

AppendItem ( "Name"  ,
OnSetNameID  ,
XXO("Re&name Track...")  ,
POPUP_MENU_FN(OnSetName)   
)

◆ AppendItem() [4/5]

AppendItem ( "Top"  ,
OnMoveTopID  ,
XXO("Move Track to &Top").Join(Verbatim(CommandManager::Get(mpData->project). GetKeyFromName(wxT("TrackMoveTop")).GET()), wxT("\t"))  ,
POPUP_MENU_FN(OnMoveTrack)  ,
enableIfCanMove(true)   
)

◆ AppendItem() [5/5]

AppendItem ( "Up"  ,
OnMoveUpID  ,
XXO("Move Track &Up").Join(Verbatim(CommandManager::Get(mpData->project). GetKeyFromName(wxT("TrackMoveUp")).GET()), wxT("\t"))  ,
POPUP_MENU_FN(OnMoveTrack)  ,
enableIfCanMove(true)   
)

◆ BeginSection()

BeginSection ( "Move"  )

◆ EndSection()

EndSection ( )

Variable Documentation

◆ enableIfCanMove

const auto enableIfCanMove
static
Initial value:
= [](bool up){ return
[up]( PopupMenuHandler &handler, wxMenu &menu, int id ){
auto pData = static_cast<TrackMenuTable&>( handler ).mpData;
const auto &tracks = TrackList::Get( pData->project );
auto &track = pData->track;
menu.Enable(id,
up ? tracks.CanMoveUp(track) : tracks.CanMoveDown(track));
};
}
const auto tracks
int id
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314

Definition at line 117 of file CommonTrackControls.cpp.