MaxPriority and SND

Hi

Maybe I'm missing something obvious but I get an error in
MaxPriority. I'm using Psychtoolbox 2.44 for Mac on a G3.

Basically I cant get MaxPriority to work if a give it SND as an input
arguement. I think I can work out a simple fix to the problem though.

Here are the details.

If I make the call

>Priority=MaxPriority(0,'WaitBlanking','SND');

i get the error

>??? Function 'sscanf' not defined for variables of class 'struct'.

Which is exactly what I would expect from the code of MaxPriority
from line 102 onwards

>if ischar(varargin{i})
name=lower(varargin{i});
if strcmp(name,lower('SND'))
model=SCREEN('Computer');
if sscanf(model,'PowerMac %f',1)==6100
p=3; % on PowerMac 6100 with Mac OS 8.1
else
p=1;
end
priorityLevel=min(priorityLevel,p);
match=1;
end

Since 'model=SCREEN('Computer') returns a structure. I think this is
easily fixed by adding one line ....

if ischar(varargin{i})
name=lower(varargin{i});
if strcmp(name,lower('SND'))
model=SCREEN('Computer');
%%%new line
model=model.model;
%%%
if sscanf(model,'PowerMac %f',1)==6100
p=3; % on PowerMac 6100 with Mac OS 8.1
else
p=1;
end
priorityLevel=min(priorityLevel,p);
match=1;
end

Have I understood what this section of code is doing?

Thanks

Harriet
--
**************************************

Dr. Harriet Allen
McGill Vision Research
Department of Ophthalmology
687 Pine Ave West, H4-14
Montreal
Quebec
Canada H3A 1A1
Tel: (514) 842 1231 ext 4817
Fax: (514) 843 1691
hallen3@...
>Hi
>
>Maybe I'm missing something obvious but I get an error in
>MaxPriority. I'm using Psychtoolbox 2.44 for Mac on a G3.
>
>Basically I can't get MaxPriority to work if a give it SND as an input
>arguement. I think I can work out a simple fix to the problem though.
>
>Here are the details.
>
>If I make the call
>
>>Priority=MaxPriority(0,'WaitBlanking','SND');
>
>i get the error
>
>>??? Function 'sscanf' not defined for variables of class 'struct'.
>
>Which is exactly what I would expect from the code of MaxPriority
...
>
>Since 'model=SCREEN('Computer') returns a structure. I think this is
>easily fixed by adding one line ....
...
>
>Have I understood what this section of code is doing?
>
>Thanks
>
>Harriet
>--
>**************************************
>
>Dr. Harriet Allen
>McGill Vision Research
>Department of Ophthalmology
>687 Pine Ave West, H4-14
>Montreal
>Quebec
>Canada H3A 1A1
>Tel: (514) 842 1231 ext 4817
>Fax: (514) 843 1691
>hallen3@...
>

dear harriet

excellent diagnosis and fix. I'll incorporate the fix in the master
source now.

as you no doubt guessed, we forgot to change MaxPriority when we changed
the form of the returned argument of SCREEN('Computer'). Oops.

i'm enclosing the corrected version of MaxPriority.m for anyone else that
needs it.

thanks

denis