Source

musagi-stqn / song.h

Full commit
  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
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
#ifndef song_h
#define song_h

class Song;

#include "musagi.h"
#include "dui.h"
#include "part.h"
#include "AudioStream.h"

struct SPart
{
	Part *part;
	int ypos;
	int start;
	int loops;
	bool triggered;
	char sid[10];
	bool selected;
	bool clone;
};

struct KnobRecord
{
	float *value;
	bool rec;
	int curentry;
	int numentries;
	int numalloc;
	float entrydefault;
	int *entrytime;
	float *entryvalue;
};

class Song
{
public:
	SPart *parts;
	int maxparts;
	int numparts;
	int guid;

	char info_text[4][50];

//	bool krecvis[4096];
	KnobRecord knobrecs[1024];
	int numknobs;
	bool recknobs;
	int knobrecstart;
	int kr_tempalloc;
	int *kr_temptime;
	float *kr_tempvalue;

	bool playing;
	bool playprepped;
	bool loop;
	int playfrom;
	int playto;
	int loopfrom;
	int playstart;
	int playtime;
	int playindex;
	int playdrag;

	bool muted[60];

	float scrollx;
	float scrolly;
	int iscrollx;
	int iscrolly;
	int scrollsize;
	bool spacescroll;

	bool showsong;

	int selected_instrument;

	int ghostpart_mode;
	int ghostpart_width;
//	int* ghostpart_width;
//	int* ghostpart_parti;
//	int ghostpart_num;

	bool selectbox;
	int selectbox_x1;
	int selectbox_y1;

public:
	Song()
	{
		maxparts=4096;
		parts=(SPart*)malloc(maxparts*sizeof(SPart));
		numparts=0;
		guid=0;
		for(int i=0;i<maxparts;i++)
			parts[i].part=NULL;
		playing=false;
		playprepped=false;
		scrollx=0.0f;
		scrolly=0.0f;
		iscrollx=0;
		iscrolly=0;
		scrollsize=0;
		spacescroll=false;

		showsong=true;
		selected_instrument=-1;
		selectbox=false;

		ghostpart_mode=0;

		playfrom=0;
		loop=false;
		playto=48*(16*640);
		loopfrom=32*(16*640);
		playdrag=-1;

		for(int i=0;i<60;i++)
			muted[i]=false;

//		for(int i=0;i<4096;i++)
//			krecvis[i]=false;

		for(int i=0;i<50;i++)
		{
			info_text[0][i]=0;
			info_text[0][i]=0;
			info_text[0][i]=0;
			info_text[0][i]=0;
		}
		info_text[0][0]='\0';
		info_text[1][0]='\0';
		info_text[2][0]='\0';
		info_text[3][0]='\0';

		numknobs=0;
		recknobs=false;
		kr_tempalloc=4096*4;
		kr_temptime=(int*)malloc(kr_tempalloc*sizeof(int));
		kr_tempvalue=(float*)malloc(kr_tempalloc*sizeof(float));
	};
	~Song()
	{
		free(parts);
		for(int i=0;i<numknobs;i++)
		{
			LogPrint("freeing knobrec %i (%i values)", i, knobrecs[i].numentries);
			free(knobrecs[i].entrytime);
			free(knobrecs[i].entryvalue);
		}
		free(kr_temptime);
		free(kr_tempvalue);
	};

	void PlayButton()
	{
		if(!playing)
			Play(playfrom);
		else
			Stop();
	};

	void SelectInstrument(int i)
	{
		selected_instrument=i;
	};

	bool KnobAtMemPos(float *pos)
	{
		for(int i=0;i<numknobs;i++)
			if(knobrecs[i].value==pos)
				return true;
		return false;
	};

	void KnobToMemPos(float *oldpos, float *newpos)
	{
		for(int i=0;i<numknobs;i++)
			if(knobrecs[i].value==oldpos)
			{
				LogPrint("song: remapped knob %i ($%.8X -> $%.8X)", i, oldpos, newpos);
				knobrecs[i].value=newpos;
				return;
			}
		LogPrint("TERROR: KnobToMemPos() failed to find the correct knob ($%.8X -> $%.8X)", oldpos, newpos);
	};

	int KnobRecState(float *value)
	{
		for(int i=0;i<numknobs;i++)
			if(knobrecs[i].value==value)
			{
				if(knobrecs[i].rec)
					return 2;
				else
					return 1;
			}
		return 0;
	};

