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_SEGMENTERASECOMMAND_H
20 #define RG_SEGMENTERASECOMMAND_H
21 
22 #include <string>
23 #include "document/Command.h"
24 
25 #include <QCoreApplication>
26 
27 
28 namespace Rosegarden
29 {
30 
31 class Segment;
32 class Composition;
33 class AudioFileManager;
34 
35 
36 ////////////////////////////////////////////////////////////
37 
38 class SegmentEraseCommand : public NamedCommand
39 {
40     Q_DECLARE_TR_FUNCTIONS(Rosegarden::SegmentEraseCommand)
41 
42 public:
43     /// for removing segment normally
44     SegmentEraseCommand(Segment *segment);
45 
46     /// for removing audio segment when removing an audio file
47     SegmentEraseCommand(Segment *segment,
48                         AudioFileManager *mgr);
49     ~SegmentEraseCommand() override;
50 
51     void execute() override;
52     void unexecute() override;
53 
54 private:
55     Composition *m_composition;
56     Segment *m_segment;
57     AudioFileManager *m_mgr;
58     QString m_audioFileName;
59     bool m_detached;
60 };
61 
62 
63 }
64 
65 #endif
66