Welcome to mirror list, hosted at ThFree Co, Russian Federation.

time_header.c « space_time « editors « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 65203cb7421a61f175c528a9d93a7f642390c7a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
/**
 * $Id$
 *
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version. 
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * The Original Code is Copyright (C) 2008 Blender Foundation.
 * All rights reserved.
 *
 * 
 * Contributor(s): Blender Foundation
 *
 * ***** END GPL LICENSE BLOCK *****
 */

#include <string.h>
#include <stdio.h>

#include "DNA_space_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_windowmanager_types.h"

#include "MEM_guardedalloc.h"

#include "BLI_blenlib.h"

#include "BKE_global.h"
#include "BKE_screen.h"

#include "ED_screen.h"
#include "ED_util.h"

#include "WM_api.h"
#include "WM_types.h"

#include "BIF_gl.h"
#include "BIF_glutil.h"

#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"

#include "ED_markers.h"

#include "time_intern.h"


/* ************************ header time area region *********************** */


static void do_time_redrawmenu(bContext *C, void *arg, int event)
{
	SpaceTime *stime= C->area->spacedata.first;
	
	if(event < 1001) {
		
		stime->redraws ^= event;
		/* update handler when it's running */
//		if(has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
//			start_animated_screen(stime);
	}
	else {
		if(event==1001) {
//			button(&C->scene->r.frs_sec,1,120,"FPS:");
		}
	}
}


static uiBlock *time_redrawmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
{
	ScrArea *curarea= C->area;
	SpaceTime *stime= curarea->spacedata.first;
	uiBlock *block;
	short yco= 0, menuwidth=120, icon;
	char str[32];
	
	block= uiBeginBlock(C, handle->region, "header time_redrawmenu", UI_EMBOSSP, UI_HELV);
	uiBlockSetButmFunc(block, do_time_redrawmenu, NULL);
	
	if(stime->redraws & TIME_LEFTMOST_3D_WIN) icon= ICON_CHECKBOX_HLT;
	else icon= ICON_CHECKBOX_DEHLT;
	uiDefIconTextBut(block, BUTM, 1, icon, "Top-Left 3D Window",	 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_LEFTMOST_3D_WIN, "");
	
	if(stime->redraws & TIME_ALL_3D_WIN) icon= ICON_CHECKBOX_HLT;
	else icon= ICON_CHECKBOX_DEHLT;
	uiDefIconTextBut(block, BUTM, 1, icon, "All 3D Windows",	 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_3D_WIN, "");
	
	if(stime->redraws & TIME_ALL_ANIM_WIN) icon= ICON_CHECKBOX_HLT;
	else icon= ICON_CHECKBOX_DEHLT;
	uiDefIconTextBut(block, BUTM, 1, icon, "Animation Windows",	 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_ANIM_WIN, "");
	
	if(stime->redraws & TIME_ALL_BUTS_WIN) icon= ICON_CHECKBOX_HLT;
	else icon= ICON_CHECKBOX_DEHLT;
	uiDefIconTextBut(block, BUTM, 1, icon, "Buttons Windows",	 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_BUTS_WIN, "");
	
	if(stime->redraws & TIME_ALL_IMAGE_WIN) icon= ICON_CHECKBOX_HLT;
	else icon= ICON_CHECKBOX_DEHLT;
	uiDefIconTextBut(block, BUTM, 1, icon, "Image Windows",      0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_IMAGE_WIN, "");
	
	/* Add sequencer only redraw*/
	if(stime->redraws & TIME_SEQ) icon= ICON_CHECKBOX_HLT;
	else icon= ICON_CHECKBOX_DEHLT;
	uiDefIconTextBut(block, BUTM, 1, icon, "Sequencer Windows",      0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_SEQ, "");
	
	uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
	
	sprintf(str, "Set Frames/Sec (%d/%f)", C->scene->r.frs_sec, C->scene->r.frs_sec_base);
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, str,	 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1001, "");
	
	uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
	
	if(stime->redraws & TIME_CONTINUE_PHYSICS) icon= ICON_CHECKBOX_HLT;
	else icon= ICON_CHECKBOX_DEHLT;
	uiDefIconTextBut(block, BUTM, 1, icon, "Continue Physics",      0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_CONTINUE_PHYSICS, "During playblack, continue physics simulations regardless of the frame number");
	
	
	if(curarea->headertype==HEADERTOP) {
		uiBlockSetDirection(block, UI_DOWN);
	}
	else {
		uiBlockSetDirection(block, UI_TOP);
		uiBlockFlipOrder(block);
	}
	
	uiTextBoundsBlock(block, 50);
	uiEndBlock(C, block);
	
	return block;
}