	void KnobRecClear(float *value)
	{
		for(int i=0;i<numknobs;i++)
			if(knobrecs[i].value==value)
			{
				knobrecs[i].numentries=0;
				if(!knobrecs[i].rec) // remove this knob record if we're not just about to start recording it
					knobrecs[i].value=NULL;
				return;
			}
	};

	void KnobRecDefault(float *value)
	{
		for(int i=0;i<numknobs;i++)
			if(knobrecs[i].value==value)
			{
				knobrecs[i].entrydefault=*value;
				LogPrint("knobrec: set knob %i default to %.2f", i, *value);
				return;
			}
	};

	void KnobRecToggle(float *value)
	{
		int firstempty=-1;
		int i;
		for(i=0;i<numknobs;i++)
		{
			if(firstempty==-1 && knobrecs[i].value==NULL)
				firstempty=i;
			if(knobrecs[i].value==value)
			{
				LogPrint("knobrec: toggled existing knob %i", i);
				knobrecs[i].rec=!knobrecs[i].rec;
				if(knobrecs[i].numentries==0) // remove this knob record if there's no actual recording
					knobrecs[i].value=NULL;
				return;
			}
		}
		if(firstempty>-1)
			i=firstempty;
		// knob has no record, create one
		LogPrint("knobrec: toggle -> adding knob %i (value %.8X)", i, value);
		knobrecs[i].value=value;
		knobrecs[i].entrydefault=*value;
		knobrecs[i].rec=true;
		knobrecs[i].numalloc=0;
		knobrecs[i].numentries=0;
		knobrecs[i].entrytime=NULL;
		knobrecs[i].entryvalue=NULL;
		if(i==numknobs)
			numknobs++;
	};

	void KnobRecTick();

//	void SelectPart(Part *part)
	void SelectPart(char *sid)
	{
		for(int i=0;i<numparts;i++)
		{
			if(strcmp(parts[i].sid, sid)==0)
//				parts[i].part->selected=true;
//			else
//				parts[i].part->selected=false;
				parts[i].selected=true;
//			else
//				parts[i].selected=false;
		}
		ghostpart_mode=0;
	};

	void DeselectPart()
	{
		for(int i=0;i<numparts;i++)
			parts[i].selected=false;
		ghostpart_mode=0;
	};

	Part* GetSelectedPart()
	{
		for(int i=0;i<numparts;i++)
			if(parts[i].selected)
//			if(parts[i].part->selected)
				return parts[i].part;
		return NULL;
	};

	int NumSelectedParts()
	{
		int num=0;
		for(int i=0;i<numparts;i++)
			if(parts[i].selected)
				num++;
		return num;
	}

	char* GetSelectedSid()
	{
		for(int i=0;i<numparts;i++)
			if(parts[i].selected)
//			if(parts[i].part->selected)
				return parts[i].sid;
		return NULL;
	};

	char* InsertPart(Part *part, int start, int ypos)
	{
//		LogPrint("song: insert@%i, numparts=%i", start, numparts);

		// find spot
		int i=0;
		for(i=numparts-1;i>=0;i--)
			if(parts[i].start<start)
				break;
		i++;
		numparts++;
		// move triggers to the right
		for(int j=numparts-1;j>i;j--)
			parts[j]=parts[j-1];
		// insert new
		parts[i].part=part;
		parts[i].start=start;
		parts[i].loops=1;
		parts[i].ypos=ypos;
		parts[i].clone=false;
		// search for prior sparts with this part
		for(int j=0;j<numparts;j++)
			if(j!=i && parts[j].part==part)
			{
				parts[i].clone=true;
				parts[j].clone=true;
				break;
			}
		parts[i].selected=false;
		// assign a unique name (for interface)
		int uid=guid++;
		uid%=1000000;
		sprintf(parts[i].sid, "pi%.6i", uid);
		return parts[i].sid;
	};

