Re: LOCATING MEDIA FILES IN MACINTOSH
on 1/7/11 6:19 AM, Alastair Houghton at alast...@alastairs-place.net wrote: On 6 Jan 2011, at 20:54, Abhinav Tyagi wrote: 1) I need an efficient approach to solve this problem using Cocoa or C++. (very Important) 2) How will check a file if its a valid media file or data file. Like we can have .dat files that are video files but data files can also have .dat extension. not much significant. Is there api that can tell whether a file is media file or not? (not s important). Why not use NSMetadataQuery to get Spotlight to search for you? If you search for Technical Note TN2192 in the documentation, you'll find some sample code. The Spotlight Overview and Spotlight Query Programming Guide look useful too. I was about to suggest the same thing, using the Metadata.framework (Spotlight). It's going to generally be the fastest and most robust way to accomplish this. The main limitation is Spotlight can only return data that it knows about. So if it's not indexed, you'll never know about that. How much does this matter? Depends upon the OP's design constraints. If he needs to absolutely know every media file on the computer no matter what and where they are, you just have to manually scan the filesystem and use some sort of heuristics to determine is this a media file, and if so what kind (QuickTime can help with this, somewhat). -- John C. Daub }:-)= mailto:h...@hsoi.com http://www.hsoi.com/hsoi/blog/ A pessimist is one who makes difficulties of his opportunities and an optimist is one who makes opportunities of his difficulties. --Harry Truman ___ 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
Can you obtain the NSRuleEditor localized display?
Can you obtain the localized display of an NSRuleEditor? I have an NSRuleEditor displaying my rule setup. The app has functionality where it provides a text summary of the search rules that generated the results. When I call -[NSRuleEditor displayValuesForRow:], that returns the actual display value objects, which is expected. Of course, NSRuleEditor has magical voodoo where if you set a -formattingDictionary those displayValues will be magically translated according to the -formattingDictionary when the values are displayed in the GUI. I have set a formatting dictionary on my NSRuleEditor, and in the GUI presentation of things everything looks right as as I'd expect. What I'm wanting is to obtain the magically formatted values the GUI is actually displaying, so when the app is running in English my summary string is name contains foo, and when the app is running in Japanese I get お名前 は「foo」が入っている (name foo contains). I can't see any way to extract the actual displayed GUI (post-formatting), other than obtaining the criteria or displayValues myself, obtaining the formattingDictionary myself, and doing all the heavy lifting. Hoping I may be overlooking something or maybe there's a nice trick I could use. I need to run on 10.5, but if there's a 10.6-and-later-only solution that could be acceptable. Thank you. -- John C. Daub }:-)= mailto:h...@hsoi.com http://www.hsoi.com/hsoi/blog/ We live thinking we will never die. We die thinking we had never lived. Cut it out. -- Jason Becker ___ 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: Can you obtain the NSRuleEditor localized display?
on 3/10/10 6:01 PM, Peter Ammon at pam...@apple.com wrote: On Mar 10, 2010, at 11:30 AM, John C. Daub wrote: Can you obtain the localized display of an NSRuleEditor? [...] I can't see any way to extract the actual displayed GUI (post-formatting), other than obtaining the criteria or displayValues myself, obtaining the formattingDictionary myself, and doing all the heavy lifting. Hoping I may be overlooking something or maybe there's a nice trick I could use. I need to run on 10.5, but if there's a 10.6-and-later-only solution that could be acceptable. Sorry, there's no easy way to do this. That's what I thought. :-( Bummer. rdar://problem/7741182 -- John C. Daub }:-)= mailto:h...@hsoi.com http://www.hsoi.com/hsoi/blog/ Peace sells... but who's buying? ___ 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
QTMovieView - control-click vs. right-click give different behavior?
Hello. I am using a QTMovieView to play back a movie. I wish for there to be no chance of user interaction with the movie: pure playback. The behavior is window shows, movie auto-plays (QTMovieView takes up the whole of the window content area), when movie is done the window closes. I noticed if I clicked on the movie that it would stop the playback. I didn't want this. So I subclassed QTMovieView and added empty overrides for: -mouseDown: -rightMouseDown: -otherMouseDown: -mouseUp: -rightMouseUp: -otherMouseUp: -scrollWheel: The methods are totally stubbed out, they are empty and do nothing. This does seem to stop any sort of user interaction. FWIW, I have also set the view to be not editable, disabled, no playback controls. But I noticed an interesting thing. If I right-click, there's no contextual playback menu displayed. But if I control-(left) click, the playback menu is displayed. How is this happening? How is it that I have stubbed out all of the various mouse methods yet a control-click gets through? And how can I get it to stop? As well, are there any other subtle user-interaction approaches that I may need to add to my stub-out list? Thank you. -- John C. Daub }:-)= mailto:h...@hsoi.com http://www.hsoi.com/hsoi/blog/ History shows that when government gains the power to monitor the actions of the people, it inevitably uses that power in harmful ways. -- Ron Paul ___ 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: QTMovieView - control-click vs. right-click give different behavior?
on 6/24/09 2:50 PM, John C. Daub at h...@hsoi.com wrote: I am using a QTMovieView to play back a movie. I wish for there to be no chance of user interaction with the movie: pure playback. The behavior is window shows, movie auto-plays (QTMovieView takes up the whole of the window content area), when movie is done the window closes. I noticed if I clicked on the movie that it would stop the playback. I didn't want this. So I subclassed QTMovieView and added empty overrides for: -mouseDown: -rightMouseDown: -otherMouseDown: -mouseUp: -rightMouseUp: -otherMouseUp: -scrollWheel: The methods are totally stubbed out, they are empty and do nothing. This does seem to stop any sort of user interaction. FWIW, I have also set the view to be not editable, disabled, no playback controls. But I noticed an interesting thing. If I right-click, there's no contextual playback menu displayed. But if I control-(left) click, the playback menu is displayed. How is this happening? How is it that I have stubbed out all of the various mouse methods yet a control-click gets through? And how can I get it to stop? Answering my own question. I added an override for -(NSMenu*)menuForEvent:(NSEvent*)theEvent;, just stubbing it out, doing nothing, returning nil. It works out fine and seems to solve my problem. As well, are there any other subtle user-interaction approaches that I may need to add to my stub-out list? Still, I'd be curious if there might be any further subtle behaviors I need to override/stub-out for QTMovieView so that it's purely watch only. Thanx. -- John C. Daub }:-)= mailto:h...@hsoi.com http://www.hsoi.com/hsoi/blog/ When a country falls into chaos, patriotism is born. -- Tao Te Ching #18 ___ 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
System Preferences halo/spotlight effect
Hello. In Leopard's System Preferences application, when you type into the search field in the toolbar it presents a list of helpful keywords. In addition, the content area of the window dims and a halo/spotlight effect appears over each icon that is a possible match for what's being typed. I'm trying to replicate that overlay halo/spotlight behavior, in a similar sort of window (window full of icons). I'm seeking guidance in how to achieve this. I'm figuring in System Preferences it's using an overlay window, but since my content scrolls I cannot use a window and must use an NSView. I did find -[NSView addSubview:positioned:relativeTo:], which helped me position my halo view atop my contents, and I have been fiddling around with various things trying to accomplish the effect but I can't quite get there. I do see within System Preferences.app/Contents/Resources/ a spotlight.tif and spotlightdim.tif which provide the halo masking, and I experimenting with rendering copies of those TIFF's via -drawAtPoint:fromRect:operation:fraction: within my -[HaloView drawRect:] and I could sorta get things to work with a fraction of 0.5. But that just gives me the halo. I'm struggling to get the fill over the full content area, that then doesn't affect the halo areas. So I'm just looking for pointers on how to accomplish this. Am I just overlooking the right combination of fills, strokes, alpha, NSBezierPath's, and compositing? Do I need to look at OpenGL (never used it before)? Core Image? Would things like -[NSView contentFilters] help me here? Never used them before, tho I'm reading documentation. Some other approach entirely? In all my years of programming I've never had to do a graphical effect like this so I'm a little lost as to the direction to go. Thank you for your assistance. -- John C. Daub }:-)= mailto:h...@hsoi.com http://www.hsoi.com/hsoi/blog/ You can believe you can, or you can believe you can't; either way you will be correct. -- Henry Ford. ___ 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: System Preferences halo/spotlight effect
on 2/13/09 10:26 AM, Kyle Sluder at kyle.slu...@gmail.com wrote: On Fri, Feb 13, 2009 at 7:51 AM, John C. Daub h...@hsoi.com wrote: I'm figuring in System Preferences it's using an overlay window, but since my content scrolls I cannot use a window and must use an NSView. I did find -[NSView addSubview:positioned:relativeTo:], which helped me position my halo view atop my contents, and I have been fiddling around with various things trying to accomplish the effect but I can't quite get there. I do see within System Preferences.app/Contents/Resources/ a spotlight.tif and spotlightdim.tif which provide the halo masking, and I experimenting with rendering copies of those TIFF's via -drawAtPoint:fromRect:operation:fraction: within my -[HaloView drawRect:] and I could sorta get things to work with a fraction of 0.5. But that just gives me the halo. I'm struggling to get the fill over the full content area, that then doesn't affect the halo areas. 1) Why can't you use an overlay window? Just convert to window coordinates and clip appropriately when objects are out of view. Is there some particular reason why I ought to use an overlay window and not just an NSView added via -addSubview:positioned:relativeTo: NSWindowAbove relative to my content view? 2) If you want to go the image route, I'd use a Quartz mask. Saves you from having to render the blur at runtime. Adam R. Maxwell posted another reply and I took his approach. Thanx for the reply. -- John C. Daub }:-)= mailto:h...@hsoi.com http://www.hsoi.com/hsoi/blog/ Too numb to cry, too tough to die. - BLS ___ 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: System Preferences halo/spotlight effect
on 2/13/09 10:41 AM, Adam R. Maxwell at amaxw...@mac.com wrote: On Feb 13, 2009, at 4:51 AM, John C. Daub wrote: I'm trying to replicate that overlay halo/spotlight behavior, in a similar sort of window (window full of icons). I'm seeking guidance in how to achieve this. I did this on an OmniAppKit preference window, and it works pretty well using an overlay window and custom view. Code is all BSD licensed: View: http://bibdesk.svn.sourceforge.net/viewvc/bibdesk/trunk/bibdesk/BDSKSpotlightV iew.m?view=markup Controller: http://bibdesk.svn.sourceforge.net/viewvc/bibdesk/trunk/bibdesk/BDSKPreference Controller.m?view=markup Overlay window: http://bibdesk.svn.sourceforge.net/viewvc/bibdesk/trunk/bibdesk/BDSKOverlay.m? view=markup Thank you for this! I didn't use your code directly, but I followed what you did in the BDSKSpotlightView source along with little bits from the other 2 and was able to get something going. It's just proof of concept and plugging it into my code right now, so I still have much work to do to get it working just right for my needs. But this is exactly the sort of thing I needed. Thank you for your help and for sharing this with me. -- John C. Daub }:-)= mailto:h...@hsoi.com http://www.hsoi.com/hsoi/blog/ Nothing is greater than love or surrender. -- Buddo ___ 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: AppleScript Support with Plugin
on 3/13/08 1:42 PM, Herr Thomas Bartelmess at [EMAIL PROTECTED] wrote: Thanks for your Help everyone. I haven't get what i needed yet. I have to write a plugin for an application (Daylite from Marketcircle). An this plugin should extend the scripting commands (Incoming Call). So i have to extend the .sdef file from a plug-in. Thanks for any help from anyone Ah I don't know how you'd accomplish that. I believe somehow the parent application (Daylite) would have to be scriptable itself or at least aware it's plugins were scriptable so it knew to load up the scripting definitions from the plugins and expose them to the greater OSA architecture. My app that I'm making scriptable is an app shell with lots of plugins, scripting functionality in both the app itself and the plugins, but I control all pieces. And I do have to make my app manually synthesize the main sdef from the app and plugin sdef files. See those URL's I sent you for how to do this. But again, if that Daylite app isn't scriptable or aware of its plugins being scriptable, not sure how to accomplish this. You could always contact the developers of Daylite and ask them. -- John C. Daub }:-)= mailto:[EMAIL PROTECTED] http://www.hsoi.com/ I hold all the combinations to give you peace of mind. - Dave Wyndorf ___ 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 [EMAIL PROTECTED]