Need advice on buying an MP Mac & video boards for OS X development
-
I'm buying a new Mac for OS X development - on a budget - and I wanted to
pick the brains of this group. I've settled on a dual 450 now that the
prices are bottoming, but I have a few questions in the realm of digital
video and multiple monitors.
I'd like to start with a two monitor system and move up from there later,
so the question is what board(s) are best? I understand OS X has a spotty
record with multiple monitors and there's considerable difference in what
they each can accelerate, so I'd like to know what to expect. It would be
nice if they accelerated Quicktime (decoding + masked copybits, sprites) &
Quickdraw and featured rudimentary, full-screen video input-output. I'd
like to input video, alter it and then write it back out to make demos, but
I don't need anything fancy. I could care less about one dropped frame in
twenty ("that '60s spacewalk look," as Dennis Hopper puts it) and I could
really care less about 3D performance.
I had thought of getting two different boards so that I'd be able to test
software for different systems, but I understand there may be
incompatibilities. At any rate, I only need video out on one of them.
Are there limits, by the way, to the number of monitors I can have on an OS
X box? The old Quickdraw keeps it to four, but I can see situations where
I'd like to have one Mac driving more than that in a video wall. The
alternative would be networking them, which I suppose I may have to do
anyway if the bus gets saturated with too much video playback.
To all Apple's eavesdropping propellerheads out there, I wish to say some
of us actually still use Quickdraw. Are there any plans to port the code
to run off the graphics coprocessors or is 3D all there is these days? It
seems ironic that very sophisticated 3D work can run faster than a few
simple, if ponderous, 2D operations. (I'd use GL for the 2D but it doesn't
meet my needs; neither does pdf.) If you answer that prayer, would you
please consider consolidating the bitmap APIs so that CoreGraphics can have
the same features as Quickdraw?
As a last resort, which graphics boards are programmable and are there any
OS X kits for them? Any sites which contain generic low level source for
2D primitives like polygon fills, spline clipping, etc. that I can alter to
my needs in case I can get just a few of my tasks recoded for the
coprocessor?
Finally, I'd like to design software that complements existing DJ jukebox
players on the market. How do you tap the sound stream flowing out to the
speakers for some serious filtering? I'd like to not have to worry about
whether it's a movie soundtrack being played back an .mp3 or something
proprietary from Micro$oft. I would, though, also like to know how to tap
an out-going MIDI stream since that does already preserve information about
the notes, etc. I realize this question has been asked before on the list,
but if it's been answered, it's slipped by me in the volume of mail I
delete every day.
Anybody out there engaged in this kind of development on OS X?
Oh, yeah. And if there's ways to do any of this in Carbon, let me know. I
still entertain delusions of organic grandeur.
By the way, anybody ever answer Andrew Welch's question about unbuffered
windows or have my messages from the Mesozoic not finished trickling in?
Thanks in advance.
Wade Riddick
P.S. Gore won the undervote recount. You've been lied to by Republican
publishers.
http://www.consortiumnews.com/040601a.html
http://www.consortiumnews.com/040501a.html
"They elected the symbol of Ebonics to the presidency of this nation.
There ain't no brother in Oakland, or anywhere else, that would run the
phrase or mix up the words the way this cat does. It raises serious
questions about whether he's really white."
- San Francisco Mayor Willie Brown -
I have a NSView subclass that has a default behavior when the user
mouses down and drags around; it pans the image in a scrollview. I
would like it if the user mouses down and then lingers (i.e. click and
hold) for a bit (say a second), that the view would then initiate a drag
session, so that the user could drag the image out of the view.
I've done this kind of thing before on other systems in a
single-threaded way, but I'm clearly missing something on Cocoa. Here's
what I'm doing:
The basic idea is at the beginning of the mouseDown, set up a timer to
fire at some near point in the future, and then while in the rest of the
mouseDown method, cancel this timer if we decide to do something, but
otherwise leave it alone, where a mouseUp will cancel it.
given:
SEL s = @selector(startDrag:);
_startImageDragTimer = [[NSTimer scheduledTimerWithTimeInterval:1.0f
target:self selector:s userInfo:nil repeats:NO] retain];
The problem seems to be that while in the standard Cocoa get next event
pattern:
NSPoint pp = [theEvent locationInWindow];
while (1) {
NSEvent* e = [[self window]
nextEventMatchingMask:(NSLeftMouseDraggedMask | NSLeftMouseUpMask)];
[self _cancelDragSourceTimer];
if ([e type] == NSLeftMouseDragged) {
NSPoint p = [e locationInWindow];
NSPoint delta = NSMakePoint((p.x - pp.x), (p.y - pp.y));
[self _scrollBy:delta];
pp.x = p.x;
pp.y = p.y;
}
if ([e type] == NSLeftMouseUp) {
break;
}
}
I would expect my timer to get fired if I didn't move my mouse after
mouseDown: (i.e. that the NSRunLoop that the window is polling for
events would fire it after a second), but it doesn't. It will fire
after I mouse up (if I don't cancel it, i.e. I comment out the
_cancelDragSourceTimer call), but that doesn't do me any good (since the
mouse is up, the drag is canceled, and the image animates back).
I know I must be missing something easy here...
--> Michael B. Johnson, Ph.D. -- <wave...>
--> Studio Tools, Pixar Animation Studios
--> http://xenia.media.mit.edu/~wave -
In this case do not write your own event loop inside mouseDown:
Use the -mouseDragged: method of NSResponder to handle drags.
Call [self performsSelector:@selector(someSelector) withObject:anObject
afterDelay:1.0] inside -mouseDown:
In -mouseDragged: call [[self class]
cancelPreviousPerformRequestWithTarget:self
selector::@selector(someSelector) object:anObject] and then do any
dragging that you want to handle.
In a single threaded application, if you sit in a tight loop handling mouse
dragged events then the main run loop will not get any CPU and the timer
will not fire. Let the AppKit handle the mouse event loop and you do your
work in response to -mouseDragged: messages. -
On Sunday, April 15, 2001, at 03:51 , Michael B. Johnson wrote:> I would expect my timer to get fired if I didn't move my mouse after
> mouseDown: (i.e. that the NSRunLoop that the window is polling for
> events would fire it after a second), but it doesn't. It will fire after
> I mouse up (if I don't cancel it, i.e. I comment out the
> _cancelDragSourceTimer call), but that doesn't do me any good (since the
> mouse is up, the drag is canceled, and the image animates back).
> I know I must be missing something easy here...
Not obvious. What you need to do is set up a periodic event. You set an
initial delay and then a very long interval.
[NSEvent startPeriodicEventsAfterDelay:delay withPeriod:interval];
while (1) {
NSEvent* event = [[self window]
nextEventMatchingMask:(NSLeftMouseDraggedMask | NSLeftMouseUpMask |
NSPeriodicMask)];
if ([event type] == NSPeriodic) ...
....
}
[NSEvent stopPeriodicEvents];
Andrew
__________________________________________________________________
A n d r e w P l a t z e r
A p p l i c a t i o n F r a m e w o r k s
A p p l e -
Hi there,
Does anyone know how to get the locations of all windows on the desktop?
(I mean, all the windows of all launched applications.) I believe that
I have ever seen that method for OPENSTEP or Rhapsody, however I can't
remember it now... I am sorry if this is a FAQ.
Thanks,
Takashi Hamada -
On Sunday, April 15, 2001, at 03:51 PM, Michael B. Johnson wrote:> SEL s = @selector(startDrag:);
> _startImageDragTimer = [[NSTimer
> scheduledTimerWithTimeInterval:1.0f target:self selector:s userInfo:nil
> repeats:NO] retain];
This schedules the NSTimer in the default run loop mode
(scheduledTimer.... is a convenience).> NSEvent* e = [[self window]
> nextEventMatchingMask:(NSLeftMouseDraggedMask | NSLeftMouseUpMask)];
This runs the run loop in the NSEventTrackingRunLoopMode, which is not
obvious.
Either:
- use -[NSApplication nextEventMatchingMask:....], though that may allow
some things to happen that you don't want to happen, or
- use +timerWithBlahBlah:... instead of the "scheduled" variant, then
schedule the timer yourself with NSRunLoop's addTimer:.... API to the
desired modes, or
- use +timerWithBlahBlah:... instead of the "scheduled" variant, then
schedule the timer yourself with NSRunLoop's addTimer:.... API to the
kCFRunLoopCommonModes mode.
Chris Kane
Cocoa Frameworks, Apple, Inc. -
Hi,
I also interested in it. It seems that NSCountWindows() and
NSWindowList() are available for the count of windows and window
numbers. But I can't tell how to get window infos from the window
number.
Wierdly, the documents say that above functions handle the windows of
an application, in real, they return all windows. Also, I can't find
NSConvertGlobalToWindowNumber() function which described in the doc.
Someone, please shed the light on this issue?> Hi there,desktop?
>
> Does anyone know how to get the locations of all windows on the> (I mean, all the windows of all launched applications.) I believethat> I have ever seen that method for OPENSTEP or Rhapsody, however Ican't> remember it now... I am sorry if this is a FAQ.
>
> Thanks,
>
> Takashi Hamada
>
---
[objC retain];
Tetuya TAKEO
<ttakeo...> (NeXTmail/MIME accepted) -
>> Does anyone know how to get the locations of all windows on the
> desktop?
>> (I mean, all the windows of all launched applications.) I believe
> that
I hit on a good idea to accomplish this. I suppose that I should
do the following two steps:
1. Get the list of instances of all launched applications.
(This topic was discussed yesterday. Space.app is actually
doing this.)
2. Get the windows list of each application by using
'windows' method of NSApplication.
But, ideal solution for me is [NSWindowServer windows]. If it existed.
Takashi Hamada


