Modifying Patch Title

smokris's picture

So far I've found three ways to alter the patch title:

  1. Set the "name" attribute in the patch's XML file --- this is the standard well-known static way of setting the patch's title.

    This technique sets the name in the Patch List, and the default name of the patch instance in the Composition Editor.

  2. Alter [self userInfo]:

    - (id)setup:(QCOpenGLContext *)context
    {
        NSMutableDictionary *uinf=[self userInfo];
        [uinf setObject:@"foo2" forKey:@"name"];
        [self stateUpdated];
        return context;
    }
    

    This technique sets the user-defined name of the patch instance in the Composition Editor. Text is prefilled in the "Title:" textbox in the Inspector. If this text is cleared, the patch name reverts to the name specified in technique #1 or #3. The Patch List is left unchanged.

  3. Overload - (id)attributes:

    - (id)attributes
    {
        NSMutableDictionary *at=[[super attributes] mutableCopy];
        [at setObject:@"foo" forKey:@"name"];
        return at;
    }
    

    This technique sets the default name of the patch instance in the Composition Editor --- i.e., the name the patch is given when the Inspector's "Title:" textbox is empty. The Patch List is left unchanged.