some first impressions

Yoshiki Ohshima yoshiki at squeakland.org
Thu Aug 16 14:34:08 EDT 2007


  Mitch,

> >   Thank you.  As I wrote on http://dev.laptop.org/ticket/2800, what we
> > would like to have is C functions.  Then, I can wrap them as Squeak
> > primitives.  Probably I can just rip these functions from amixer, but
> > if you can tell me which, that would be good!
> >   
> This is the relevant excerpt from the reference cited above.  The 
> correspondence between this and C code should be obvious (os.system() -> 
> system()), and it also implicitly answers the second question too.

  Yes, I know. But calling system() is not quite nice in various ways.
I'd rather would like to have a minimal C-code that can be a part of
the Squeak VM.

-- Yoshiki

>     def ac_dc(self, data=None):
>         if(self.Acdc==ac):
>             self.Acdc=dc
>             self.button1.set_label("Measure AC")
>             os.system("amixer set 'Analog Input' unmute")
>             os.system("amixer set 'Mic' 20%, 0% unmute captur")
>             os.system("amixer set 'Capture' 0%, 0% unmute captur")
>             os.system("amixer set 'Mic Boost (+20dB)' mute")
>         else:
>             self.Acdc=ac
>             self.button1.set_label("Measure DC")
>             os.system("amixer set 'Analog Input' mute")
>             os.system("amixer set 'Mic' 20%, 100% unmute captur")
>             os.system("amixer set 'Capture' 100%, 100% unmute captur")
>             os.system("amixer set 'Mic Boost (+20dB)' unmute")
> 
>    
>     def bias(self, data=None):
>         if(self.Bias==bias_on):
>             self.Bias=bias_off
>             self.button2.set_label("Set bias on ")
>             os.system("amixer set 'V_REFOUT Enable' mute")
>         else:
>             self.Bias=bias_on
>             self.button2.set_label("Set Bias off")
>             os.system("amixer set 'V_REFOUT Enable' unmute")



More information about the Devel mailing list