	int GenGuid()
	{
		guid++;
		return guid;
	};

//	void RemovePart(Part *part)
	bool RemovePart(char *sid)
	{
		LogPrint("song: trying to remove part \"%s\"", sid);
/*		if(part==NULL)
		{
			LogPrint("CAUTION: tried to remove NULL part");
			return false;
		}*/
		int id=-1;
		for(int i=0;i<numparts;i++)
		{
//			if(parts[i].part==part)
			if(strcmp(parts[i].sid, sid)==0)
			{
				id=i;
				break;
			}
		}
		if(id==-1) // not found
		{
			LogPrint("CAUTION: tried to remove non-existing part \"%s\"", sid);
			return false;
		}
		int instances=0;
		bool waslastpart=false;
		for(int i=0;i<numparts;i++)
			if(parts[i].part==parts[id].part)
				instances++;
		LogPrint("song:   part has %i instances", instances);
		if(instances==1) // there are no clones, so delete the actual part
		{
			waslastpart=true;
			LogPrint("song:   removed the last instance, delete the original part object");
		}
		if(instances==2) // after this removal there will only be one instance left of this part
		{
			for(int i=0;i<numparts;i++)
				if(parts[i].part==parts[id].part)
					parts[i].clone=false;
			LogPrint("song:   removed the last clone, mark the remaining instance as non-cloned");
		}
		// move triggers to the left
		LogPrint("song: reordering part triggers");
		for(int j=id;j<numparts-1;j++)
			parts[j]=parts[j+1];
		numparts--;
		LogPrint("song: part removal done");
		return waslastpart;
	};

	void Play(int start)
	{
		LogPrint("song: ---- playing from %i", start);
		playtime=start;
		playstart=GetTick(0);
		playindex=0;
		for(int i=0;i<numparts;i++)
			parts[i].triggered=false;
		playing=true;
		playprepped=false;
		knobrecstart=playtime;
		for(int i=0;i<numknobs;i++)
		{
			if(knobrecs[i].rec)
			{
				KnobRecord *kr=&knobrecs[i];
				if(kr->curentry+2>=kr->numalloc)
				{
					kr->numalloc+=4096;
					kr->entrytime=(int*)realloc(kr->entrytime, kr->numalloc*sizeof(int));
					kr->entryvalue=(float*)realloc(kr->entryvalue, kr->numalloc*sizeof(float));
				}
				if(kr->numentries==0) // insert a stop entry at the very beginning of the song
				{
					kr->entrytime[0]=0;
					kr->entryvalue[0]=-1.0f;
					kr->numentries=1;
				}
				kr->curentry=kr->numentries;
				kr->entrytime[kr->curentry]=playtime;
				kr->entryvalue[kr->curentry]=*kr->value;
			}
			else
				knobrecs[i].curentry=0;
		}
		LogPrint("song: play() finished");
	};

	void Stop()
	{
		LogPrint("song: ---- stop");
		for(int i=0;i<numparts;i++)
			parts[i].part->Stop();
		playing=false;
		recknobs=false;
		for(int i=0;i<numknobs;i++)
		{
			if(knobrecs[i].rec)
			{
				LogPrint("song: splicing knobrec %i", i);
				KnobRecord *kr=&knobrecs[i];
				// as the last value, store what was originally recorded at this position in time
				float oldvalue=-1.0f;
				for(int j=0;j<kr->numentries;j++)
					if(kr->entrytime[j]>playtime)
					{
						if(j>0)
							j--;
						oldvalue=kr->entryvalue[j];
						break;
					}
				kr->curentry++;
				kr->entrytime[kr->curentry]=playtime;
				kr->entryvalue[kr->curentry]=oldvalue;
				int numnew=kr->curentry+1-kr->numentries;
				int firstnew=kr->numentries;
				int starttime=kr->entrytime[firstnew];
				int endtime=playtime;
				// find out how many old entries to remove (overwritten)
				int numremoved=0;
				int splicepos=kr->numentries;
				for(int j=0;j<kr->numentries;j++)
				{
					if(kr->entrytime[j]>=starttime)
					{
						if(numremoved==0)
							splicepos=j;
						numremoved++;
					}
					if(kr->entrytime[j]>=endtime)
					{
						if(numremoved>0)
							numremoved--; // this last one should remain
						break;
					}
				}
				// splice in newly recorded section into the old record
				int offset=numnew-numremoved;
				LogPrint("song: numold=%i numnew=%i numremoved=%i offset=%i splicepos=%i -> expected postsplice numentries=%i", kr->numentries, numnew, numremoved, offset, splicepos, kr->numentries+offset);
				if(offset<=0) // lost more than we gained, things need to move down
				{
					LogPrint("song: lost some");
					int spliced=0;
					int j;
					for(j=splicepos;j<kr->numentries+offset;j++)
					{
						if(spliced<numnew)
						{
							kr->entrytime[j]=kr->entrytime[firstnew+spliced];
							kr->entryvalue[j]=kr->entryvalue[firstnew+spliced];
							spliced++;
						}
						else
						{
							if(offset==0)
							{
								j=kr->numentries+offset;
								break;
							}
							kr->entrytime[j]=kr->entrytime[j-offset];
							kr->entryvalue[j]=kr->entryvalue[j-offset];
						}
					}
					kr->numentries=j;
				}
				else // gained more than we lost, things need to move up
				{
					LogPrint("song: gained some");
					while(kr->numentries+numnew>kr_tempalloc)
					{
						kr_tempalloc+=4096*4;
						free(kr_temptime);
						kr_temptime=(int*)malloc(kr_tempalloc*sizeof(int));
						free(kr_tempvalue);
						kr_tempvalue=(float*)malloc(kr_tempalloc*sizeof(float));
					}
					int ti=0;
					for(int j=0;j<splicepos;j++) // preserve old unaffected entries
					{
						kr_temptime[ti]=kr->entrytime[j];
						kr_tempvalue[ti]=kr->entryvalue[j];
						ti++;
					}
					for(int j=0;j<numnew;j++) // insert new entries
					{
						kr_temptime[ti]=kr->entrytime[firstnew+j];
						kr_tempvalue[ti]=kr->entryvalue[firstnew+j];
						ti++;
					}
					for(int j=0;j<kr->numentries-splicepos-numremoved;j++) // preserve old entries left behind new ones
					{
						kr_temptime[ti]=kr->entrytime[splicepos+numremoved+j];
						kr_tempvalue[ti]=kr->entryvalue[splicepos+numremoved+j];
						ti++;
					}
					kr->numentries=ti;
					for(int j=0;j<kr->numentries;j++) // copy entries over to permanent storage
					{
						kr->entrytime[j]=kr_temptime[j];
						kr->entryvalue[j]=kr_tempvalue[j];
					}
				}
				LogPrint("song: postsplice numentries=%i", kr->numentries);
			}
			knobrecs[i].rec=false;
		}
	};

	void Save(FILE *file)
	{
		kfwrite2(&guid, 1, sizeof(int), file);
		kfwrite2(&playfrom, 1, sizeof(int), file);
		kfwrite2(&playto, 1, sizeof(int), file);
		kfwrite2(&loopfrom, 1, sizeof(int), file);
		kfwrite2(&loop, 1, sizeof(bool), file);
		kfwrite2(&scrollx, 1, sizeof(float), file);
		kfwrite2(&scrolly, 1, sizeof(float), file);
		kfwrite2(info_text[0], 50, sizeof(char), file);
		kfwrite2(info_text[1], 50, sizeof(char), file);
		kfwrite2(info_text[2], 50, sizeof(char), file);
		kfwrite2(info_text[3], 50, sizeof(char), file);
		kfwrite2(&numparts, 1, sizeof(int), file);
		for(int i=0;i<numparts;i++)
		{
			kfwrite2(&parts[i].part->gindex, 1, sizeof(int), file);
			kfwrite2(&parts[i].start, 1, sizeof(int), file);
			kfwrite2(&parts[i].loops, 1, sizeof(int), file);
			kfwrite2(&parts[i].ypos, 1, sizeof(int), file);
			kfwrite2(&parts[i].clone, 1, sizeof(bool), file);
			kfwrite2(parts[i].sid, 10, sizeof(char), file);
		}
		for(int i=0;i<60;i++)
			kfwrite2(&muted[i], 1, sizeof(bool), file);
		kfwrite2(&numknobs, 1, sizeof(int), file);
		for(int i=0;i<numknobs;i++)
		{
			kfwrite(&knobrecs[i], 1, sizeof(KnobRecord), file);
			kfwrite2(knobrecs[i].entrytime, knobrecs[i].numentries, sizeof(int), file);
			kfwrite2(knobrecs[i].entryvalue, knobrecs[i].numentries, sizeof(float), file);
//			LogPrint("song: wrote knob %i (%i entries, value=$%.8X)", i, knobrecs[i].numentries, knobrecs[i].value);
		}
	};

	void Load(FILE *file, Part **gparts, int numgparts)
	{
		kfread2(&guid, 1, sizeof(int), file);
		kfread2(&playfrom, 1, sizeof(int), file);
		kfread2(&playto, 1, sizeof(int), file);
		kfread2(&loopfrom, 1, sizeof(int), file);
		kfread2(&loop, 1, sizeof(bool), file);
		kfread2(&scrollx, 1, sizeof(float), file);
		kfread2(&scrolly, 1, sizeof(float), file);
		kfread2(info_text[0], 50, sizeof(char), file);
		kfread2(info_text[1], 50, sizeof(char), file);
		kfread2(info_text[2], 50, sizeof(char), file);
		kfread2(info_text[3], 50, sizeof(char), file);
		kfread2(&numparts, 1, sizeof(int), file);
		for(int i=0;i<numparts;i++)
		{
			int pindex=0;
			kfread2(&pindex, 1, sizeof(int), file);
			kfread2(&parts[i].start, 1, sizeof(int), file);
			kfread2(&parts[i].loops, 1, sizeof(int), file);
			kfread2(&parts[i].ypos, 1, sizeof(int), file);
			kfread2(&parts[i].clone, 1, sizeof(bool), file);
			kfread2(parts[i].sid, 10, sizeof(char), file);
//			parts[i].part=gparts[pindex];
			for(int pi=0;pi<numgparts;pi++)
				if(gparts[pi]!=NULL)
				{
//					LogPrint("song: looking for %i, is %i it?", pindex, gparts[pi]->gindex);
					if(gparts[pi]->gindex==pindex)
					{
//						LogPrint("song: found part %i", pi);
						parts[i].part=gparts[pi];
						break;
					}
				}
			parts[i].triggered=false;
			parts[i].selected=false;
//			LogPrint("song: spart start=%i, ypos=%i", parts[i].start, parts[i].ypos);
		}

		// unmute tracks (should actually load them from the file)
		for(int i=0;i<60;i++) // why was this 58?
			muted[i]=false;
		if(GetFileVersion()>=4) // mute tracks supported
			for(int i=0;i<60;i++)
				kfread2(&muted[i], 1, sizeof(bool), file);

		for(int i=0;i<numknobs;i++)
		{
//			LogPrint("freeing knobrec %i (%i values)", i, knobrecs[i].numentries);
			free(knobrecs[i].entrytime);
			free(knobrecs[i].entryvalue);
		}









		// DEBUG - disabled this block due to crash when loading a particular knobrec song, details unknown

		kfread2(&numknobs, 1, sizeof(int), file);
		for(int i=0;i<numknobs;i++)
		{
			kfread(&knobrecs[i], 1, sizeof(KnobRecord), file);
			knobrecs[i].entrytime=(int*)realloc(NULL, (knobrecs[i].numentries+4096)*sizeof(int));
			knobrecs[i].entryvalue=(float*)realloc(NULL, (knobrecs[i].numentries+4096)*sizeof(float));
			kfread2(knobrecs[i].entrytime, knobrecs[i].numentries, sizeof(int), file);
			kfread2(knobrecs[i].entryvalue, knobrecs[i].numentries, sizeof(float), file);
//			LogPrint("song: read knob %i (%i entries, value=$%.8X)", i, knobrecs[i].numentries, knobrecs[i].value);
		}
//		numknobs=0;










		LogPrint("song: loaded %i sparts", numparts);

		float loadedscrollx=scrollx;
		scrollsize=0;
		AdjustScrollsize();
		scrollx=loadedscrollx;
	};

	void AdjustScrollsize()
	{
		int newscrollsize=0;
		if(numparts>0)
//			newscrollsize=(int)((parts[numparts-1].start+parts[numparts-1].part->LoopedLength(parts[numparts-1].loops))*zoom)+glkitGetWidth();
			newscrollsize=(int)((parts[numparts-1].start+parts[numparts-1].part->LoopedLength(parts[numparts-1].loops))/640)+glkitGetWidth();
		if(newscrollsize<glkitGetWidth()*2)
			newscrollsize=glkitGetWidth()*2;
		if(newscrollsize>scrollsize)
		{
			if(glkitGetHeight()-118>=640)
			{
				float spos=(scrollsize-glkitGetWidth())*scrollx;
				scrollx=spos/(newscrollsize-glkitGetWidth());
			}
			else
			{
				float spos=(scrollsize-(glkitGetWidth()-8))*scrollx;
				scrollx=spos/(newscrollsize-(glkitGetWidth()-8));
			}
			scrollsize=newscrollsize;
		}
	};

	void PlayPrep(AudioStream *audiostream);

	void PlayStep(int dtime, AudioStream *audiostream);

	void DoInterface(DUI *dui, char* keep_part_selected);
};

#endif