static void do_time_viewmenu(bContext *C, void *arg, int event)
{
	ScrArea *curarea= C->area;
	SpaceTime *stime= curarea->spacedata.first;
	View2D *v2d= UI_view2d_fromcontext_rwin(C);
	int first;
	
	switch(event) {
		case 2: /* Play Back Animation */
			//if(!has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
			//	start_animated_screen(stime);
			break;
		case 3: /* View All */
			if(v2d) {
				first= C->scene->r.sfra;
				if(first >= C->scene->r.efra) first= C->scene->r.efra;
					v2d->cur.xmin=v2d->tot.xmin= (float)first-2;
				v2d->cur.xmax=v2d->tot.xmax= (float)C->scene->r.efra+2;
			
				ED_area_tag_redraw(C->area);
			}
			break;
		case 4: /* Maximize Window */
			/* using event B_FULL */
			break;
		case 5:	/* show time or frames */
			stime->flag ^= TIME_DRAWFRAMES;
			ED_area_tag_redraw(C->area);
			break;
		case 6:
			//nextprev_marker(1);
			break;
		case 7:
			//nextprev_marker(-1);
			break;
		case 8:
			//nextprev_timeline_key(1);
			break;
		case 9:
			//nextprev_timeline_key(-1);
			break;
		case 10:
			//timeline_frame_to_center();
			break;
		case 11:
			if(v2d) {
				v2d->flag ^= V2D_VIEWSYNC_X;
				if(v2d->flag & V2D_VIEWSYNC_X)
					WM_event_add_notifier(C, WM_NOTE_TIMELINE_SYNC, V2D_LOCK_SET, v2d);
			}
			break;
		case 12: /* only show keyframes from selected data */
			stime->flag ^= TIME_ONLYACTSEL;
			ED_area_tag_redraw(C->area);
			break;
	}
}

static uiBlock *time_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
{
	ScrArea *curarea= C->area;
	SpaceTime *stime= curarea->spacedata.first;
	View2D *v2d= UI_view2d_fromcontext_rwin(C);
	uiBlock *block;
	short yco= 0, menuwidth=120;
	
	block= uiBeginBlock(C, handle->region, "time_viewmenu", UI_EMBOSSP, UI_HELV);
	uiBlockSetButmFunc(block, do_time_viewmenu, NULL);
	
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation", 0, yco-=20,
					 menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
	
	uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
	
	if(stime->flag & TIME_DRAWFRAMES)
		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
	else 
		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
	
	uiDefIconTextBut(block, BUTM, 1, (stime->flag & TIME_ONLYACTSEL)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
					 "Only Selected Data Keys|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
	
	uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
	
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Key|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Key|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
	
	uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
	
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
	uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_X)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
					 "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
	
//	if (!curarea->full) 
//		uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
//	else 
//		uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
	
	if(curarea->headertype==HEADERTOP) {
		uiBlockSetDirection(block, UI_DOWN);
	}
	else {
		uiBlockSetDirection(block, UI_TOP);
		uiBlockFlipOrder(block);
	}
	
	uiTextBoundsBlock(block, 50);
	uiEndBlock(C, block);
	
	return block;
}

static void do_time_framemenu(bContext *C, void *arg, int event)
{
	switch(event) {
		case 1: /*Set as Start */
			if (C->scene->r.psfra) {
				if (C->scene->r.pefra < CFRA)
					C->scene->r.pefra= CFRA;
				C->scene->r.psfra= CFRA;
			}				
			else
				C->scene->r.sfra = CFRA;
			WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
			break;
		case 2: /* Set as End */
			if (C->scene->r.psfra) {
				if (CFRA < C->scene->r.psfra)
					C->scene->r.psfra= CFRA;
				C->scene->r.pefra= CFRA;
			}				
			else
				C->scene->r.efra = CFRA;
			WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
			break;
		case 3: /* Rename Marker */
			//rename_marker();
			break;
	}
}

static uiBlock *time_framemenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
{
	ScrArea *curarea= C->area;
	uiBlock *block;
	short yco= 0, menuwidth=120;
	
	block= uiBeginBlock(C, handle->region, "time_framemenu", UI_EMBOSSP, UI_HELV);
	uiBlockSetButmFunc(block, do_time_framemenu, NULL);

	uiDefIconTextButO(C, block, BUTM, "ED_MARKER_OT_add", WM_OP_REGION_WIN, ICON_BLANK1, "Add Marker",
					  0, yco-=2, menuwidth, 19, "");
	uiDefIconTextButO(C, block, BUTM, "ED_MARKER_OT_duplicate", WM_OP_REGION_WIN, ICON_BLANK1, "Duplicate Marker",
					  0, yco-=20, menuwidth, 19, "");
	uiDefIconTextButO(C, block, BUTM, "ED_MARKER_OT_delete", WM_OP_REGION_WIN, ICON_BLANK1, "Delete Marker",
					  0, yco-=20, menuwidth, 19, "");
	
	uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
	
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Name Marker|Ctrl M",
					 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
	uiDefIconTextButO(C, block, BUTM, "ED_MARKER_OT_move", WM_OP_REGION_WIN, ICON_BLANK1, "Grab/Move Marker",
					  0, yco-=20, menuwidth, 19, "");
	
	uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
	
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as Start|S",
					 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as End|E",
					 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
	
	if(curarea->headertype==HEADERTOP) {
		uiBlockSetDirection(block, UI_DOWN);
	}
	else {
		uiBlockSetDirection(block, UI_TOP);
		uiBlockFlipOrder(block);
	}
	
	uiTextBoundsBlock(block, 50);
	uiEndBlock(C, block);
	
	return block;
}

static void start_animated_screen(SpaceTime *stime)
{
	// XXX	add_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM, stime->redraws);
	
	//	if(stime->redraws & TIME_WITH_SEQ_AUDIO)
	//		audiostream_start( CFRA );
	
	//	BKE_ptcache_set_continue_physics((stime->redraws & TIME_CONTINUE_PHYSICS));
}

static void end_animated_screen(SpaceTime *stime)
{
	//	rem_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM);
	
	//	audiostream_stop();
	//	BKE_ptcache_set_continue_physics(0);
}

#define B_REDRAWALL		750
#define B_TL_REW		751
#define B_TL_PLAY		752
#define B_TL_FF			753
#define B_TL_PREVKEY	754
#define B_TL_NEXTKEY	755
#define B_TL_STOP		756
#define B_TL_PREVIEWON	757
#define B_TL_INSERTKEY	758
#define B_TL_DELETEKEY	759

#define B_FLIPINFOMENU 0
#define B_NEWFRAME 0
#define AUTOKEY_ON 0
#define B_DIFF 0


void do_time_buttons(bContext *C, void *arg, int event)
{
	SpaceTime *stime= C->area->spacedata.first;
	
	switch(event) {
		case B_REDRAWALL:
			WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
			break;
		case B_TL_REW:
			CFRA= PSFRA;
			//update_for_newframe();
			break;
		case B_TL_PLAY:
			start_animated_screen(stime);
			break;
		case B_TL_STOP:
			end_animated_screen(stime);
			WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
			break;
		case B_TL_FF:
			/* end frame */
			CFRA= PEFRA;
			//update_for_newframe();
			break;
		case B_TL_PREVKEY:
			/* previous keyframe */
			//nextprev_timeline_key(-1);
			break;
		case B_TL_NEXTKEY:
			/* next keyframe */
			//nextprev_timeline_key(1);
			break;
			
		case B_TL_PREVIEWON:
			if (C->scene->r.psfra) {
				/* turn on preview range */
				C->scene->r.psfra= C->scene->r.sfra;
				C->scene->r.pefra= C->scene->r.efra;
			}
			else {
				/* turn off preview range */
				C->scene->r.psfra= 0;
				C->scene->r.pefra= 0;
			}
			//BIF_undo_push("Set anim-preview range");
			WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
			break;
			
		case B_TL_INSERTKEY:
			/* insert keyframe */
			//common_insertkey();
			//allqueue(REDRAWTIME, 1);
			break;
		case B_TL_DELETEKEY:
			/* delete keyframe */
			//common_deletekey();
			//allqueue(REDRAWTIME, 1);
			break;
	}
}


