Full Screen with Quartz Composer

View: New views
4 Messages — Rating Filter:   Alert me  

Full Screen with Quartz Composer

by Gregory Cornelius :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

I am using supercollider and quartz composer in a visualization project, but I have run into a small hiccup.   
The keyDownAction method works fine on an empty window to toggle full screen, but when I add the QC stuff it doesn't respond.    Do I have to use a SynthDef on the server paired with OSCresponder?

(
w = SCWindow("ligeti", Rect(0, 0, 800, 600), border:false);
w.view.background = Color.black;
w.view.keyDownAction = { arg view, char, modifiers, unicode, keycode;  
[char, keycode].postln;
if (keycode == 53, { 
w.close;
});
};
m = SCQuartzComposerView(w, Rect(0,0, 800, 600));
m.path = "/Users/gcorne/Current_Projects/ligeti/ligeti.qtz";
w.fullScreen;
w.front;  
)

Thanks in advance,

Greg

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Full Screen with Quartz Composer

by Scott Wilson-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There is a problem with the QCView class in that you can either forward all mouse and key events to the composition, or not. There's no way for SC to capture them.

Based on a quick look, this can be solved with the 10.5 version of QC, but 10.5 only features probably won't be in SC for some time for compatibility reasons.

A hacky workaround is to use the Keyboard patch in your composition, publish the output, and regularly poll it to see if a key is down.

Sorry, for the moment that's the best you can do I think.

S.

On 14 Jan 2008, at 23:42, Gregory Cornelius wrote:

Hi everyone,

I am using supercollider and quartz composer in a visualization project, but I have run into a small hiccup.   
The keyDownAction method works fine on an empty window to toggle full screen, but when I add the QC stuff it doesn't respond.    Do I have to use a SynthDef on the server paired with OSCresponder?

(
w = SCWindow("ligeti", Rect(0, 0, 800, 600), border:false);
w.view.background = Color.black;
w.view.keyDownAction = { arg view, char, modifiers, unicode, keycode;  
[char, keycode].postln;
if (keycode == 53, { 
w.close;
});
};
m = SCQuartzComposerView(w, Rect(0,0, 800, 600));
m.path = "/Users/gcorne/Current_Projects/ligeti/ligeti.qtz";
w.fullScreen;
w.front;  
)

Thanks in advance,

Greg
_______________________________________________
sc-users mailing list


_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Full Screen with Quartz Composer

by Luke Selden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

if you don't mind the menu at the top of the screen you can fake fullscreen and just leave a small invisible button at the top that you can click to close the window:

~screen = SCWindow.screenBounds;
~yoffset = 30;
w = SCWindow.new("", ~screen, border: false ).front;
w.view.background = Color.black;
w.acceptsMouseOver_(true);
w.view.mouseDownAction = { w.close };
// this is your small hidden close button
a = SCButton(w, Rect(0, 0, ~screen.width, ~yoffset))
    .states_([["Close", Color.black, Color.black]])
    .action_({ w.close });
// this could be your SCQuartzComposerView
b = SCButton(w, Rect(0, ~yoffset, ~screen.width, ~screen.height))
    .background_(Color.black)
    .states_([["QCView"]]);
// for safety's sake!
AppClock.sched(6, { w.close; nil });

I used similar code to this for using a SCQuartzComposerView on an external display (which wouldn't show the menubar at the top), but since it was on the external display I didn't need a close button...

Hope that helps-
~luke

On Jan 14, 2008 6:42 PM, Gregory Cornelius <gcorne@...> wrote:
Hi everyone,

I am using supercollider and quartz composer in a visualization project, but I have run into a small hiccup.   
The keyDownAction method works fine on an empty window to toggle full screen, but when I add the QC stuff it doesn't respond.    Do I have to use a SynthDef on the server paired with OSCresponder?

(
w = SCWindow( "ligeti" , Rect(0, 0, 800, 600), border: false);
w.view.background = Color.black;
w.view.keyDownAction = { arg view, char, modifiers, unicode, keycode;  
[char, keycode].postln;
if (keycode == 53, { 
w.close;
});
};
m = SCQuartzComposerView (w, Rect(0,0, 800, 600));
m.path = "/Users/gcorne/Current_Projects/ligeti/ligeti.qtz" ;
w.fullScreen;
w.front;  
)

Thanks in advance,

Greg

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users



_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Full Screen with Quartz Composer

by Sam Pluta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here's a nice "solution."  The ole invisible window trick:

w = SCWindow("Quartz", SCWindow.screenBounds);
q = SCQuartzComposerView(w, Rect(0,0,w.bounds.width, w.bounds.height));
x = SCWindow("", w.bounds).alpha_(0.0);
x.view.keyDownAction = { arg view, char, modifiers, unicode, keycode;  
[char, keycode].postln;
if (keycode == 13, { //closes on "w"
w.close;
x.close;
});
};

w.front;
x.front;

Sam

On Jan 14, 2008, at 6:42 PM, Gregory Cornelius wrote:

Hi everyone,

I am using supercollider and quartz composer in a visualization project, but I have run into a small hiccup.   
The keyDownAction method works fine on an empty window to toggle full screen, but when I add the QC stuff it doesn't respond.    Do I have to use a SynthDef on the server paired with OSCresponder?

(
w = SCWindow("ligeti", Rect(0, 0, 800, 600), border:false);
w.view.background = Color.black;
w.view.keyDownAction = { arg view, char, modifiers, unicode, keycode;  
[char, keycode].postln;
if (keycode == 53, { 
w.close;
});
};
m = SCQuartzComposerView(w, Rect(0,0, 800, 600));
m.path = "/Users/gcorne/Current_Projects/ligeti/ligeti.qtz";
w.fullScreen;
w.front;  
)

Thanks in advance,

Greg
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users



myspace.com/sampluta
myspace.com/exclusiveor
myspace.com/glissandobinladen






_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users