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_PASTESEGMENTSCOMMAND_H
20 #define RG_PASTESEGMENTSCOMMAND_H
21 
22 #include "base/Track.h"
23 #include "document/Command.h"
24 #include <QString>
25 #include <QCoreApplication>
26 #include <vector>
27 #include "base/Event.h"
28 
29 
30 
31 
32 namespace Rosegarden
33 {
34 
35 class Segment;
36 class Composition;
37 class Clipboard;
38 
39 
40 /// Paste one or more segments from the clipboard into the composition
41 
42 class PasteSegmentsCommand : public NamedCommand
43 {
44     Q_DECLARE_TR_FUNCTIONS(Rosegarden::PasteSegmentsCommand)
45 
46 public:
47     PasteSegmentsCommand(Composition *composition,
48                          Clipboard *clipboard,
49                          timeT pasteTime,
50                          TrackId baseTrack,
51                          bool useExactTracks);
52 
53     ~PasteSegmentsCommand() override;
54 
getGlobalName()55     static QString getGlobalName() { return tr("&Paste"); }
56 
57     void execute() override;
58     void unexecute() override;
59 
60 protected:
61     Composition *m_composition;
62     Clipboard *m_clipboard;
63     timeT m_pasteTime;
64     TrackId m_baseTrack;
65     bool m_exactTracks;
66     std::vector<Segment *> m_addedSegments;
67     bool m_detached;
68     timeT m_oldEndTime;
69 };
70 
71 
72 
73 }
74 
75 #endif
76