void time_header_buttons(const bContext *C, ARegion *ar)
{
	ScrArea *sa= C->area;
	SpaceTime *stime= sa->spacedata.first;
	uiBlock *block;
	int xco, yco= 3;
	
	block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
	uiBlockSetHandleFunc(block, do_time_buttons, NULL);
	
	xco= ED_area_header_standardbuttons(C, block, yco);
	
	if((sa->flag & HEADER_NO_PULLDOWN)==0) {
		int xmax;
		
		/* pull down menus */
		uiBlockSetEmboss(block, UI_EMBOSSP);
		
		xmax= GetButStringLength("View");
		uiDefPulldownBut(block, time_viewmenu, C->area, 
						 "View", xco, yco-2, xmax-3, 24, "");
		xco+= xmax;
		xmax= GetButStringLength("Frame");
		uiDefPulldownBut(block, time_framemenu, C->area, 
						 "Frame", xco, yco-2, xmax-3, 24, "");
		xco+= xmax;
		
		xmax= GetButStringLength("Playback");
		uiDefPulldownBut(block, time_redrawmenu, C->area, 
						 "Playback", xco, yco-2, xmax-3, 24, "");
		xco+= xmax;
	}
	
	uiBlockSetEmboss(block, UI_EMBOSS);
	
	uiBlockBeginAlign(block);
	
	uiDefButI(block, TOG, B_TL_PREVIEWON,"Preview",	
			  xco,yco, XIC, YIC,
			  &C->scene->r.psfra,0, 1, 0, 0,
			  "Show settings for frame range of animation preview");
	
	xco += XIC;
	
	if (C->scene->r.psfra) {
		uiDefButI(block, NUM, B_REDRAWALL,"Start:",	
				  xco,yco, 4.5*XIC, YIC,
				  &C->scene->r.psfra,MINFRAMEF, MAXFRAMEF, 0, 0,
				  "The start frame of the animation preview (inclusive)");
		
		xco += (short)(4.5*XIC);
		
		uiDefButI(block, NUM, B_REDRAWALL,"End:",	
				  xco,yco,4.5*XIC,YIC,
				  &C->scene->r.pefra,PSFRA,MAXFRAMEF, 0, 0,
				  "The end frame of the animation preview (inclusive)");
	}
	else {
		uiDefButI(block, NUM, B_REDRAWALL,"Start:",	
				  xco,yco, 4.5*XIC, YIC,
				  &C->scene->r.sfra,MINFRAMEF, MAXFRAMEF, 0, 0,
				  "The start frame of the animation (inclusive)");
		
		xco += (short)(4.5*XIC);
		
		uiDefButI(block, NUM, B_REDRAWALL,"End:",	
				  xco,yco,4.5*XIC,YIC,
				  &C->scene->r.efra,(float)SFRA,MAXFRAMEF, 0, 0,
				  "The end frame of the animation (inclusive)");
	}
	uiBlockEndAlign(block);
	
	xco += (short)(4.5 * XIC + 16);
	
	uiDefButI(block, NUM, B_NEWFRAME, "",
			  xco,yco,3.5*XIC,YIC,
			  &(C->scene->r.cfra), MINFRAMEF, MAXFRAMEF, 0, 0,
			  "Displays Current Frame of animation");
	
	xco += (short)(3.5 * XIC + 16);
	
	uiDefIconBut(block, BUT, B_TL_REW, ICON_REW,
				 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to Start frame (Shift DownArrow)");
	xco+= XIC+4;
	uiDefIconBut(block, BUT, B_TL_PREVKEY, ICON_PREV_KEYFRAME,
				 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to previous keyframe (Ctrl PageDown)");
	xco+= XIC+4;
	
//	if(has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
//		uiDefIconBut(block, BUT, B_TL_STOP, ICON_PAUSE,
//					 xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Stop Playing Timeline");
//	else 	   
		uiDefIconBut(block, BUT, B_TL_PLAY, ICON_PLAY,
					 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Play Timeline ");
	
	xco+= XIC+4;
	uiDefIconBut(block, BUT, B_TL_NEXTKEY, ICON_NEXT_KEYFRAME,
				 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to next keyframe (Ctrl PageUp)");
	xco+= XIC+4;
	uiDefIconBut(block, BUT, B_TL_FF, ICON_FF,
				 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to End frame (Shift UpArrow)");
	xco+= XIC+8;
	
	uiDefIconButBitS(block, TOG, AUTOKEY_ON, REDRAWINFO, ICON_REC,
					 xco, yco, XIC, YIC, &(C->scene->autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones");
	xco+= XIC;
	if (C->scene->autokey_mode & AUTOKEY_ON) {
		uiDefButS(block, MENU, REDRAWINFO, 
				  "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5", 
				  xco, yco, 3.5*XIC, YIC, &(C->scene->autokey_mode), 0, 1, 0, 0, 
				  "Mode of automatic keyframe insertion for Objects and Bones");
		xco+= (4*XIC);
	}
	
	xco+= 16;
	
	uiDefIconBut(block, BUT, B_TL_INSERTKEY, ICON_KEY_HLT,
				 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Insert Keyframe for the context of the largest area (IKEY)");
	xco+= XIC+4;
	uiDefIconBut(block, BUT, B_TL_DELETEKEY, ICON_KEY_DEHLT,
				 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Delete Keyframe for the context of the largest area (ALTKEY-IKEY)");
	xco+= XIC+4;
	
	xco+= 16;
	
	uiDefIconButBitI(block, TOG, TIME_WITH_SEQ_AUDIO, B_DIFF, ICON_SPEAKER,
					 xco, yco, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor");
	
	
	/* always as last  */
	UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
	
	uiEndBlock(C, block);
	uiDrawBlock(block);
}