Home Duet/Cafe Duet

updateSwitcherInputOutput(..) bug

PhreaKPhreaK Senior MemberPosts: 966
I'm not sure whether this is just sleep deprivation getting to me but the updateSwitcherInputOutput(..) method at line 678 of SwitcherComponentImpl.java (in devicesdk.jar) seems to be dodgy.

The first thing it does is remove any inputOutputData from alInputOutput with a matching input to the that the method is updating. If you're just using a single switch level (eg. SwitchLevel.ALL) this is all fine however if you implement breakaway switching it causes issues as it doesn't allow a single input to feed discrete outputs across switch levels.

Am I missing something or is this a 'feature' others have had to work around?

Comments

  • PhreaKPhreaK Senior Member Posts: 966
    Just had a chance to grill one of the AMX guys about this - answer was along the lines of "oh yeah, don't use those base classes". Hmmmmm...
  • AMXJeffAMXJeff Senior Member Posts: 450
    Yes!

    You are right, i had to write my own to override that method... The super implemenation seems to assume that an input can only go to single output versus multiple outputs.
    // this does not seem to work correctly in the super, so did it myself.
    /* (non-Javadoc)
     * @see com.amx.duet.devicesdk.Switcher#updateSwitcherInputOutput(com.amx.duet.devicesdk.type.SwitchLevel, int, int[])
     */
    protected void updateSwitcherInputOutput(SwitchLevel sl, int input, int[] output)
    {
    	for (int index = 0; index < output.length; index++)
    	{
    		int out = output[index];
    		
    		if (out > 0 && out <= MAX_RENDERERS)
    		{
    			if (outputStatus[out - 1] != input)
    			{
    				outputStatus[out - 1] = input;
    									
    				try
    				{
    					SwitcherComponentEvent event = (SwitcherComponentEvent) m_SwitcherComponentEventObjectPool.borrowObject(this, sl, input, new int[]{out}, 1);
    					this.processSwitchEvent(event);
    					m_SwitcherComponentEventObjectPool.returnObject(event);
    				}
    				catch (Exception e)
    				{
    					
    				}
    			}
    		}
    	}
    }
    
Sign In or Register to comment.