~ubuntu-branches/ubuntu/feisty/muse/feisty

« back to all changes in this revision

Viewing changes to undo.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=========================================================
 
2
//  MusE
 
3
//  Linux Music Editor
 
4
//  $Id: undo.h,v 1.2 2001/11/20 15:19:32 muse Exp $
 
5
//
 
6
//  (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
 
7
//=========================================================
 
8
 
 
9
#ifndef __UNDO_H__
 
10
#define __UNDO_H__
 
11
 
 
12
#include <list>
 
13
 
 
14
class Track;
 
15
class TEvent;
 
16
class SigEvent;
 
17
class Event;
 
18
class Part;
 
19
 
 
20
//---------------------------------------------------------
 
21
//   UndoOp
 
22
//---------------------------------------------------------
 
23
 
 
24
struct UndoOp {
 
25
      enum UndoType {
 
26
            AddTrack, DeleteTrack, ModifyTrack,
 
27
            AddPart,  DeletePart,  ModifyPart,
 
28
            AddEvent, DeleteEvent, ModifyEvent,
 
29
            AddTempo, DeleteTempo,
 
30
            AddSig,
 
31
            SwapTrack, ModifyController
 
32
            };
 
33
      UndoType type;
 
34
 
 
35
      union xxx {
 
36
            struct {
 
37
                  int a;
 
38
                  int b;
 
39
                  int c;
 
40
                  } i;
 
41
            struct {
 
42
                  Track* track;
 
43
                  int trackno;
 
44
                  } t;
 
45
            struct {
 
46
                  Part* oPart;
 
47
                  Part* nPart;
 
48
                  } p;
 
49
            struct {
 
50
                  Event* oEvent;
 
51
                  Event* nEvent;
 
52
                  Part* part;
 
53
                  } e;
 
54
            struct {
 
55
                  SigEvent* nSignature;
 
56
                  SigEvent* oSignature;
 
57
                  } s;
 
58
            struct {
 
59
                  int channel;
 
60
                  int ctrl;
 
61
                  int oVal;
 
62
                  int nVal;
 
63
                  } c;
 
64
            } xxx;
 
65
      };
 
66
 
 
67
class Undo : public std::list<UndoOp> {
 
68
      void undoOp(UndoOp::UndoType, int data);
 
69
      };
 
70
 
 
71
typedef Undo::iterator iUndoOp;
 
72
typedef Undo::reverse_iterator riUndoOp;
 
73
 
 
74
class UndoList : public std::list<Undo> {
 
75
   public:
 
76
      };
 
77
 
 
78
typedef UndoList::iterator iUndo;
 
79
 
 
80
 
 
81
#endif // __UNDO_H__