MCPcopy Create free account
hub / github.com/LMMS/lmms / addDefaultActions

Method addDefaultActions

src/gui/AutomatableModelView.cpp:60–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59
60void AutomatableModelView::addDefaultActions( QMenu* menu )
61{
62 AutomatableModel* model = modelUntyped();
63
64 AutomatableModelViewSlots* amvSlots = new AutomatableModelViewSlots( this, menu );
65
66 menu->addAction( embed::getIconPixmap( "reload" ),
67 AutomatableModel::tr( "&Reset (%1%2)" ).
68 arg( model->displayValue( model->initValue<float>() ) ).
69 arg( m_unit ),
70 model, SLOT( reset() ) );
71
72 menu->addSeparator();
73 menu->addAction( embed::getIconPixmap( "edit_copy" ),
74 AutomatableModel::tr( "&Copy value (%1%2)" ).
75 arg( model->displayValue( model->value<float>() ) ).
76 arg( m_unit ),
77 model, SLOT( copyValue() ) );
78
79 menu->addAction( embed::getIconPixmap( "edit_paste" ),
80 AutomatableModel::tr( "&Paste value (%1%2)").
81 arg( model->displayValue( AutomatableModel::copiedValue() ) ).
82 arg( m_unit ),
83 model, SLOT( pasteValue() ) );
84
85 menu->addSeparator();
86
87 menu->addAction( embed::getIconPixmap( "automation" ),
88 AutomatableModel::tr( "Edit song-global automation" ),
89 amvSlots,
90 SLOT( editSongGlobalAutomation() ) );
91
92 menu->addAction( QPixmap(),
93 AutomatableModel::tr( "Remove song-global automation" ),
94 amvSlots,
95 SLOT( removeSongGlobalAutomation() ) );
96
97 menu->addSeparator();
98
99 if( model->hasLinkedModels() )
100 {
101 menu->addAction( embed::getIconPixmap( "edit-delete" ),
102 AutomatableModel::tr( "Remove all linked controls" ),
103 amvSlots, SLOT( unlinkAllModels() ) );
104 menu->addSeparator();
105 }
106
107 QString controllerTxt;
108 if( model->controllerConnection() )
109 {
110 Controller* cont = model->controllerConnection()->getController();
111 if( cont )
112 {
113 controllerTxt = AutomatableModel::tr( "Connected to %1" ).arg( cont->name() );
114 }
115 else
116 {
117 controllerTxt = AutomatableModel::tr( "Connected to controller" );

Callers 2

contextMenuEventMethod · 0.80
contextMenuEventMethod · 0.80

Calls 9

modelUntypedFunction · 0.85
getIconPixmapFunction · 0.85
resetFunction · 0.85
copiedValueFunction · 0.85
addActionMethod · 0.80
getControllerMethod · 0.80
QPixmapClass · 0.50
displayValueMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected