Exemplo n.º 1
0
    public void DefineSyphonClient(SyphonServerObject server)
    {
        //hold on to object reference
        attachedServer = server;
        boundAppName   = server.SyphonServerDescriptionAppName;
        if (server.SyphonServerDescriptionName == "")
        {
            boundName = Syphon.UNNAMED_STRING;
        }
        else
        {
            boundName = server.SyphonServerDescriptionName;
        }
        //initialize the texture
        if (attachedTexture == null)
        {
            attachedTexture            = new RenderTexture(16, 16, 0, RenderTextureFormat.ARGB32);
            attachedTexture.filterMode = FilterMode.Bilinear;
            attachedTexture.wrapMode   = TextureWrapMode.Clamp;
            attachedTexture.Create();
            Syphon.SafeMaterial.SetPass(0);
            RenderTexture.active = attachedTexture;
            GL.Clear(false, true, new Color(0, 0, 0, 0));
            RenderTexture.active = null;
            cachedTexID          = IntPtr.Zero;
        }

        InitSyphonClient();
    }
Exemplo n.º 2
0
 public SyphonServerObject(SyphonServerObject deepCopyConstruct)
 {
     SyphonServerDescriptionAppName = deepCopyConstruct.SyphonServerDescriptionAppName;
     SyphonServerDescriptionName = deepCopyConstruct.SyphonServerDescriptionName;
     SyphonServerDescriptionUUID = deepCopyConstruct.SyphonServerDescriptionUUID;
     syphonServerPointer = deepCopyConstruct.SyphonServerPointer;
 }
 public SyphonServerObject(SyphonServerObject deepCopyConstruct)
 {
     SyphonServerDescriptionAppName = deepCopyConstruct.SyphonServerDescriptionAppName;
     SyphonServerDescriptionName    = deepCopyConstruct.SyphonServerDescriptionName;
     SyphonServerDescriptionUUID    = deepCopyConstruct.SyphonServerDescriptionUUID;
     syphonServerPointer            = deepCopyConstruct.SyphonServerPointer;
 }
 public void CreateSyphonServer(SyphonServerObject deepCopy)
 {
     SyphonServerDescriptionAppName = deepCopy.SyphonServerDescriptionAppName;
     SyphonServerDescriptionName    = deepCopy.SyphonServerDescriptionName;
     SyphonServerDescriptionUUID    = deepCopy.SyphonServerDescriptionUUID;
     syphonServerPointer            = deepCopy.SyphonServerPointer;
 }
 public void AnnounceServer(string appName, string name)
 {
     if (!initialized && MatchesDescription(appName, name))
     {
         announceServerQueueServer = Syphon.GetSyphonServer(appName, name);
         if (announceServerQueueServer != null)
         {
             announceServerQueue = true;
             // //	DestroySyphonClient();
             //  DefineSyphonClient(server);
             //  InitSyphonClient();
             //   Debug.Log("announced app:" + appName + " name: " + name );
         }
     }
 }
    //make sure that announce/retire are performed on the main thread by putting commands in a queue
    public void Update()
    {
        if (announceServerQueue)
        {
            DefineSyphonClient(announceServerQueueServer);
            InitSyphonClient();
            //	 StackTrace stackTrace = new StackTrace();
            //	 UnityEngine.Debug.Log("init'd syphon client " + boundAppName + " " + boundName + stackTrace.GetFrame(1).GetMethod().Name);

//			Debug.Log("announced app:" + announceServerQueueServer.SyphonServerDescriptionAppName + " name: " + announceServerQueueServer.SyphonServerDescriptionName );
            announceServerQueue       = false;
            announceServerQueueServer = null;
        }
        if (retireServerQueue)
        {
            DestroySyphonClient();
            retireServerQueue = false;
//			 Debug.Log("retired app:" + appName + " name: " + name );
        }
    }
