1 #pragma once
2 
3 #ifndef FILMSTRIPCOMMAND_H
4 #define FILMSTRIPCOMMAND_H
5 
6 #include "tcommon.h"
7 #include "tfilepath.h"
8 
9 #include <set>
10 
11 class TXshSimpleLevel;
12 class TXshLevel;
13 class TXshPaletteLevel;
14 class TXshSoundLevel;
15 
16 //=============================================================================
17 // FilmStripCmd namespace
18 //-----------------------------------------------------------------------------
19 
20 namespace FilmstripCmd {
21 void addFrames(TXshSimpleLevel *sl, int start, int end, int step);
22 
23 void renumber(TXshSimpleLevel *sl, std::set<TFrameId> &frames, int startFrame,
24               int stepFrame);
25 void renumber(TXshSimpleLevel *sl,
26               const std::vector<std::pair<TFrameId, TFrameId>> &table,
27               bool forceCallUpdateXSheet = false);
28 
29 void copy(TXshSimpleLevel *sl, std::set<TFrameId> &frames);
30 void paste(TXshSimpleLevel *sl, std::set<TFrameId> &frames);
31 void merge(TXshSimpleLevel *sl, std::set<TFrameId> &frames);
32 void pasteInto(TXshSimpleLevel *sl, std::set<TFrameId> &frames);
33 void cut(TXshSimpleLevel *sl, std::set<TFrameId> &frames);
34 void clear(TXshSimpleLevel *sl, std::set<TFrameId> &frames);
35 void insert(TXshSimpleLevel *sl, const std::set<TFrameId> &frames,
36             bool withUndo);
37 
38 void reverse(TXshSimpleLevel *sl, std::set<TFrameId> &frames);
39 void swing(TXshSimpleLevel *sl, std::set<TFrameId> &frames);
40 void step(TXshSimpleLevel *sl, std::set<TFrameId> &frames, int step);
41 void each(TXshSimpleLevel *sl, std::set<TFrameId> &frames, int each);
42 
43 void duplicateFrameWithoutUndo(TXshSimpleLevel *sl, TFrameId srcFrame,
44                                TFrameId targetFrame);
45 void duplicate(TXshSimpleLevel *sl, std::set<TFrameId> &frames, bool withUndo);
46 
47 // TODO vanno spostati in un altro posto
48 void moveToScene(TXshLevel *sl, std::set<TFrameId> &frames);
49 void moveToScene(TXshSimpleLevel *sl);
50 void moveToScene(TXshPaletteLevel *pl);
51 void moveToScene(TXshSoundLevel *sl);
52 
53 enum InbetweenInterpolation { II_Linear, II_EaseIn, II_EaseOut, II_EaseInOut };
54 void inbetweenWithoutUndo(TXshSimpleLevel *sl, const TFrameId &fid0,
55                           const TFrameId &fid1,
56                           InbetweenInterpolation interpolation);
57 void inbetween(TXshSimpleLevel *sl, const TFrameId &fid0, const TFrameId &fid1,
58                InbetweenInterpolation interpolation);
59 
60 void renumberDrawing(TXshSimpleLevel *sl, const TFrameId &oldFid,
61                      const TFrameId &desiredNewFid);
62 }  // namespace FilmstripCmd
63 
64 TFrameId operator+(const TFrameId &fid, int d);
65 
66 void makeSpaceForFids(TXshSimpleLevel *sl,
67                       const std::set<TFrameId> &framesToInsert);
68 
69 #endif  // FILMSTRIPCOMMAND_H
70