Icons for Radium and Shellplayer.
[AROS-Contrib.git] / MultiMedia / radium / common / undo_fxs.c
blob833ee8542358dbe32626b08b66b15fd6b0666dce
1 /* Copyright 2000 Kjetil S. Matheussen
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public License
5 as published by the Free Software Foundation; either version 2
6 of the License, or (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 #include "nsmtracker.h"
24 #include "undo.h"
25 #include "clipboard_range_copy_proc.h"
26 #include "fxlines_proc.h"
27 #include "placement_proc.h"
28 #include <string.h>
30 #include "undo_fxs_proc.h"
32 struct Undo_FXs{
33 struct FXs *fxs;
34 void *instrumentdata;
37 void *Undo_Do_FXs(
38 struct Tracker_Windows *window,
39 struct WBlocks *wblock,
40 struct WTracks *wtrack,
41 int realline,
42 void *pointer
45 void Undo_FXs(
46 struct Tracker_Windows *window,
47 struct Blocks *block,
48 struct Tracks *track,
49 int realline
52 Place *p1=PlaceGetFirstPos();
53 Place p2;
54 struct Undo_FXs *undo_fxs=talloc(sizeof(struct Undo_FXs));
56 PlaceSetLastPos(block,&p2);
58 CopyRange_fxs(&undo_fxs->fxs,track->fxs,p1,&p2);
59 if(track->instrumentdata!=NULL){
60 undo_fxs->instrumentdata=(*track->instrument->CopyInstrumentData)(track);
63 Undo_New(
64 window->l.num,
65 block->l.num,
66 track->l.num,
67 realline,
68 undo_fxs,
69 Undo_Do_FXs
74 void Undo_FXs_CurrPos(
75 struct Tracker_Windows *window
77 Undo_FXs(window,window->wblock->block,window->wblock->wtrack->track,window->wblock->curr_realline);
80 void *Undo_Do_FXs(
81 struct Tracker_Windows *window,
82 struct WBlocks *wblock,
83 struct WTracks *wtrack,
84 int realline,
85 void *pointer
87 struct Undo_FXs *undo_fxs=(struct Undo_FXs *)pointer;
88 struct FXs *temp;
89 void *instrumentdata;
91 struct Tracks *track=wtrack->track;
93 temp=track->fxs;
94 instrumentdata=track->instrumentdata;
96 track->fxs=undo_fxs->fxs;
97 track->instrumentdata=undo_fxs->instrumentdata;
99 UpdateFXNodeLines(window,wblock,wtrack);
101 undo_fxs->fxs=temp;
102 undo_fxs->instrumentdata=instrumentdata;
104 return undo_fxs;