Freeware on Music

This page contains the source code for the Settings menu

Return to freeware page

Carnatic Music Hme Page

--------------------------

void volumefun()
{
	int area;
	char *p,psptr[10],icon[10];
	size(32,0);
	area=(17-3+1)*(60-23+1)*2;
	p=malloc(area);
	if(p==NULL)
	{
		errormesg(0,10);
	}
	if(mouseinit!=0)
		hidemsptr();
	/* status line indicating ESC*/
	messgline(9);
	savevideo(3,23,9,50,p);
	menubox(3,23,9,50,112,7);
	drawbox(3,23,8,48,112);
	menubox(6,27,6,43,16,NO_SHADOW);
	writestring("Playback Volume",4,27,112);
	sprintf(icon,"%c",31);
	writestring(icon,6,26,49);
	sprintf(icon,"%c",30);
	writestring(icon,6,44,49);
	if(mouseinit!=0)
		showms_ptr();
	while(1)
	{
		ascii=0;
		scan=0;
		sprintf(psptr,"%8.1f",volume);
		writestring(psptr,6,31,31);
		if(mouseinit!=0)
			showms_ptr();
		getkey();
		if(ascii==ESC || ascii==13)
			break;
		if(ascii==0 && button==0)
		{
			switch(scan)
			{
				case 72:
					volume+=0.1;
					if(volume>=12000)
						volume=12000;
					break;
				case 80:
					volume-=0.1;
					if(volume<=0.1)
						volume=0.1;
					break;
			}
		}
		else if(ascii==0 && button==1 && ygrid==48)
		{
			if(xgrid==352)
			{
				volume+=0.1;
				if(volume>=12000)
					volume=12000;
			}
			else if(xgrid==208)
			{
				volume-=0.1;
				if(volume<=0.1)
					volume=0.1;
			}
		}
		else if(ascii==0 && button==1 && (xgrid<=176 || xgrid>=392) || (ygrid<=8 || ygrid>=80))
		{
			break;
		}
	}
	status_line();
	if(mouseinit!=0)
		hidemsptr();
	restorevideo(3,23,9,50,p);
	free(p);
	if(mouseinit!=0)
		showms_ptr();
}

void persistfun()
{
	int area;
	char *p,ptr[10],icon[10];
	size(32,0);
	area=(17-3+1)*(60-23+1)*2;
	p=malloc(area);
	if(p==NULL)
		error_exit();
	if(mouseinit!=0)
		hidemsptr();
	savevideo(3,23,9,50,p);
	menubox(3,23,9,50,112,7);
	menubox(6,27,6,43,16,NO_SHADOW);
	drawbox(3,23,8,48,112);
	writestring("Persistence of the note",4,25,112);
	sprintf(icon,"%c",31);
	writestring(icon,6,26,49);
	sprintf(icon,"%c",30);
	writestring(icon,6,44,49);
	if(mouseinit!=0)
		showms_ptr();
	while(1)
	{
		ascii=0;
		scan=0;
		button=0;
		if(mouseinit!=0)
			showms_ptr();
		sprintf(ptr,"%8u",note.persist);
		writestring(ptr,6,29,31);
		getkey();
		if(ascii==ESC || ascii==13)
			break;
		if(ascii==0 && button==0)
		{
			switch(scan)
			{
				case 72:
					note.persist+=1;
					if(note.persist>=40000)
						note.persist=40000;
					break;
				case 80:
					note.persist-=1;
					if(note.persist<=1)
						note.persist=1;
					break;
			}
		}
		else if(ascii==0 && button==1 && ygrid==48)
		{
			if(xgrid==352)
			{
				note.persist+=1;
				if(note.persist>=40000)
					note.persist=40000;
			}
			else if(xgrid==208)
			{
				note.persist-=1;
				if(note.persist<=1)
					note.persist=1;
			}
		}
		else if(ascii==0 && button==1 && (xgrid<=176 || xgrid>=392) || (ygrid<=16 || ygrid>=80))
		{
			break;
		}
	}
	if(mouseinit!=0)
		hidemsptr();
	restorevideo(3,23,9,50,p);
	free(p);
	if(mouseinit!=0)
		showms_ptr();
}

void pausefun()
{
	int area;
	char *p,psptr[10],icon[10];
	size(32,0);
	area=(17-3+1)*(60-23+1)*2;
	p=malloc(area);
	if(p==NULL)
		error_exit();
	if(mouseinit!=0)
		hidemsptr();
	savevideo(3,23,9,50,p);
	menubox(3,23,9,50,112,7);
	menubox(6,27,6,43,16,NO_SHADOW);
	drawbox(3,23,8,48,112);
	writestring("Pause between notes",4,26,112);
	sprintf(icon,"%c",31);
	writestring(icon,6,26,49);
	sprintf(icon,"%c",30);
	writestring(icon,6,44,49);
	if(mouseinit!=0)
		showms_ptr();
	while(1)
	{
		if(mouseinit!=0)
			showms_ptr();
		sprintf(psptr,"%8u",note.pause);
		writestring(psptr,6,29,31);
		getkey();
		if(ascii==ESC || ascii==13)
			break;
		if(ascii==0 && button==0)
		{
			switch(scan)
			{
				case 72:
					note.pause+=1;
					if(note.pause>=40000)
						note.pause=40000;
					break;
				case 80:
					note.pause-=1;
					if(note.pause<=1)
						note.pause=1;
					break;
			}
		}
		else if(ascii==0 && button==1 && ygrid==48)
		{
			if(xgrid==352)
			{
				note.pause+=1;
				if(note.pause>=40000)
					note.pause=40000;
			}
			else if(xgrid==208)
			{
				note.pause-=1;
				if(note.pause<=1)
					note.pause=1;
			}
		}
		else if(ascii==0 && button==1 && (xgrid<=176 || xgrid>=392) || (ygrid<=16 || ygrid>=80))
		{
			break;
		}
	}
	if(mouseinit!=0)
		hidemsptr();
	restorevideo(3,23,9,50,p);
	free(p);
	if(mouseinit!=0)
		showms_ptr();
}