| yes, the indentation you suggest is the correct one.
Victor
On 22 Oct 2009, at 19:01, Art Hunkins wrote:
> Victor,
>
> In csndsugui, your csd function is:
> def csd(self, name):
> """Sets the source CSD and compiles it.
> name: CSD filename
> returns zero if successful"""
> path = activity.get_bundle_path()
> if self.ready:
> res = self.csound.Compile("%s/%s" % (path,name))
> if not res:
> self.ready = False
> self.focus_connect()
> self.path = path
> self.name = name
> return res
>
> Shouldn't it be this (notice indents)? Or something else?
>
> def csd(self, name):
> """Sets the source CSD and compiles it.
> name: CSD filename
> returns zero if successful"""
> path = activity.get_bundle_path()
> if self.ready:
> res = self.csound.Compile("%s/%s" % (path,name))
> if not res:
> self.ready = False
> self.focus_connect()
> self.path = path
> self.name = name
> return res
>
> Otherwise, I get "res not defined" in some cases. As you know, I
> need to
> test against "return res" to see if the compile was good. (And I
> assume that
> a bad MIDI setup - no or wrong MIDI device - will result in a bad
> compile
> and no execution of my .csd)
>
> Art Hunkins
>
> ----- Original Message -----
> From: "victor"
> To: "Developer discussions"
> Sent: Sunday, October 18, 2009 12:00 PM
> Subject: Re: [Cs-dev] patch for incomplete CSOUND segfault
>
>
>> That's good thanks, but this is generally averted by checking the
>> result of a call to Compile(). Is Art Hunkis' code doing this? That
>> is
>> what is supposed to be done. If it returns an error, then no further
>> calls should be made to performance functions.
>>
>> Victor
>>
>>
>> ----- Original Message -----
>> From: "Wade Brainerd"
>> To:
>> Sent: Friday, October 16, 2009 3:31 AM
>> Subject: [Cs-dev] patch for incomplete CSOUND segfault
>>
>>
>>> Hi all,
>>>
>>> When a sound fails to compile (e.g. SetJmp is invoked) the CSOUND
>>> can
>>> be left in an incomplete state. Calling a performance function on
>>> an
>>> incomplete CSOUND, or starting a performance thread (part of the
>>> SWIG
>>> interfaces) can lead to a segfault.
>>>
>>> I encountered this while testing Art Hunkins' OurMusic Sugar
>>> activity.
>>> The segfault occurred when I opened a .csd file that required a MIDI
>>> input device, and I did not have one in my machine.
>>>
>>> I developed a patch and posted it to this Fedora bug:
>>> https://bugzilla.redhat.com/show_bug.cgi?id=529293
>>> The patch delays setting the COMP flag until csoundCompile returns
>>> success. The performance functions check for the presence of the
>>> COMP
>>> flag before performing.
>>>
>>> Best,
>>> Wade
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year.
>>> Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market
>>> and stay
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register
>>> now!
>>> http://p.sf.net/sfu/devconference
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart
>> your
>> developing skills, take BlackBerry mobile applications to market
>> and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart
> your
> developing skills, take BlackBerry mobile applications to market and
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |