NSBitmapImageRepresentation image generation and saving resulting in image with much noise

2009-11-09 Thread Michael Robinson
Hi List, I'm attempting to create a bunch of png or jpg images based on user-set options. I'm getting images with a lot of noise in them, I was wondering if anyone has any ideas why this would be? I've attached a screenshot of the noisy images I've been getting. The shot is of four images

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Ron Fleckner
On 09/11/2009, at 3:53 AM, Jay Swartzfeger wrote: Hi all, I'm an absolute beginner to Objective-C (and programming in general). I have lots of books on order, but I've been messing with Xcode/Cocoa/iPhone SDK with online resources while I wait. My question -- for my next project, I want to do

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Graham Cox
On 09/11/2009, at 9:01 PM, Ron Fleckner wrote: void to_binary(int n) { int r; r = n % 2; if (n = 2) to_binary(n / 2); putchar('0' + r); return; } The above sledgehammer-hammer-ammer-mmer-mer-er is not required to crack such a nut:

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Thomas Wetmore
The approach found by Ron prints the bits in correct order. The suggested replacement prints them backwards. Other correct solutions can be done without recursion, but require a char buffer that must either be reversed or printed in reverse order. Tom Wetmore On Nov 9, 2009, at 5:27 AM,

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Andy Lee
Won't this output the digits in reverse order? --Andy On Nov 9, 2009, at 5:27 AM, Graham Cox graham@bigpond.com wrote: On 09/11/2009, at 9:01 PM, Ron Fleckner wrote: void to_binary(int n) { int r; r = n % 2; if (n = 2) to_binary(n / 2); putchar('0' +

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Graham Cox
On 09/11/2009, at 9:49 PM, Andy Lee wrote: Won't this output the digits in reverse order? Yes it will, but as I mentioned in an off-list message, the use of putchar is probably not very useful for a real-world implementation either, so you can compensate for the order when accumulating

Re: NSTreeController and object retain counts

2009-11-09 Thread Mads Paulin
Hi, Yes my Document class releases the array in its dealloc method and all Node objects in the array are properly dealloc'ed when deallocing the document. However, I think the problem is unrelated to the retaining of the array member of the document class but rather to the retaining of elements

Re: NSTreeController and object retain counts

2009-11-09 Thread Graham Cox
On 09/11/2009, at 10:31 PM, Mads Paulin wrote: Adding a node object through this method creates a node object in the document array member with a retain count of 2. The remove:sender method correctly removes the object from the document's array but only decrements the node object's retain

Re: NSBitmapImageRepresentation image generation and saving resulting in image with much noise

2009-11-09 Thread Rob Keniger
On 09/11/2009, at 7:28 PM, Michael Robinson wrote: I'm getting images with a lot of noise in them, I was wondering if anyone has any ideas why this would be? I've attached a screenshot of the noisy images I've been getting. The shot is of four images that well shouldn't have any noise

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Alastair Houghton
On 9 Nov 2009, at 10:49, Thomas Wetmore wrote: The approach found by Ron prints the bits in correct order. The suggested replacement prints them backwards. Other correct solutions can be done without recursion, but require a char buffer that must either be reversed or printed in reverse

Re: NSTreeController and object retain counts

2009-11-09 Thread Andy Lee
On Nov 9, 2009, at 6:31 AM, Mads Paulin wrote: Hi, Yes my Document class releases the array in its dealloc method and all Node objects in the array are properly dealloc'ed when deallocing the document. However, I think the problem is unrelated to the retaining of the array member of the

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Graham Cox
On 09/11/2009, at 10:55 PM, Alastair Houghton wrote: It's pretty easy to do a bit count on a fixed-size word (no need for a loop, in fact). There are some examples of how to do this here, including some really, really clever methods. Is this what you had in mind Alastair?

Re: NSTreeController and object retain counts

2009-11-09 Thread Mads Paulin
Hi Andy, Thank you for your input. I did actually try to exchange the OutlineView with a TableView and the TreeController with an ArrayController and the problem went away meaning that all elements in the collection was correctly dealloced when calling remove:sender on the controller. What

Re: NSTreeController and object retain counts

2009-11-09 Thread Andy Lee
On Nov 9, 2009, at 8:16 AM, Mads Paulin wrote: What strikes me as odd is that all Nodes in the document array are created and removed directly via the add and remove actions on the treecontroller. - I dont have a single external access to these objects. I would hence expect the controller

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Jay Swartzfeger
On Mon, Nov 9, 2009 at 7:08 AM, Graham Cox graham@bigpond.com wrote: There are some examples of how to do this here, including some really, really clever methods. Is this what you had in mind Alastair? http://gurmeetsingh.wordpress.com/2008/08/05/fast-bit-counting-routines/ --Graham

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Alastair Houghton
On 9 Nov 2009, at 12:08, Graham Cox wrote: On 09/11/2009, at 10:55 PM, Alastair Houghton wrote: It's pretty easy to do a bit count on a fixed-size word (no need for a loop, in fact). There are some examples of how to do this here, including some really, really clever methods. Is this

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Jay Swartzfeger
On Mon, Nov 9, 2009 at 9:52 AM, Alastair Houghton alast...@alastairs-place.net wrote: Anyway, there are lots of neat tricks of this nature. (All of this probably isn't for newbie C programmers, though it's perfectly possible that a newbie ObjC programmer might not be new to C or C++.) Where

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Andy Lee
On Nov 9, 2009, at 9:55 AM, Jay Swartzfeger wrote: On Mon, Nov 9, 2009 at 9:52 AM, Alastair Houghton alast...@alastairs-place.net wrote: Anyway, there are lots of neat tricks of this nature. (All of this probably isn't for newbie C programmers, though it's perfectly possible that a newbie

Re: iPhone: NSOperation and UITableVIews

2009-11-09 Thread Alex Kac
There is no need to reload the table. If you simply change the UIImageVIew that the image is assigned to, that will refresh. So you're using a very heavy handed method right now which isn't even needed. Second, if you simply store into your NSOperation-derived subclass the tag of each

Re: Best pattern for similar objects with differences

2009-11-09 Thread Paul Bruneau
Thanks all for your help- I wasn't clear enough, I agree, and sorry about that, but there was a hint hidden in my text: (I'm going to have categories to handle drawing, material takeoff, pricing, etc for each door type). We manufacture entrances (and many doors). The users of this app

Re: iPhone: NSOperation and UITableVIews

2009-11-09 Thread Dave Camp
On Nov 8, 2009, at 8:35 PM, John Michael Zorko wrote: I have an indexed table view with -- surprise -- images that take a long time to load. So, I put the loading into an NSOperation-derived subclass and have the main() method send a refresh msg to my main thread, telling it to reload the

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Thomas Wetmore
These functions return how many one bits there are in a number, not how many bit positions are needed to represent the number as a bit- string with no leading zeros. They are fun but have no utility in solving the OP's question. TW There are some examples of how to do this here, including

Re: NSString of selected text in NSTextView

2009-11-09 Thread Jens Alfke
On Nov 7, 2009, at 7:49 PM, Todd Heberlein wrote: Yeah, one of the concerns I had was whether the selected NSRange is preserved when -string is called. I've always assumed it is. That is, all character indexes that appear in the NSText[View] API correspond to character positions in the

Dialog boxes with dynamic contents

2009-11-09 Thread Kevin Brock
I'm looking for some pointers to information on creating dialog boxes with content (# and type of controls) determined at runtime. All that I really know ahead of time is that there will be a dialog box to gather some data, and that the UI objects in the dialog come from a small, well defined

Re: Hardware UUID

2009-11-09 Thread Chris Parker
Please remember that gethostuuid() has all the same caveats mentioned in TN1103. .chris On 8 Nov 2009, at 3:13 PM, Grigutis, John A wrote: Also look at gethostuuid: int gethostuuid(uuid_t id, const struct timespec *wait) I don't think it was around when that technote was last updated. --

Re: Dialog boxes with dynamic contents

2009-11-09 Thread Kyle Sluder
On Mon, Nov 9, 2009 at 9:10 AM, Kevin Brock ap...@kevin.com wrote: I'm pretty sure that I could just do it programmatically, creating and laying things out on the fly, but I'm hoping there's a simpler way.  Most of the application is standard windows in a nib file. You could take the

Creating a small timer?

2009-11-09 Thread Michael Abendroth
Hi, I would like to create a small timer. Basically, the timer sits in a view. When the view is shown, the timer should start, and when the view is hidden / closed, the timer should stop. While the view is visible, the user should be able to access controls / manipulate values inside the view.

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Thomas Wetmore
I offer the following as a Cocoa solution to the OP's query, whatever that might be taken to mean... (For extra credit: why must the parameter be unsigned?) Tom Wetmore NSString* binaryRepresentation (NSUInteger number) { unichar buffer[64]; NSUInteger n = 0; while

Less verbose way to localize a string with a default value?

2009-11-09 Thread Dave DeLong
Hi everyone, I want to use the NSLocalizedStringWithDefaultValue macro in my code (so I can see the proper strings in the UI as I debug), but it's awfully verbose. For example: NSLocalizedStringWithDefaultValue(@LibraryFolderTitle, (nil), [NSBundle mainBundle], @Library, @Library folder

Re: Dialog boxes with dynamic contents

2009-11-09 Thread Kevin Brock
Kyle Sluder wrote: On Mon, Nov 9, 2009 at 9:10 AM, Kevin Brock ap...@kevin.com wrote: I'm pretty sure that I could just do it programmatically, creating and laying things out on the fly, but I'm hoping there's a simpler way. Most of the application is standard windows in a nib file.

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Alastair Houghton
On 9 Nov 2009, at 16:42, Thomas Wetmore wrote: These functions return how many one bits there are in a number, not how many bit positions are needed to represent the number as a bit- string with no leading zeros. They are fun but have no utility in solving the OP's question. Not true.

Re: NSString of selected text in NSTextView

2009-11-09 Thread Douglas Davidson
On Nov 9, 2009, at 9:02 AM, Jens Alfke wrote: On Nov 7, 2009, at 7:49 PM, Todd Heberlein wrote: Yeah, one of the concerns I had was whether the selected NSRange is preserved when -string is called. I've always assumed it is. That is, all character indexes that appear in the NSText[View]

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Alastair Houghton
On 9 Nov 2009, at 17:20, Thomas Wetmore wrote: I offer the following as a Cocoa solution to the OP's query, whatever that might be taken to mean... (For extra credit: why must the parameter be unsigned?) Tom Wetmore NSString* binaryRepresentation (NSUInteger number) { unichar

Re: Creating a small timer?

2009-11-09 Thread Nick Zitzmann
On Nov 9, 2009, at 10:19 AM, Michael Abendroth wrote: How can I create such a timer? I mean, it probably isn't very efficient to redraw the whole view every second just to get the timer to update. Then don't. When it comes time to draw the change, make it so that it only redraws the part

Re: NSString of selected text in NSTextView

2009-11-09 Thread Kyle Sluder
On Mon, Nov 9, 2009 at 9:28 AM, Douglas Davidson ddavi...@apple.com wrote: Yes, that's correct.  Within a given text view, the character indexes are the same between the text storage and its underlying string, and these are the character indexes used by the layout manager and the text view.

Re: NSString of selected text in NSTextView

2009-11-09 Thread Douglas Davidson
On Nov 9, 2009, at 9:37 AM, Kyle Sluder wrote: On Mon, Nov 9, 2009 at 9:28 AM, Douglas Davidson ddavi...@apple.com wrote: Yes, that's correct. Within a given text view, the character indexes are the same between the text storage and its underlying string, and these are the character

Cocoa Sounds

2009-11-09 Thread Chunk 1978
one thing i've always had an issue with is sound lag, which always (yet only) happens during a first sound. after the initial lag, sounds will play on time. at first i though it was my code, but recently i've noticed that it happens in Calculator. if you open Calculator, then choose Speech

Re: NSTreeController and object retain counts

2009-11-09 Thread Mads Paulin
Hi, What I initally did was exactly to log from the dealloc method of my node class. Experiencing that it never got called, I started to log from retain and release to try to get deeper into the problem. I stumbled on the problem when integrating some C++ code into my cocoa project.

Adding new rules to policy database

2009-11-09 Thread Mazen M. Abdel-Rahman
Hi All, I know that one can add a new right specification to the policy database via the function AuthorizationRightSet. Is there any functions or APIs for adding new rule specifications? I want to create a new group - and allow only members of that group to access parts of my

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Thomas Wetmore
Yes, yours is much nicer. TW On Nov 9, 2009, at 12:32 PM, Alastair Houghton wrote: On 9 Nov 2009, at 17:20, Thomas Wetmore wrote: I offer the following as a Cocoa solution to the OP's query, whatever that might be taken to mean... (For extra credit: why must the parameter be unsigned?)

Re: Less verbose way to localize a string with a default value?

2009-11-09 Thread BJ Homer
You can use the -s flag to genstrings to tell it to use your own prefix instead of NSLocalizedString. For example, passing -s MyString would catch calls to MyString(), MyStringFromTable(), MyStringWithDefaultValue(), etc. However, these functions must take the same arguments as the default

Core Data Disable Undo

2009-11-09 Thread Richard Somers
How do you insert an object into a managed object context with undo disabled? I have objects that are added to a new document that need to be there but should not make the document dirty or be undoable by the user. Richard ___ Cocoa-dev mailing

Re: Cocoa Sounds

2009-11-09 Thread Chunk 1978
humm... i'm running 10.5.8 on 2008 iMac C2D, but i never though it could have been the computer. would like to hear from others. On Mon, Nov 9, 2009 at 1:18 PM, Klaus Backert klaus.back...@t-online.de wrote: On 9 Nov 2009, at 18:58, Chunk 1978 wrote: one thing i've always had an issue with

Re: Cocoa Sounds

2009-11-09 Thread Shawn Erickson
On Mon, Nov 9, 2009 at 10:25 AM, Chunk 1978 chunk1...@gmail.com wrote: humm... i'm running 10.5.8 on 2008 iMac C2D, but i never though it could have been the computer. would like to hear from others. What sound API are you using? -Shawn ___

Re: Cocoa Sounds

2009-11-09 Thread Chunk 1978
i'm using Cocoa's NSSound. here's is how i play sounds: -=-=-=-=- if ([[soundRadioGroup cellWithTag:1] state] == NSOnState) { NSSound *theSound = [NSSound soundNamed:@mySound.m4a]; if ([theSound isPlaying]) [theSound stop]; [theSound play]; } -=-=-=-=- the first sound is always

Re: Cocoa Sounds

2009-11-09 Thread Dave DeLong
That makes sense, because NSSound has to go find the resource named mySound.m4a, load it into memory, and then play it. Have you tried preloading the sound, so that by the time you want to play it, it's already in memory? Dave On Nov 9, 2009, at 11:37 AM, Chunk 1978 wrote: i'm using

Re: Cocoa Sounds

2009-11-09 Thread Chunk 1978
also, i tried implementing a dummy sound (dead air .m4a file) during application launch, but that didn't help. the first real sound is still always lagged. On Mon, Nov 9, 2009 at 1:37 PM, Chunk 1978 chunk1...@gmail.com wrote: i'm using Cocoa's NSSound. here's is how i play sounds: -=-=-=-=-

Re: Cocoa Sounds

2009-11-09 Thread Klaus Backert
On 9 Nov 2009, at 19:25, Chunk 1978 wrote: humm... i'm running 10.5.8 on 2008 iMac C2D, but i never though it could have been the computer. would like to hear from others. Did you check whether there are certain special processes running on your machine? Klaus

Re: Core Data Disable Undo

2009-11-09 Thread BJ Homer
[[managedObjectContext undoManager] disableUndoRegistration]; -BJ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Re: Core Data Disable Undo

2009-11-09 Thread Kyle Sluder
On Mon, Nov 9, 2009 at 10:20 AM, Richard Somers rsomers.li...@infowest.com wrote: How do you insert an object into a managed object context with undo disabled? The NSPersistentDocument Core Data tutorial tells you exactly how to do it:

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Jeffrey Oleander
On Mon, 2009/11/09, Alastair Houghton alast...@alastairs-place.net wrote: From: Alastair Houghton alast...@alastairs-place.net Subject: Re: beginner question, NSNumber, NSDecimalAsNumber To: Thomas Wetmore t...@verizon.net Cc: list-cocoa-dev List cocoa-dev@lists.apple.com Date: Monday, 2009

Re: Cocoa Sounds

2009-11-09 Thread Sean McBride
On 11/9/09 12:58 PM, Chunk 1978 said: one thing i've always had an issue with is sound lag, which always (yet only) happens during a first sound. after the initial lag, sounds will play on time. at first i though it was my code, but recently i've noticed that it happens in Calculator. if you

Re: Creating a small timer?

2009-11-09 Thread Jens Alfke
On Nov 9, 2009, at 9:19 AM, Michael Abendroth wrote: How can I create such a timer? I mean, it probably isn't very efficient to redraw the whole view every second just to get the timer to update. Drawing a view once a second shouldn't be a problem. Look at all the stuff iTunes' pseudo-LCD

Re: NSString of selected text in NSTextView

2009-11-09 Thread Kyle Sluder
On Mon, Nov 9, 2009 at 9:50 AM, Douglas Davidson ddavi...@apple.com wrote: Please do. Filed as 7377361. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: Compile error using @synchronized on methods that return values

2009-11-09 Thread Jens Alfke
On Nov 8, 2009, at 12:11 PM, Stuart Malin wrote: But I suspect that from the posters comments in the post I reference below, it isn't a bug. The problem is, you can't return up the calling chain while being synchronized. Do whatever work it is that needs to be performed in a synchronized

Re: Pausing an NSThread

2009-11-09 Thread Jens Alfke
On Nov 8, 2009, at 2:17 AM, Roland King wrote: Or look at NSOperation/NSOperationQueue which absolves you of the need to care about threads, it's done for you (and I believe makes use of Grand Central Dispatch on current versions of OSX). Just package up whatever it is you need to do and

Re: Cocoa Sounds

2009-11-09 Thread Chunk 1978
i dont' believe there are any special processes running, but this iMac has always had issues since i got it. i've had it fixed 3 times for problems concerning the screen and video card, it's broken again so i'm scheduled to have it entirely replaced. perhaps there are some other underlying

Re: Cocoa Sounds

2009-11-09 Thread Sean McBride
On 11/9/09 10:50 AM, Jens Alfke said: I ran into this too. A decent workaround is to preload the sound: create an NSSound object for the audio file you want to play, set its volume to zero, then play it. After that it's warmed up and will play instantly. I just tried this, and it seems to work

Re: Cocoa Sounds

2009-11-09 Thread Jens Alfke
I ran into this too. A decent workaround is to preload the sound: create an NSSound object for the audio file you want to play, set its volume to zero, then play it. After that it's warmed up and will play instantly. (Actually not entirely instantly on laptops, which will turn off the

Trouble with initial position of NSScrollView

2009-11-09 Thread Oftenwrong Soong
Hi all, My app's UI was swapping views into a NSBox (a la Hillegass's book). Now I decided to replace the NSBox with a NSScrollView. No big difference there. I only made three changes: In IB, I got rid of the NSBox and dropped a NSScrollView in its place. In my document controller class, I

Re: iPhone: NSOperation and UITableVIews

2009-11-09 Thread John Michael Zorko
Dave, Alex ... An alternative implementation might be to have each cell queue up an operation when it needs to load an image (not the view controller). Then, each cell could cancel it's operation in [UITableViewCell prepareForReuse]. Cool -- I learned something today :-) I did this,

NSArrayController -addObjects and undo

2009-11-09 Thread jonat...@mugginsoft.com
My Entry objects are an NSManagedObject subclass. I create an NSArray of N Entries and add them to my array controller like so. [self.arrayController addObjects:newEntries]; I am observing [self.arrayController arrangedObjects] and receive a single observation following the above call.

[iPhone] EditableDetailView sample code

2009-11-09 Thread Tharindu Madushanka
Hi I am finding it difficult to find previous sampe codes in apple site. How can I find sample code for Editable Detail View Kind Regards, Tharindu Madushanka ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: Core Data Disable Undo

2009-11-09 Thread Richard Somers
On Nov 9, 2009, at 11:46 AM, BJ Homer wrote: [[managedObjectContext undoManager] disableUndoRegistration]; Thank you. On Nov 9, 2009, at 11:49 AM, Kyle Sluder wrote: The NSPersistentDocument Core Data tutorial tells you exactly how to do it:

avoiding spagetti code

2009-11-09 Thread Oftenwrong Soong
Hi all, In the MVC style, I want to avoid connecting directly between a view and a model. However I have a custom NSView subclass that renders a graphical view of the model and therefore it needs information from the model. I think it is considered bad practice to put a pointer to the model

Re: avoiding spagetti code

2009-11-09 Thread Jason Stephenson
Oftenwrong Soong wrote: Hi all, In the MVC style, I want to avoid connecting directly between a view and a model. However I have a custom NSView subclass that renders a graphical view of the model and therefore it needs information from the model. I think it is considered bad practice to put

Re: avoiding spagetti code

2009-11-09 Thread Richard Somers
On Nov 9, 2009, at 3:04 PM, Oftenwrong Soong wrote: In the MVC style, I want to avoid connecting directly between a view and a model. However I have a custom NSView subclass that renders a graphical view of the model and therefore it needs information from the model. I think it is

Re: Trouble with initial position of NSScrollView

2009-11-09 Thread Graham Cox
On 10/11/2009, at 7:10 AM, Oftenwrong Soong wrote: Unfortunately each time I swap a view, the vertical scrollbar goes all the way to the bottom, meaning that I have to manually scroll back up to bring the view into view. What did I do wrong? Nothing, as far as I can see. But

Re: avoiding spagetti code

2009-11-09 Thread Rob Keniger
On 10/11/2009, at 8:04 AM, Oftenwrong Soong wrote: In the MVC style, I want to avoid connecting directly between a view and a model. However I have a custom NSView subclass that renders a graphical view of the model and therefore it needs information from the model. I think it is

Re: Cocoa Sounds

2009-11-09 Thread Chunk 1978
so, is there some other lightweight 3rd party framework that could substitute for cocoa's NSSound? On Mon, Nov 9, 2009 at 2:40 PM, lbland lbl...@vvi.com wrote: hi- On Nov 9, 2009, at 12:58 PM, Chunk 1978 wrote: one thing i've always had an issue with is sound lag, which always (yet only)

Re: Cocoa Sounds

2009-11-09 Thread Sean McBride
On 11/9/09 6:25 PM, Chunk 1978 said: so, is there some other lightweight 3rd party framework that could substitute for cocoa's NSSound? Did you try the workaround Jens and I suggested? Did you look at CoreAudio, as I also suggested? There's also:

Re: [iPhone] EditableDetailView sample code

2009-11-09 Thread Chunk 1978
Dave Mark and Jeff LaMarche wrote a pretty awesome book called Beginning iPhone Development which covers editable detail views. def check out the book. you can download source code on the product's website, but you have to register with the forums to do so. the book is really great, though. you

Re: Cocoa Sounds

2009-11-09 Thread Chunk 1978
thanks. haven't had time to test the workaround yet. i'll check out coreaudio. On Mon, Nov 9, 2009 at 6:32 PM, Sean McBride s...@rogue-research.com wrote: On 11/9/09 6:25 PM, Chunk 1978 said: so, is there some other lightweight 3rd party framework that could substitute for cocoa's NSSound?

Re: Cocoa Sounds

2009-11-09 Thread Jens Alfke
On Nov 9, 2009, at 3:35 PM, Chunk 1978 wrote: thanks. haven't had time to test the workaround yet. i'll check out coreaudio. You really don't want to get into CoreAudio unless you're planning on doing some serious audio work. The APIs are low-level and complex and will take quite a

Re: Cocoa Sounds

2009-11-09 Thread Chunk 1978
i've also only read about the complexity of OpenAL, which i assume is even more low level in the sense that CoreAudio to OpenAL it's anologous to CoreAnimation to OpenGL. regardless, is this NSSound lag a filed bug? it's seems really unfortunate that there is a 1-second lag in loading/executing

Re: code data export import strategies

2009-11-09 Thread Rob Keniger
On 09/11/2009, at 5:03 PM, Martin Hewitson wrote: Thanks, Rob. I do have this book, but I sort of skipped the section about multithreading (where the export example is buried), but I've found it now. Yes, it's kind of a shame that it's buried in there. I initially skipped it too. In my

Re: Cocoa Sounds

2009-11-09 Thread Jens Alfke
On Nov 9, 2009, at 4:43 PM, Chunk 1978 wrote: i've also only read about the complexity of OpenAL, which i assume is even more low level in the sense that CoreAudio to OpenAL it's anologous to CoreAnimation to OpenGL. Not really; it might even be the other way around. OpenAL is a cross-

Re: Cocoa Sounds

2009-11-09 Thread Matt Neuburg
On Mon, 9 Nov 2009 14:16:14 -0500, Sean McBride s...@rogue-research.com said: On 11/9/09 10:50 AM, Jens Alfke said: I ran into this too. A decent workaround is to preload the sound: create an NSSound object for the audio file you want to play, set its volume to zero, then play it. After that it's

Re: Cocoa Sounds

2009-11-09 Thread Damien Cooke
Hi all, I may be way off but in my iPhone game I used SystemSoundID and AudioServicesCreateSystemSoundID I am not sure if that is helpful at all but it did not seem to have a delay but it does not support many formats either. So if you are happy to convert your format this may be an

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Andrew Farmer
On 9 Nov 2009, at 10:49, Jeffrey Oleander wrote: Last I looked, 1-bit count was an assembly/ hardware instruction. Getting the highest order on-bit required a little cleverness. Take a look at __builtin_clz(). (It maps to 'bsr' on x86.) ___

View swap using push animation

2009-11-09 Thread PCWiz
I want to swap out one view with another by pushing the old view aside to slide in a new view (the kCATransitionPush type). To use CoreAnimation I need to work with CALayers for my views. The problem is that attaching a backing layer to my window content view through setWantsLayer distorts