with glfw3; use glfw3;
with gl; use gl;
with interfaces.c; use interfaces.c;

with sysutils;
with text_io; use text_io;


package body musical is

	pidstr : idtype;
	last: natural;
	ok: boolean;
	fid: file_type;

	task body musictask is
	begin

	loop

	 select

		accept Play( cmd: string; utime: out gldouble ) do
			sysutils.Shell( cmd, Ok );
			utime := glfwGetTime;
		end Play;

		accept getPID( fname: string; idstr: out idtype; len: out natural ) do
			open(fid, in_file, fname);
			get_line(fid, pidstr, last);
			close(fid);
			idstr:=pidstr;
			len:=last;
		end getPID;

	 or
		terminate;
	 end select;

	end loop;

	exception
		when others=>
			put_line("musical.adb error");
			raise;

	end musictask;

end musical;