Exemplo n.º 7
0
    public static void AddClientToUnsortedList(string appName, string name, SyphonServerObject server)
    {
        SyphonClientObject result = GetSyphonClient(appName, name);

        // Debug.Log(result.BoundAppName + " " + result.BoundName + " was the result");
        if (result == null)
        {
//			Debug.Log("DIDNT EXIST: " + appName + "/" +name);
            //if it was null when trying to add a new client, just add a new one and init.
            Syphon.UnsortedClients.Add(ScriptableObject.CreateInstance <SyphonClientObject>());
            Syphon.UnsortedClients[Syphon.UnsortedClients.Count - 1].DefineSyphonClient(server);
            Syphon.UnsortedClients[Syphon.UnsortedClients.Count - 1].InitSyphonClient();
        }
        else
        {
//			Debug.Log("EXISTED: " + appName + "/" +name);
            result.DestroySyphonClient();
            result.DefineSyphonClient(server);
            result.InitSyphonClient();
        }
    }
Exemplo n.º 8
0
	public void DefineSyphonClient(SyphonServerObject server){
		//hold on to object reference
		attachedServer = server;		
		boundAppName = server.SyphonServerDescriptionAppName;
		if(server.SyphonServerDescriptionName == "")
			boundName = Syphon.UNNAMED_STRING;
		else
			boundName = server.SyphonServerDescriptionName;		
		//initialize the texture
		if(attachedTexture == null){
			attachedTexture = new RenderTexture(16, 16, 0, RenderTextureFormat.ARGB32);
			attachedTexture.filterMode = FilterMode.Bilinear;
			attachedTexture.wrapMode = TextureWrapMode.Clamp;
			attachedTexture.Create();
			Syphon.SafeMaterial.SetPass(0);
			RenderTexture.active = attachedTexture;
			GL.Clear(false, true, new Color(0, 0, 0, 0));
			RenderTexture.active = null;
			cachedTexID = -1;
		}
		
		InitSyphonClient();
	}
    public void DefineSyphonClient(SyphonClientObject client)
    {
        // UnityEngine.Debug.Log("created syphon client: " + boundName + " " +boundAppName);
        //hold on to object reference
        attachedServer = client.attachedServer;
        boundAppName   = client.AttachedServer.SyphonServerDescriptionAppName;
        if (client.AttachedServer.SyphonServerDescriptionName == "")
        {
            boundName = Syphon.UNNAMED_STRING;
        }
        else
        {
            boundName = client.AttachedServer.SyphonServerDescriptionName;
        }

        //initialize the texture
        if (attachedTexture == null)
        {
            attachedTexture            = new RenderTexture(128, 128, 0, RenderTextureFormat.ARGB32);
            attachedTexture.filterMode = FilterMode.Bilinear;
            attachedTexture.wrapMode   = TextureWrapMode.Clamp;
        }
        //TODO: create the syphon client in plugin
    }
Exemplo n.º 10
0
    public static SyphonClientObject AddClientToSyphonClientsList(string appName, string name, SyphonServerObject server)
    {
        SyphonClientObject result = GetSyphonClient(appName, name);

        // Debug.Log(result.BoundAppName + " " + result.BoundName + " was the result");
        if (result == null)
        {
//			UnityEngine.Debug.Log("DIDNT EXIST: " + appName + "/" +name);
            //if it was null when trying to add a new client, just add a new one and init.
            result = ScriptableObject.CreateInstance <SyphonClientObject>();
            result.DefineSyphonClient(server);
            Syphon.SyphonClients.Add(result);
        }
        else
        {
//			UnityEngine.Debug.Log("EXISTED: " + appName + "/" +name + ". doing nothing.");
        }

        return(result);
    }
Exemplo n.º 11
0
 public static void AddClientToUnsortedList(string appName, string name, SyphonServerObject server)
 {
     SyphonClientObject result = GetSyphonClient(appName, name);
     // Debug.Log(result.BoundAppName + " " + result.BoundName + " was the result");
     if(result == null){
     //			Debug.Log("DIDNT EXIST: " + appName + "/" +name);
         //if it was null when trying to add a new client, just add a new one and init.
         Syphon.UnsortedClients.Add(ScriptableObject.CreateInstance<SyphonClientObject>() );
         Syphon.UnsortedClients[Syphon.UnsortedClients.Count -1 ].DefineSyphonClient(server);
         Syphon.UnsortedClients[Syphon.UnsortedClients.Count -1 ].InitSyphonClient();
     }
     else{
     //			Debug.Log("EXISTED: " + appName + "/" +name);
         result.DestroySyphonClient();
         result.DefineSyphonClient(server);
         result.InitSyphonClient();
     }
 }
