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 "../../TrackInfo.h"
#include "../../TrackPanelDrawingContext.h"
#include "../../TrackPanelMouseEvent.h"
#include "../../TrackUtilities.h"
#include <wx/textdlg.h>
#include "../../commands/AudacityCommand.h"
#include "../../commands/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

 BeginSection ("Basic")
 
 AppendItem ("Name", OnSetNameID, XXO("&Name..."), POPUP_MENU_FN(OnSetName))
 
 EndSection ()
 
 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))
 

Variables

static const auto enableIfCanMove
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OnSetNameID 
OnMoveUpID 
OnMoveDownID 
OnMoveTopID 
OnMoveBottomID 

Definition at line 73 of file CommonTrackControls.cpp.

74{
75 OnSetNameID = 2000,
80};
@ 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("&Name...")  ,
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() [1/2]

BeginSection ( "Basic"  )

◆ BeginSection() [2/2]

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 );
Track *const pTrack = pData->pTrack;
menu.Enable( id,
up ? tracks.CanMoveUp(pTrack) : tracks.CanMoveDown(pTrack) );
};
}
int id
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:225
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:467

Definition at line 121 of file CommonTrackControls.cpp.