package scratchlib.objects.user.media;

import scratchlib.objects.fixed.data.ScratchObjectUtf8;
import scratchlib.objects.user.ScratchUserClassObject;


/**
 * Base class for the two Scratch media types (image and sound).
 */
public class ScratchObjectMedia extends ScratchUserClassObject
{
    /**
     * Specifies a media's user-assigned name.
     * 
     * @see ScratchObjectUtf8
     */
    public static final String FIELD_MEDIA_NAME = "mediaName";

    /**
     * Constructs an instance with the default values and with the given classID
     * and version.
     * 
     * @param classID The ID of the class this object belongs to.
     * @param version The version of the class this object belongs to.
     */
    public ScratchObjectMedia(int classID, ClassVersion version)
    {
        super(classID, version);

        specifyField(FIELD_MEDIA_NAME, new ScratchObjectUtf8(""));
    }
}

@@ -33,16 +33,82 @@
 media;%0A%0A
+import scratchlib.objects.fixed.data.ScratchObjectAbstractString;%0A
 import s
@@ -954,11 +954,497 @@
 );%0A    %7D
+%0A%0A    /**%0A     * @return The media's name.%0A     */%0A    public String getName()%0A    %7B%0A        return ((ScratchObjectAbstractString) getField(FIELD_MEDIA_NAME))%0A                .getValue();%0A    %7D%0A%0A    /**%0A     * Updates the media's name. Note that this change is NOT reflected anywhere%0A     * else (when used in blocks, etc).%0A     * %0A     * @param name The new name.%0A     */%0A    public void setName(String name)%0A    %7B%0A        setField(FIELD_MEDIA_NAME, new ScratchObjectUtf8(name));%0A    %7D
 %0A%7D%0A

Add name getter/setter to media object