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. */
18 #include "nsmtracker.h"
19 #include "gfx_wtext_proc.h"
20 #include "visual_proc.h"
21 #include "list_proc.h"
22 #include "gfx_wtrackheader_volpan_proc.h"
24 #include "gfx_wtrackheaders_proc.h"
28 struct Tracker_Windows
*window
,
29 struct WBlocks
*wblock
35 void UpdateWTrackHeader(
36 struct Tracker_Windows
*window
,
37 struct WBlocks
*wblock
,
38 struct WTracks
*wtrack
42 int maxwidth
=(wtrack
->notelength
*window
->fontwidth
) + wtrack
->fxwidth
;
43 maxwidth
-=window
->fontwidth
*(wtrack
->l
.num
>=10 ? wtrack
->l
.num
>=100 ? 3 : 2 : 1);
44 maxwidth
-=2*window
->fontwidth
;
45 maxwidth
/=window
->fontwidth
;
47 sprintf(temp
,"%d: %.*s",(int)wtrack
->l
.num
,maxwidth
,wtrack
->track
->patch
==NULL
? wtrack
->track
->trackname
: wtrack
->track
->patch
->name
);
55 UpdatePanSlider(window
,wblock
,wtrack
);
56 UpdateVolumeSlider(window
,wblock
,wtrack
);
58 if(wtrack
->track
->onoff
==0){
60 wtrack
->x
+2,wtrack
->y
+1,
61 wtrack
->x2
-2,wtrack
->y
+(window
->org_fontheight
*2)-1
64 wtrack
->x2
-2,wtrack
->y
+1,
65 wtrack
->x
+2,wtrack
->y
+(window
->org_fontheight
*2)-1
68 GFX_T_Line(window
,1,wtrack
->x
,wblock
->t
.y1
-1,wtrack
->x2
,wblock
->t
.y1
-1);
74 void DrawWTrackHeader(
75 struct Tracker_Windows
*window
,
76 struct WBlocks
*wblock
,
77 struct WTracks
*wtrack
82 wtrack
->x
-1,wtrack
->y
,
83 wtrack
->x2
+1,wtrack
->y
-1+(window
->org_fontheight
*2)
85 UpdateWTrackHeader(window
,wblock
,wtrack
);
91 void UpdateAllWTrackHeaders(
92 struct Tracker_Windows
*window
,
93 struct WBlocks
*wblock
95 struct WTracks
*wtrack
=ListFindElement1(&wblock
->wtracks
->l
,wblock
->left_track
);
97 while(wtrack
!=NULL
&& wtrack
->l
.num
<=wblock
->right_track
){
98 if(wtrack
->x
>=wblock
->a
.x2
){
101 UpdateWTrackHeader(window
,wblock
,wtrack
);
103 wtrack
=NextWTrack(wtrack
);
107 void DrawAllWTrackHeaders(
108 struct Tracker_Windows
*window
,
109 struct WBlocks
*wblock
111 struct WTracks
*wtrack
=ListFindElement1(&wblock
->wtracks
->l
,wblock
->left_track
);
113 while(wtrack
!=NULL
&& wtrack
->l
.num
<=wblock
->right_track
){
114 if(wtrack
->x
>=wblock
->a
.x2
){
117 DrawWTrackHeader(window
,wblock
,wtrack
);
119 wtrack
=NextWTrack(wtrack
);
124 void DrawUpAllWTrackHeaders(
125 struct Tracker_Windows
*window
,
126 struct WBlocks
*wblock
128 struct WTracks
*wtrack
=ListFindElement1(&wblock
->wtracks
->l
,wblock
->left_track
);
133 wblock
->temponodearea
.x2
+3,wtrack
->y
,
134 wblock
->a
.x2
,wtrack
->y
-1+(window
->org_fontheight
*2)
138 while(wtrack
!=NULL
&& wtrack
->l
.num
<=wblock
->right_track
){
139 if(wtrack
->x
>=wblock
->a
.x2
){
142 UpdateWTrackHeader(window
,wblock
,wtrack
);
144 wtrack
=NextWTrack(wtrack
);