1 2 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 3 4 /* 5 Rosegarden 6 A MIDI and audio sequencer and musical notation editor. 7 Copyright 2000-2021 the Rosegarden development team. 8 9 Other copyrights also apply to some parts of this work. Please 10 see the AUTHORS file and individual file headers for details. 11 12 This program is free software; you can redistribute it and/or 13 modify it under the terms of the GNU General Public License as 14 published by the Free Software Foundation; either version 2 of the 15 License, or (at your option) any later version. See the file 16 COPYING included with this distribution for more information. 17 */ 18 19 #ifndef RG_SUSTAININSERTIONCOMMAND_H 20 #define RG_SUSTAININSERTIONCOMMAND_H 21 22 #include "document/BasicCommand.h" 23 #include <QString> 24 #include "base/Event.h" 25 #include <QCoreApplication> 26 27 28 class Pedal; 29 30 31 namespace Rosegarden 32 { 33 34 class Segment; 35 class Event; 36 37 38 class SustainInsertionCommand : public BasicCommand 39 { 40 Q_DECLARE_TR_FUNCTIONS(Rosegarden::SustainInsertionCommand) 41 42 public: 43 SustainInsertionCommand(Segment &segment, 44 timeT time, 45 bool down, 46 int controllerNumber); 47 ~SustainInsertionCommand() override; 48 getGlobalName(bool down)49 static QString getGlobalName(bool down) { 50 if (down) { 51 return tr("Add Pedal &Press"); 52 } else { 53 return tr("Add Pedal &Release"); 54 } 55 } 56 57 EventSelection *getSubsequentSelection() override; getLastInsertedEvent()58 Event *getLastInsertedEvent() { return m_lastInsertedEvent; } 59 60 protected: 61 void modifySegment() override; 62 63 bool m_down; 64 int m_controllerNumber; 65 Event *m_lastInsertedEvent; 66 }; 67 68 69 70 } 71 72 #endif 73