Exemplo n.º 12
0
    public static SyphonClientObject AddClientToSyphonClientsList(string appName, string name, SyphonServerObject server)
    {
        SyphonClientObject result = GetSyphonClient(appName, name);
        // Debug.Log(result.BoundAppName + " " + result.BoundName + " was the result");
        if(result == null){
        //			UnityEngine.Debug.Log("DIDNT EXIST: " + appName + "/" +name);
            //if it was null when trying to add a new client, just add a new one and init.
            result = ScriptableObject.CreateInstance<SyphonClientObject>();
            result.DefineSyphonClient(server);
            Syphon.SyphonClients.Add(result);
        }
        else{
        //			UnityEngine.Debug.Log("EXISTED: " + appName + "/" +name + ". doing nothing.");
        }

        return result;
    }
Exemplo n.º 13
0
	public void CreateSyphonServer(SyphonServerObject deepCopy){
		SyphonServerDescriptionAppName = deepCopy.SyphonServerDescriptionAppName;
		SyphonServerDescriptionName = deepCopy.SyphonServerDescriptionName;
		SyphonServerDescriptionUUID = deepCopy.SyphonServerDescriptionUUID;
		syphonServerPointer = deepCopy.SyphonServerPointer;
	}
Exemplo n.º 14
0
    //make sure that announce/retire are performed on the main thread by putting commands in a queue
    public void Update()
    {
        if(announceServerQueue){
            DefineSyphonClient(announceServerQueueServer);
            InitSyphonClient();
        //	 StackTrace stackTrace = new StackTrace();
         //	 UnityEngine.Debug.Log("init'd syphon client " + boundAppName + " " + boundName + stackTrace.GetFrame(1).GetMethod().Name);

        //			Debug.Log("announced app:" + announceServerQueueServer.SyphonServerDescriptionAppName + " name: " + announceServerQueueServer.SyphonServerDescriptionName );
            announceServerQueue = false;
            announceServerQueueServer = null;
        }
        if(retireServerQueue){
            DestroySyphonClient();
            retireServerQueue = false;
        //			 Debug.Log("retired app:" + appName + " name: " + name );
        }
    }
Exemplo n.º 15
0
    public void DefineSyphonClient(SyphonClientObject client)
    {
        // UnityEngine.Debug.Log("created syphon client: " + boundName + " " +boundAppName);
        //hold on to object reference
        attachedServer = client.attachedServer;
        boundAppName = client.AttachedServer.SyphonServerDescriptionAppName;
        if(client.AttachedServer.SyphonServerDescriptionName == "")
            boundName = Syphon.UNNAMED_STRING;
        else
            boundName = client.AttachedServer.SyphonServerDescriptionName;

        //initialize the texture
        if(attachedTexture == null){
        attachedTexture = new RenderTexture(128, 128, 0, RenderTextureFormat.ARGB32);
        attachedTexture.filterMode = FilterMode.Bilinear;
        attachedTexture.wrapMode = TextureWrapMode.Clamp;
        }
        //TODO: create the syphon client in plugin
    }
Exemplo n.º 16
0
    public void AnnounceServer(string appName, string name)
    {
        if(!initialized && MatchesDescription(appName, name)){
                announceServerQueueServer = Syphon.GetSyphonServer(appName, name);
                if(announceServerQueueServer != null){
                    announceServerQueue = true;
                // //	DestroySyphonClient();
                // 	DefineSyphonClient(server);
                // 	InitSyphonClient();
                // 	 Debug.Log("announced app:" + appName + " name: " + name );
                }

            }
    }