Re: what should I understand from kAudioQueueProperty_CurrentLevelMeterDB

2011-05-09 Thread Graham Cox

On 08/05/2011, at 8:28 PM, Niran Bala wrote:

 How should I interpret this value?
 
 When I mute the Mic on my laptop, this value is -120


My GUESS (only) would be that this is the line level, which is logical, since 
it couldn't possibly be actual sound pressure level, since the signal is 
amplified through some unknown amplifier and speaker system before becoming 
sound.

Decibels are only a relative measurement, there's not really any such thing as 
a decibel as a physical quantity. You can express a relative measurement in 
terms of decibels, or you can qualify the level against some reference standard 
in decibels, for example 1dBm is 1mW of power, and the ear-splitting 120dB SPL 
is referenced to a pressure of 20 micropascals rms.

You need to find in the documentation or ask what 0dB is considered to be in 
this measurement system.

--Graham


___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTextView and NSTextContainer size clipping area

2011-05-09 Thread Rimas M.
As far as I remember, text container inset sets margins from both sides:
left and right and/or top and bottom. If text container position is
important according to the text view, this will not work.

2011/5/8 Kyle Sluder kyle.slu...@gmail.com

 On May 8, 2011, at 3:27 AM, Дмитрий Николаев blacklit...@gmail.com
 wrote:

  Custom textview resize policy set, so it resizes in all dimensions with
 container. This is code for custom NSTextView
 
  -
  - (void) setFrameSize:(NSSize)newSize {
 
[super setFrameSize:newSize];
 
NSTextContainer *container = [self textContainer];
newSize.width -= 200;
[container setContainerSize:newSize];
  }

 Unrelated, by why aren't you just using -[NSTextView
 setTextContainerInset:] and letting the default width-tracking code do the
 work for you?

___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


transitionWithView:duration:options:animations:completion: still defeats me

2011-05-09 Thread Roland King
I seem to have a lot of trouble with this method! A few months ago I had my own 
custom drawRect: and that was messing it up, this time I just have a simple 
UIView with some controls on it, nothing clever. One of the controls is given 
by the property 'complexity'. What I want is for my UIView to rotate and show 
up with/without that control. However whatever I have tried all that happens is 
the control instantly disappears or reappears, no transition at all. Here's the 
code ..

[ UIView transitionWithView:factorsView 
   duration:2.0f 
options:( 
UIViewAnimationTransitionFlipFromRight | 
UIViewAnimationOptionAllowAnimatedContent )
 animations:^{ [ [ factorsView 
complexity] setHidden:![ [ factorsView complexity ] isHidden ] ]; } 
 completion:NULL 
 ];

factorsView is the UIView subclass and it's displayed and it's on screen.

I've tried with and without the AllowAnimatedContent option. The factorsView 
never rotates, it stays right where it is, and the complexity subview just 
winks in and out of existence. 

What do I continue not to understand about this method and what reasons are 
there that I could be getting no actual transition? This is iPad 4.3 if it 
matters but I suspect it does not. 
___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: what should I understand from kAudioQueueProperty_CurrentLevelMeterDB

2011-05-09 Thread Wim Lewis

On 8 May 2011, at 11:07 PM, Graham Cox wrote:
 You need to find in the documentation or ask what 0dB is considered to be in 
 this measurement system.

As I understand it, the 0dB reference for a VU meter is usually the maximum 
volume the system can reproduce without distortion (maybe plus some fudge 
factors).



___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: what should I understand from kAudioQueueProperty_CurrentLevelMeterDB

2011-05-09 Thread Kyle Sluder
On Sun, May 8, 2011 at 3:28 AM, Niran Bala niran_j...@yahoo.com wrote:
 Hi,

 I am trying to measure dB levels of my voice.

This has nothing to do with Cocoa. You should instead ask your
question on the coreaudio-api list.

--Kyle Sluder
___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: transitionWithView:duration:options:animations:completion: still defeats me

2011-05-09 Thread Matt Neuburg

 Date: Mon, 09 May 2011 21:43:38 +0800
 From: Roland King r...@rols.org
 Subject: transitionWithView:duration:options:animations:completion:
   still defeats me
 
 I seem to have a lot of trouble with this method! A few months ago I had my 
 own custom drawRect: and that was messing it up, this time I just have a 
 simple UIView with some controls on it, nothing clever. One of the controls 
 is given by the property 'complexity'. What I want is for my UIView to rotate 
 and show up with/without that control. However whatever I have tried all that 
 happens is the control instantly disappears or reappears, no transition at 
 all. Here's the code ..
 
   [ UIView transitionWithView:factorsView 
  duration:2.0f 
   options:( 
 UIViewAnimationTransitionFlipFromRight | 
 UIViewAnimationOptionAllowAnimatedContent )
animations:^{ [ [ factorsView 
 complexity] setHidden:![ [ factorsView complexity ] isHidden ] ]; } 
completion:NULL 
];
 
 factorsView is the UIView subclass and it's displayed and it's on screen.
 
 I've tried with and without the AllowAnimatedContent option. The factorsView 
 never rotates, it stays right where it is, and the complexity subview just 
 winks in and out of existence. 

The key thing is to ask for the factorsView to be redrawn. Otherwise you're not 
doing anything to it that can trigger animation. In other words, the animation 
block should consist of [factorsView setNeedsDisplay].

http://www.apeth.com/iOSBook/ch17.html#_view_animation

m.___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[ANN] NanoStore 2.0 is now available

2011-05-09 Thread Tito Ciuro
Hello everyone,

Last year I announced NanoStore, a SQLite-based engine to store and retrieve 
dictionaries while fully indexing its contents. NanoStore made some people 
happy, but I quickly realized that it could be better as feedback poured in. 
While NanoStore was simple and fairly efficient, the API could be improved with 
new features. Most important of all, I had to keep it simple. Today I'm happy 
to announce version 2.0, which brings several additions including:

* Storing your own custom objects
* Bags, a free-form relational system
* Dynamic queries
* Expressions and predicates
* Fully documented API

I have written a detailed introduction with more information, examples and 
performance tips. More information can be found below:

Project and Intro page: https://github.com/tciuro/NanoStore
API documentation: 
http://dl.dropbox.com/u/2601212/NanoStore%202.0/html/index.html
NanoStore on Twitter: http://twitter.com/nanostoredev

Why did I write NanoStore? Because I felt that Core Data, while extremely 
powerful, was too complicated to master. Many developers do not want (nor care) 
about database design. A common feature developers wanted was to store data 
organically, that is, as the application evolves without having to revisit the 
schema and having to migrate it time after time. I believe that NanoStore sits 
nicely between SQLite and Core Data. So if you feel that Core Data or SQLite is 
a bit heavy for you, take NanoStore for a spin!

Cheers,

-- Tito
___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: superview

2011-05-09 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

(Putting this back on list for anyone else who is interested; see
additional exchange below.)

As for completing your understanding, this is presumably handled by
private API calls that shouldn't concern you.  (If you really want a
hint as to what might be going on under the hood, grep UIView.h for
'Controller'.)

But in summary: the frameworks are designed to enforce good design and
coding habits, and if you find yourself fighting against them then odds
are you should reconsider your design.

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com


On 5/9/11 3:25 AM, Nelson Hazeltine wrote:
 The only reason to know is to complete my understanding.  It is just
 a dangling thread.
 
 Thanks for your help.
 
 Regards,
 
 Nelson Hazeltine nhazelt...@ivistagroup.com (W) 803-7499629 (M)
 803-315-9092
 
 On May 8, 2011, at 11:33 PM, Conrad Shultz wrote:
 
 The question here is: why do you need to know? That is an
 implementation detail internal to UIView/UIViewController. UIView's
 implementation of the various UIResponder methods should be enough
 to cover your needs.
 
 If your design requires UIView to interrogate its UIViewController
 something is probably wrong. That violates the core MVC design
 pattern; it is the controller's job to setup/configure/tear down
 its views, and the views' job to draw themselves and play their
 part in the responder chain.
 
 -- Conrad Shultz Synthetiq Solutions www.synthetiqsolutions.com
 
 On May 8, 2011, at 19:49, Nelson Hazeltine nhazelt...@sc.rr.com
 wrote:
 
 You answered the right question.
 
 Please help me understand.
 
 How does UIView object point to the UIViewController object?
 There is no property for it.
 
 Regards,
 
 Nelson Hazeltine nhazelt...@ivistagroup.com (W) 803-7499629 (M)
 803-315-9092
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFNyHhuaOlrz5+0JdURAh9+AJ96JrbXCXAnX5nGIAY+n9yG+cEJIQCaAlXx
Rf296uw+Ug+uH7VjTcGftd8=
=hAn3
-END PGP SIGNATURE-
___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


setState has no effect on an NSButton

2011-05-09 Thread Martin Batholdy
Hi,

I have a preference window with four NSButtons that are all connected to a 
method and an IBOutlet:

IBOutlet NSButton *buttonA;
IBOutlet NSButton *buttonB;
IBOutlet NSButton *buttonC;
IBOutlet NSButton *buttonD;
NSUserDefaults *prefs;


Now I would like to set the state of these buttons according to some 
UserDefaults:

