view sched/list_schedule.m @ 42:ae596261e75f

Various fixes and development to audio handling
author samer
date Tue, 02 Dec 2014 14:51:13 +0000
parents f7fb679637ff
children
line wrap: on
line source
% list_action - Make event action from list of times and parameters
%
% list_action ::
%    timed_action({A},{}) ~'the action to perform at each time',
%    seq cell {
%       time ~'time of event',
%       A    ~'argument to pass to action'
%    } ~'the list of times and parameters to action'
% -> time ~'time of first event',
%    msched_action.

function sch=list_schedule(action,X)
	if isempty(X), sch={};
	else e0=head(X); sch={e0{1},@act}; end

	function [err,sch1]=act(t_sched)
		err=action(t_sched,e0{2});
		sch1=list_schedule(action,next(X));
	end
end