cocoa

Retina display support & QCView?

douglasheriot's picture

So, I’ve got my nice new retina display MacBook Pro, and an app I’ve created that displays timers, using a quartz composition in a QCView. However, it appears pixelated as it doesn’t render at HiDPI resolution. (see screenshot)

Normally it’d be displayed on a projector so it’s not a huge issue (I don’t ever see ‘retina display’ projectors ever coming out soon), but it’s a bit disappointing it doesn’t look any good on my MacBook’s display.

The Quartz Composer application itself doesn’t preview compositions in HiDPI mode either, but I don’t expect there’s much we can do about that for now. Is there anything I can do in my application to make the QCView render at a higher resolution?

Apps opening Apps

gtoledo3's picture

This is helpful for me because it allows me to use apps built with QuartzBuilder or Xcode (AppKit/ofx/Cinder stuff/blah blah) as helper apps that are bundled in resources, with launch/quit able to be controlled from a primary app. You can use this premise to launch an app that's not in your bundle as well.

This is nice for scenarios where you actually have to have a secondary app running to monitor whether or not a process is working correctly in a primary app. Other times, it's just expedient to use apps together, if for no other reason.

Easy solution:

Use NSWorkspace to launch the app, either at your app start up or IB action.

Optional: Provide an IB action to trigger the app to quit via your menu (or whatever).

Step 1:

In IB, I created some new menu items - basically "start helper app", and "close helper app". I linked them to some open and stop IB actions.

Step 2:

In my code, where I'm setting up some other IB actions in the App Controller, before ApplicationDidFinishLaunching stuff, I setup this to send the signal to open my helper app.

- (IBAction) open:(id)sender
 
{
 
   NSBundle *mainBundle = [NSBundle mainBundle];
   NSString *helperAppPath = [[mainBundle bundlePath]
   stringByAppendingString:@"/Contents/Resources/MyCoolHelperApp.app"];
 
   [[NSWorkspace sharedWorkspace] launchApplication:helperAppPath];
 
}   

If you just put something like that in your initialization routine, you can have the secondary app open when your app opens.

To set a menu item to close the helper app, I'm using Apple Events, because there's a little greater backwards compatibility... and my compiler is flagging some stuff that docs say is supposed to work in 10.6 even though my project isn't set anywhere for 10.5 (at least I think so...). I think one can probably use some shared workspace methods to close in +10.6, but this should work too.

Close method:

- (IBAction) stop:(id)sender
 
{
   OSStatus err;
        AppleEvent event, reply;
 
    const char *bundleIDString = "com.georgetoledo.mycoolapp"; //the bundle id from the app's plist
    err = AEBuildAppleEvent(kCoreEventClass, kAEQuitApplication,
                            typeApplicationBundleID,
                            bundleIDString, strlen(bundleIDString),
                            kAutoGenerateReturnID, kAnyTransactionID,
                            &event, NULL, "");
 
    if (err) return;
    err = AESendMessage(&event, &reply, kAENoReply, kAEDefaultTimeout);
    AEDisposeDesc(&event);
    return;
 
 
}

I felt like this might be a helpful rundown if you do stuff like this and it just hasn't occurred to you it's possible to do this, this way.

Per one note I noticed at the macnn forum, you could also do this to launch using only Foundation, and not AppKit stuff with a few more lines of code:

NSBundle *bundle = [NSBundle bundleWithPath:@"/Applications/Mail.app"]; // or whatever app
NSString *path = [bundle executablePath];
NSTask *task = [[NSTask alloc] init];
 
[task setLaunchPath:path];
[task launch];
 
[task release];
task = nil;

Mappit: A Quartz Video Mapping App

scalf's picture

I wanted to make a dead simple, standalone program for Video Mapping - 2 windows, simple controls, photo/video.

It is amazingly useful as a mapping tool - think quad with corner controls. Mappit can use photos and videos.

To all those here, thanks for all the help along the way I couldn't have done it without you. I am sure someone will find this useful.

Check it out, and grab a copy here

http://www.communetohumanity.com/#1745641/Mappit-v1-0

Cocoa Touch/Android/AS3 Developer wanted

Raconteur's picture

Hi gang,

We are looking for a diverse developer with EXCELLENT OO skills and knowledge, who has experience with Cocoa Touch, Objective-C, iPhone/iPad development. Would also be great if this person had solid experience with Java/Android and/or Flash/AS3.

TV UI experience is a big plus, but not necessary. Agile experience/adoption is also a plus, but not necessary.

Ability to fluidly switch between multiple projects, adapt to ever-changing requirements, and work with little to no supervision essential. Not that you would be sitting in isolation, but things move fast around here, and we need someone who, once he/she has gotten up to speed, can go off and execute tasks, with surety, quality, and reliability.

The gig is in downtown Burbank, CA with Technicolor. Please respond here and I will send you the submission information personally. Don't want to push our recruiter's email address into the Spam-O-Sphere (not that Kineme is part of that but you never know who is trolling the boards).

Cheers,

Chris

Quartz Composition Translation/Compilation/Anything Else

mindoftea's picture

Hi,

I am an independent computer programmer working on a game based in Quartz. I had planned to submit it to Apple as an iPad app, but you can probably imagine my expression when I had coded 4500 patches, and then discovered that my source for thinking that Quartz Composer was supported on the iPhone/iPad OS was false...

So what I would like to do is translate my Quartz Composition into an iPhone/iPad OS compatible language such as Cocoa and/or OpenGL. Is there any easy way to do this, or must it be done manually? My time is pretty much free.

Advice of any kind would be greatly appreciated.

Thanks, mindoftea