<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: talk to namedObject in different patcher</title>
		<atom:link href="http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 16:54:36 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-25286</guid>
					<title><![CDATA[talk to namedObject in different patcher]]></title>
					<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-25286</link>
					<pubDate>Fri, 07 Apr 2006 14:41:56 +0000</pubDate>
					<dc:creator>volker böhm</dc:creator>

					<description>
						<![CDATA[
						<p>hi,<br />
i&#8217;m trying to send data to a namedObject from within a mxj class,  <br />
which is working fine as long as the receiving object is in the same  <br />
patcher as the mxj object.<br />
but i can&#8217;t figure out how to proceed if the named object is in a  <br />
different patcher (not a subpatcher, but a completely independent max  <br />
patch, which is actually loaded dynamically with [pcontol] ).<br />
is it possible to connect to a patcher, if i only know the window title?<br />
i looked at the getPatcher() method of the Max Window class, without  <br />
any further enlightenment&#8230;<br />
or maybe something analog to getAllBoxes(), like &#8220;getAllPatchers()&#8221;,  <br />
to cycle through all available patchers?</p>
<p>another possible way would be to talk to a regular max [receive]  <br />
object from within mxj, because of it&#8217;s global scope, but something  <br />
in the back of my head tells me, that this is not possible. wrong?  <br />
(would be nice&#8230;)<br />
thanks.<br />
volker.</p>
<p>
public class namedObj extends MaxObject<br />
{</p>
<p>	private MaxPatcher _p = null;</p>
<p>	namedObj (Atom[] a) {	<br />
		_p = this.getParentPatcher();		// how can i change this to  <br />
reference another patcher?<br />
	}</p>
<p>	public void ss( int i ) {<br />
		MaxBox b = _p.getNamedBox(&#8220;myNum&#8221;);<br />
		b.send(i);		<br />
	}<br />
}</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74312</guid>
					<title><![CDATA[Re: talk to namedObject in different patcher]]></title>
					<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74312</link>
					<pubDate>Fri, 07 Apr 2006 18:32:44 +0000</pubDate>
					<dc:creator>topher lafata</dc:creator>

					<description>
						<![CDATA[
						<p>What I would do is put an instance of an mxj class in each patcher.<br />
Each instance would reference its parent patcher. Each instance would<br />
register itself in a global static table. That way they could all  <br />
talk to each other.<br />
When a patcher is closed I would remove the instance from the table.</p>
<p>I am sure there is more than one way to do what you want but this is  <br />
what came<br />
to mind for me.</p>
<p>Topher</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74313</guid>
					<title><![CDATA[Re: talk to namedObject in different patcher]]></title>
					<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74313</link>
					<pubDate>Sat, 08 Apr 2006 15:34:20 +0000</pubDate>
					<dc:creator>volker böhm</dc:creator>

					<description>
						<![CDATA[
						<p>ok, thanks, topher.<br />
will investigate in that direction.<br />
vol.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74314</guid>
					<title><![CDATA[Re: talk to namedObject in different patcher]]></title>
					<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74314</link>
					<pubDate>Mon, 10 Apr 2006 02:45:21 +0000</pubDate>
					<dc:creator>jitter</dc:creator>

					<description>
						<![CDATA[
						<p>hi topher, could you be a little more explicit in how you would  <br />
actually execute this plan (i.e. the global static table part)? I  <br />
will need to do something similar in the near future, and the only  <br />
way I can figure to do it cleanly is to use a boxless object but  <br />
(afaik) that hasn&#8217;t been made available yet in the mxj sdk.</p>
<p>I have a hack that works, but it involves people putting things in  <br />
the c74/java/lib folder, which I presume you would rather I didn&#8217;t  <br />
do. will this be forthcoming in a future version of the mxj sdk, or  <br />
am I approaching this from the wrong angle completely?</p>
<p>best regards,<br />
r.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74315</guid>
					<title><![CDATA[Re: talk to namedObject in different patcher]]></title>
					<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74315</link>
					<pubDate>Mon, 10 Apr 2006 08:09:03 +0000</pubDate>
					<dc:creator>topher lafata</dc:creator>

					<description>
						<![CDATA[
						<p>On Apr 9, 2006, at 7:46 PM, ritchie wrote:</p>
<p>> hi topher, could you be a little more explicit in how you would  <br />
> actually execute this plan (i.e. the global static table part)?</p>
<p>well all the mxj instances are running in the same JVM so if a  <br />
variable is declared static, a hashtable for instance, all instances will have the same reference.</p>
<p>
> I have a hack that works, but it involves people putting things in  <br />
> the c74/java/lib folder, which I presume you would rather I didn&#8217;t  <br />
> do. will this be forthcoming in a future version of the mxj sdk, or  <br />
> am I approaching this from the wrong angle completely?</p>
<p>why not?it is fine to put things in that folder. it is automatically  <br />
searched upon JVM startup for any jars so it makes the most sense<br />
to put jarred code there.</p>
<p>topher</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74316</guid>
					<title><![CDATA[Re: talk to namedObject in different patcher]]></title>
					<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74316</link>
					<pubDate>Tue, 11 Apr 2006 00:51:19 +0000</pubDate>
					<dc:creator>jitter</dc:creator>

					<description>
						<![CDATA[
						<p>On 06-04-10, at 0509, topher lafata wrote:<br />
><br />
> well all the mxj instances are running in the same JVM so if a  <br />
> variable is declared static, a hashtable for instance, all instances<br />
> will have the same reference.<br />
><br />
good to know.</p>
<p>> why not?it is fine to put things in that folder. it is  <br />
> automatically searched upon JVM startup for any jars so it makes  <br />
> the most sense<br />
> to put jarred code there.<br />
><br />
the only reason I put stuff there is to access package-private  <br />
methods/data in com.cycling74.max.*. presumably the access levels are  <br />
set for a reason, no? if not, could you make mxjObjectWasDeleted()  <br />
package-private instead of object-private as well? it would make my  <br />
hack a little cleaner. thanks.</p>
<p>r.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74317</guid>
					<title><![CDATA[Re: talk to namedObject in different patcher]]></title>
					<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74317</link>
					<pubDate>Tue, 11 Apr 2006 01:58:34 +0000</pubDate>
					<dc:creator>topher lafata</dc:creator>

					<description>
						<![CDATA[
						<p>>><br />
> the only reason I put stuff there is to access package-private  <br />
> methods/data in com.cycling74.max.*. presumably the access levels  <br />
> are set for a reason, no? if not, could you make mxjObjectWasDeleted <br />
> () package-private instead of object-private as well? it would make  <br />
> my hack a little cleaner. thanks.</p>
<p>couldn&#8217;t you just add another method to your object.  <br />
registerNotifyDeleted(Object o) or something like that.<br />
Than you could notify everyone that registed with that instance in  <br />
your overridden mxjObjectWasDeleted.<br />
Just an idea. There is always more than one way to skin a cat.<br />
Topher</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74318</guid>
					<title><![CDATA[Re: talk to namedObject in different patcher]]></title>
					<link>http://cycling74.com/forums/topic/talk-to-namedobject-in-different-patcher/#post-74318</link>
					<pubDate>Tue, 11 Apr 2006 02:24:20 +0000</pubDate>
					<dc:creator>jitter</dc:creator>

					<description>
						<![CDATA[
						<p>On 06-04-10, at 2259, topher lafata wrote:<br />
>>><br />
>> the only reason I put stuff there is to access package-private  <br />
>> methods/data in com.cycling74.max.*. presumably the access levels  <br />
>> are set for a reason, no? if not, could you make  <br />
>> mxjObjectWasDeleted() package-private instead of object-private as  <br />
>> well? it would make my hack a little cleaner. thanks.<br />
><br />
> couldn&#8217;t you just add another method to your object.  <br />
> registerNotifyDeleted(Object o) or something like that.<br />
> Than you could notify everyone that registed with that instance in  <br />
> your overridden mxjObjectWasDeleted.<br />
> Just an idea. There is always more than one way to skin a cat.<br />
><br />
the problem is that I can&#8217;t call mxjObjectWasDeleted() from whatever  <br />
I write (overridden method or otherwise), and I can&#8217;t implement my  <br />
own mxjObjectWasDeleted() fully w/o greater access to the object- <br />
private member variables it deals with. granted I think I get enough  <br />
of them to get the job done, but it&#8217;s not a very faithful reproduction:</p>
<p>package com.cycling74.max;</p>
<p>/**<br />
* boxless max object wrapper hack by r.<br />
*<br />
* for this to work it must live in c74/java/lib<br />
*/<br />
public abstract class MaxBoxlessObject extends MaxObject {<br />
	/**<br />
	 * expose public version of mxjObjectWasDeleted()<br />
	 * can&#8217;t get at any private stuff in MaxObject, so<br />
	 * this is the best we can do. presumably all the<br />
	 * instance variables listed will let go when this<br />
	 * object is garbage collected anyway, no?<br />
	 */<br />
	public void delete() {<br />
		MaxContext.unregister(this);<br />
         notifyDeleted();</p>
<p>//        mName = null;<br />
		setName(null);              // public equivalent</p>
<p>//        mInlets = null;<br />
		declareInlets(NO_INLETS);   // next best thing</p>
<p>//        mOutlets = null;<br />
		declareOutlets(NO_OUTLETS); // next best thing. what about info  <br />
outlet? seems like<br />
									// we can&#8217;t mess with it once it&#8217;s been created..</p>
<p>//        mInletAssist = null;<br />
		setInletAssist(null);       // public equivalent</p>
<p>//        mOutletAssist = null;<br />
		setOutletAssist(null);      // public equivalent</p>
<p>//        _attributes = null;<br />
		// stumped</p>
<p>//        _flash_watch = null;<br />
		// this should almost always be null it seems,<br />
		// unless delete() gets called in the middle of<br />
		// doing something else which seems impossible.</p>
<p>//        WATCHME = null;<br />
		// stumped</p>
<p>//        _source_editor = null;<br />
		// stumped<br />
	}<br />
}</p>
<p>really it seems to me that the important things in here are  <br />
MaxContext.unregister(this) and notifyDeleted(), but (a) you go to  <br />
all the trouble to set everything else to null (or jad is telling  <br />
stories), and (b) perhaps in future versions there&#8217;ll be some more  <br />
critical stuff in there that I similarly can&#8217;t deal with. my solution  <br />
seems a little fragile from my point of view.</p>
<p>best regards,<br />
r.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