-(void)awakeFromNib {

prefs = [NSUserDefaults standardUserDefaults];

BOOL st = [prefs boolForKey:@optionA];
if(st == YES){ [buttonA setState:NSOnState]; }
else if(st == NO){ [buttonA setState:NSOffState]; } 

st = [prefs boolForKey:@optionB]; 
if(st == YES){ [buttonB setState:NSOnState]; }
else if(st == NO){ [buttonB setState:NSOffState]; } 

st = [prefs boolForKey:@optionC]; 
if(st == YES){ [buttonC setState:NSOnState]; }
else if(st == NO){ [buttonC setState:NSOffState]; } 

st = [prefs boolForKey:@optionD]; 
if(st == YES){ [buttonD setState:NSOnState]; }
else if(st == NO){ [buttonD setState:NSOffState]; } 
}


The code is exactly the same. I checked the connections in the interface 
builder twice.
There is no problem with getting the NSUserDefaults values.

But still, only the state of button A and B change according to the st-value.

On button B and C  setState: seems to have no effect at all.
Whatever I send to buttonB and buttonC nothing changes the appearance of this 
buttons in the window.

The code is identical.
There is nothing wrong with the plist and I don`t see any differences in the 
connections in the IBuilder...

When I debug this code I see that buttonA and buttonB have an address.
But buttonC and buttonD seems to have no address (0x0) ...


what could possibly be the problem here ...?


 ___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setState has no effect on an NSButton

2011-05-09 Thread Howard Siegel
From those symptons, it certainly sounds like there is a missing/crossed
connection in IB for those buttons or you are mising @property/@synthesize
lines for those buttons.

- h

On Mon, May 9, 2011 at 18:19, Martin Batholdy batho...@googlemail.comwrote:

 Hi,

 I have a preference window with four NSButtons that are all connected to a
 method and an IBOutlet:

 IBOutlet NSButton *buttonA;
 IBOutlet NSButton *buttonB;
 IBOutlet NSButton *buttonC;
 IBOutlet NSButton *buttonD;
 NSUserDefaults *prefs;

 snip

 When I debug this code I see that buttonA and buttonB have an address.
 But buttonC and buttonD seems to have no address (0x0) ...


 what could possibly be the problem here ...?



___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setState has no effect on an NSButton

2011-05-09 Thread Quincey Morris
On May 9, 2011, at 18:19, Martin Batholdy wrote:

 -(void)awakeFromNib {
 
   prefs = [NSUserDefaults standardUserDefaults];
   
   BOOL st = [prefs boolForKey:@optionA];
   if(st == YES){ [buttonA setState:NSOnState]; }
   else if(st == NO){ [buttonA setState:NSOffState]; } 
 
   st = [prefs boolForKey:@optionB]; 
   if(st == YES){ [buttonB setState:NSOnState]; }
   else if(st == NO){ [buttonB setState:NSOffState]; } 
   
   st = [prefs boolForKey:@optionC]; 
   if(st == YES){ [buttonC setState:NSOnState]; }
   else if(st == NO){ [buttonC setState:NSOffState]; } 
 
   st = [prefs boolForKey:@optionD]; 
   if(st == YES){ [buttonD setState:NSOnState]; }
   else if(st == NO){ [buttonD setState:NSOffState]; } 
 }

What is the class of the object containing this code, and how/when is this 
object created? What class is the nib's File's Owner and how/when is that 
object created, if different from the object containing the above code?

It could well be that your code is being invoked before all of the nib objects 
are instantiated.

If the code's in a window controller, then you should do things like this in a 
'windowDidLoad' override rather than 'awakeFromNib'.

If it's not in a window controller, then using a window controller is probably 
your best strategy anyway. (There's almost no reason ever *not* to use a window 
controller, and plenty of reasons to use one.)


___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setState has no effect on an NSButton

2011-05-09 Thread Graham Cox

On 10/05/2011, at 11:19 AM, Martin Batholdy wrote:

   BOOL st = [prefs boolForKey:@optionA];
   if(st == YES){ [buttonA setState:NSOnState]; }
   else if(st == NO){ [buttonA setState:NSOffState]; } 


Apart from the advice already received, you can reduce this code to:

[buttonA setState:[prefs boolForKey:@foo]? NSOnState : NSOffState];

or even

[buttonA setState:[prefs boolForKey:@foo]];

if you are prepared to accept that NSOnState and NSOffState are 1 and 0 
respectively (which they are, in fact, and unlikely ever to change, but if 
you're paranoid, the first line fixes that).

Why bother? Because it's more readable than all those if/else constructions, 
and hence, less prone to bugs. Also, if( st == YES)...else if(st == NO) is 
redundant - a BOOL can only be YES or NO. The optimiser might optimise away the 
second comparison anyway, but why be windy in the first place?

--Graham


___

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com