Some "cast to pointer from integer of different size" warnings removed.
[AROS-Contrib.git] / MultiMedia / radium / common / undo_notes.c
blob4a5776c151bfe92b9fc55d62bea199d3bfa8704f
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. */
22 #include "nsmtracker.h"
23 #include "undo.h"
24 #include "placement_proc.h"
25 #include "clipboard_range_copy_proc.h"
26 #include "list_proc.h"
27 #include "trackreallines_proc.h"
30 struct Undo_Notes{
31 struct Notes *notes;
32 struct Stops *stops;
36 void *Undo_Do_Notes(
37 struct Tracker_Windows *window,
38 struct WBlocks *wblock,
39 struct WTracks *wtrack,
40 int realline,
41 void *pointer
44 void Undo_Notes(
45 struct Tracker_Windows *window,
46 struct Blocks *block,
47 struct Tracks *track,
48 int realline
50 Place *p1=PlaceGetFirstPos();
51 Place p2;
52 struct Undo_Notes *undo_notes=talloc(sizeof(struct Undo_Notes));
54 PlaceSetLastPos(block,&p2);
56 CopyRange_stops(&undo_notes->stops,track->stops,p1,&p2);
57 CopyRange_notes(&undo_notes->notes,track->notes,p1,&p2);
59 Undo_New(window->l.num,block->l.num,track->l.num,realline,undo_notes,Undo_Do_Notes);
62 void Undo_Notes_CurrPos(
63 struct Tracker_Windows *window
65 Undo_Notes(window,window->wblock->block,window->wblock->wtrack->track,window->wblock->curr_realline);
69 void *Undo_Do_Notes(
70 struct Tracker_Windows *window,
71 struct WBlocks *wblock,
72 struct WTracks *wtrack,
73 int realline,
74 void *pointer
76 struct Undo_Notes *undo_notes=(struct Undo_Notes *)pointer;
77 struct Notes *ntemp;
78 struct Stops *stemp;
80 struct Tracks *track=wtrack->track;
82 ntemp=track->notes;
83 stemp=track->stops;
85 track->notes=undo_notes->notes;
86 track->stops=undo_notes->stops;
88 undo_notes->stops=stemp;
89 undo_notes->notes=ntemp;
91 UpdateTrackReallines(window,wblock,wtrack);
93 return undo_notes;