예제 #1
0
 public virtual void play(VSMXBaseObject @object)
 {
     //if (log.DebugEnabled)
     {
         Console.WriteLine(string.Format("Sound.play"));
     }
 }
예제 #2
0
        private static void createObjectFromEntry(VSMXInterpreter interpreter, Display display, Controller controller, VSMXBaseObject parent, RCO.RCOEntry entry)
        {
            if (entry.obj == null)
            {
                return;
            }

            VSMXBaseObject @object;

            if (entry.obj != null)
            {
                entry.obj.Display    = display;
                entry.obj.Controller = controller;
                @object = entry.obj.createVSMXObject(interpreter, parent, entry);
            }
            else
            {
                @object = parent;
            }

            if (entry.subEntries != null)
            {
                VSMXObject children = new VSMXObject(interpreter, null);
                @object.setPropertyValue(childrenName, children);
                for (int i = 0; i < entry.subEntries.Length; i++)
                {
                    RCO.RCOEntry child = entry.subEntries[i];
                    if (string.ReferenceEquals(child.label, null))
                    {
                        child.label = string.Format("{0:D4}", i);
                    }
                    createObjectFromEntry(interpreter, display, controller, children, child);
                }
            }
        }
예제 #3
0
        public virtual VSMXBaseObject getPlayerStatus(VSMXBaseObject @object)
        {
            VSMXBaseObject playerStatus;

            if (playing)
            {
                playerStatus = new VSMXObject(interpreter, "PlayerStatus");
                playerStatus.setPropertyValue("playListNumber", new VSMXNumber(interpreter, playListNumber));
                playerStatus.setPropertyValue("chapterNumber", new VSMXNumber(interpreter, chapterNumber));
                playerStatus.setPropertyValue("videoNumber", new VSMXNumber(interpreter, videoNumber));
                playerStatus.setPropertyValue("audioNumber", new VSMXNumber(interpreter, audioNumber));
                playerStatus.setPropertyValue("audioFlag", new VSMXNumber(interpreter, audioFlag));
                playerStatus.setPropertyValue("subtitleNumber", new VSMXNumber(interpreter, subtitleNumber));
                playerStatus.setPropertyValue("subtitleFlag", new VSMXNumber(interpreter, subtitleFlag));
            }
            else
            {
                playerStatus = VSMXUndefined.singleton;
            }

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("MoviePlayer.getPlayerStatus() returning {0}", playerStatus));
            }

            return(playerStatus);
        }
예제 #4
0
 public virtual void setPos(VSMXBaseObject @object, VSMXBaseObject posX, VSMXBaseObject posY)
 {
     //if (log.DebugEnabled)
     {
         Console.WriteLine(string.Format("setPos({0}, {1})", posX, posY));
     }
     this.posX.FloatValue = posX.FloatValue;
     this.posY.FloatValue = posY.FloatValue;
 }
예제 #5
0
        protected internal override long doPlay(VSMXBaseObject @object)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("DelayAnim {0:D}", time.IntValue));
            }

            return(time.IntValue);
        }
예제 #6
0
        public virtual VSMXBaseObject getUserData(VSMXBaseObject @object)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("Controller.getUserData() returning {0}", userData));
            }

            return(userData);
        }
예제 #7
0
        public virtual VSMXBaseObject getSize(VSMXBaseObject @object)
        {
            VSMXInterpreter interpreter = @object.Interpreter;
            VSMXArray       size        = new VSMXArray(interpreter, 2);

            size.setPropertyValue(0, new VSMXNumber(interpreter, width));
            size.setPropertyValue(1, new VSMXNumber(interpreter, height));

            return(size);
        }
예제 #8
0
        public virtual void setSize(VSMXBaseObject @object, VSMXBaseObject width, VSMXBaseObject height)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("MoviePlayer.setSize({0}, {1})", width, height));
            }

            this.width  = width.IntValue;
            this.height = height.IntValue;
        }
예제 #9
0
        public virtual void setScale(VSMXBaseObject @object, VSMXBaseObject width, VSMXBaseObject height, VSMXBaseObject depth)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("setScale({0}, {1}, {2})", width, height, depth));
            }

            // TODO To be implemented
            onDisplayUpdated();
        }
예제 #10
0
        public virtual void stop(VSMXBaseObject @object, VSMXBaseObject unknownInt, VSMXBaseObject unknownBool)
        {
            //if (log.DebugEnabled)
            {
//JAVA TO C# CONVERTER TODO TASK: The following line has a Java format specifier which cannot be directly translated to .NET:
//ORIGINAL LINE: Console.WriteLine(String.format("MoviePlayer.stop unknownInt=%d, unknownBool=%b", unknownInt.getIntValue(), unknownBool.getBooleanValue()));
                Console.WriteLine(string.Format("MoviePlayer.stop unknownInt=%d, unknownBool=%b", unknownInt.IntValue, unknownBool.BooleanValue));
            }
            playing = false;
        }
예제 #11
0
        public virtual VSMXBaseObject getPos(VSMXBaseObject @object)
        {
            VSMXInterpreter interpreter = @object.Interpreter;
            VSMXArray       pos         = new VSMXArray(interpreter, 2);

            pos.setPropertyValue(0, new VSMXNumber(interpreter, x));
            pos.setPropertyValue(1, new VSMXNumber(interpreter, y));

            return(pos);
        }
예제 #12
0
        public virtual void setPos(VSMXBaseObject @object, VSMXBaseObject x, VSMXBaseObject y)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("MoviePlayer.setPos({0}, {1})", x, y));
            }

            this.x = x.IntValue;
            this.y = y.IntValue;
        }
예제 #13
0
        public virtual void animRotate(VSMXBaseObject @object, VSMXBaseObject x, VSMXBaseObject y, VSMXBaseObject rotationRads, VSMXBaseObject duration)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("animRotate({0}, {1}, {2}, {3})", x, y, rotationRads, duration));
            }

            AnimRotateAction action = new AnimRotateAction(this, x.FloatValue, y.FloatValue, rotationRads.FloatValue, duration.IntValue);

            Scheduler.addAction(action);
        }
예제 #14
0
        public virtual void animPos(VSMXBaseObject @object, VSMXBaseObject x, VSMXBaseObject y, VSMXBaseObject z, VSMXBaseObject duration)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("animPos from ({0},{1},{2}) to ({3}, {4}, {5}), duration={6}", posX, posY, posZ, x, y, z, duration));
            }

            AnimPosAction action = new AnimPosAction(this, x.FloatValue, y.FloatValue, z.FloatValue, duration.IntValue);

            Scheduler.addAction(action);
        }
예제 #15
0
        public virtual void animScale(VSMXBaseObject @object, VSMXBaseObject width, VSMXBaseObject height, VSMXBaseObject depth, VSMXBaseObject duration)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("animScale({0}, {1}, {2}, {3})", width, height, depth, duration));
            }

            AnimScaleAction action = new AnimScaleAction(this, width.FloatValue, height.FloatValue, depth.FloatValue, duration.IntValue);

            Scheduler.addAction(action);
        }
예제 #16
0
        public virtual void setRotate(VSMXBaseObject @object, VSMXBaseObject x, VSMXBaseObject y, VSMXBaseObject rotationRads)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("setRotate({0}, {1}, {2})", x, y, rotationRads));
            }

            rotateX     = x.FloatValue;
            rotateY     = y.FloatValue;
            rotateAngle = rotationRads.FloatValue;
        }
예제 #17
0
        public virtual void animColor(VSMXBaseObject @object, VSMXBaseObject red, VSMXBaseObject green, VSMXBaseObject blue, VSMXBaseObject alpha, VSMXBaseObject duration)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("animColor({0}, {1}, {2}, {3}, {4})", red, green, blue, alpha, duration));
            }

            AnimColorAction action = new AnimColorAction(this, red.FloatValue, green.FloatValue, blue.FloatValue, alpha.FloatValue, duration.IntValue);

            Scheduler.addAction(action);
        }
예제 #18
0
        protected internal override long doPlay(VSMXBaseObject @object)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("FireEventAnim {0}", @event.Event));
            }

            @object.Interpreter.interpretScript(@object, @event.Event);

            return(0);
        }
예제 #19
0
        public virtual VSMXBaseObject random(VSMXBaseObject @object)
        {
            float value = random_Renamed.nextFloat();

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("Math.random() returns {0:F}", value));
            }

            return(new VSMXNumber(interpreter, value));
        }
예제 #20
0
        public virtual VSMXBaseObject setUserData(VSMXBaseObject @object, VSMXBaseObject userData)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("Controller.setUserData({0})", userData));
            }

            this.userData = userData;

            // Returning true/false?
            return(VSMXBoolean.singletonTrue);
        }
예제 #21
0
        public override VSMXBaseObject createVSMXObject(VSMXInterpreter interpreter, VSMXBaseObject parent, RCOEntry entry)
        {
            VSMXBaseObject @object = base.createVSMXObject(interpreter, parent, entry);

            System.Drawing.Bitmap image = Image;
            if (image != null)
            {
                @object.setPropertyValue(Resource.textureName, new VSMXNativeObject(interpreter, new ImageObject(image)));
            }

            return(@object);
        }
예제 #22
0
 public virtual void changeResumeInfo(VSMXBaseObject @object, VSMXBaseObject videoNumber, VSMXBaseObject audioNumber, VSMXBaseObject audioFlag, VSMXBaseObject subtitleNumber, VSMXBaseObject subtitleFlag)
 {
     //if (log.DebugEnabled)
     {
         Console.WriteLine(string.Format("MoviePlayer.changeResumeInfo videoNumber=0x{0:X}, audioNumber=0x{1:X}, audioFlag=0x{2:X}, subtitleNumber={3:D}, subtitleFlag=0x{4:X}", videoNumber.IntValue, audioNumber.IntValue, audioFlag.IntValue, subtitleNumber.IntValue, subtitleFlag.IntValue));
     }
     this.videoNumber    = videoNumber.IntValue;
     this.audioNumber    = audioNumber.IntValue;
     this.audioFlag      = audioFlag.IntValue;
     this.subtitleNumber = subtitleNumber.IntValue;
     this.subtitleFlag   = subtitleFlag.IntValue;
 }
예제 #23
0
        public virtual void setSize(VSMXBaseObject @object, VSMXBaseObject width, VSMXBaseObject height, VSMXBaseObject depth)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("setSize({0}, {1}, {2})", width, height, depth));
            }

            this.width.FloatValue  = width.FloatValue;
            this.height.FloatValue = height.FloatValue;
            this.depth.FloatValue  = depth.FloatValue;

            onDisplayUpdated();
        }
예제 #24
0
 protected internal override long doPlay(VSMXBaseObject @object)
 {
     if (@object is VSMXNativeObject)
     {
         VSMXNativeObject nativeObject     = (VSMXNativeObject)@object;
         BaseNativeObject baseNativeObject = nativeObject.Object;
         if (baseNativeObject is BasePositionObject)
         {
             return(doPlayReference((BasePositionObject)baseNativeObject));
         }
     }
     return(base.doPlay(@object));
 }
예제 #25
0
        public virtual void callCallback(VSMXInterpreter interpreter, string name, VSMXBaseObject[] arguments)
        {
            VSMXBaseObject function = object.getPropertyValue(name);

            if (function is VSMXFunction)
            {
                //if (log.DebugEnabled)
                {
                    Console.WriteLine(string.Format("callCallback {0}, arguments={1}", name, arguments));
                }

                interpreter.interpretFunction((VSMXFunction)function, null, arguments);
            }
        }
예제 #26
0
        public virtual void setColor(VSMXBaseObject @object, VSMXBaseObject red, VSMXBaseObject green, VSMXBaseObject blue, VSMXBaseObject alpha)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("setColor({0}, {1}, {2}, {3})", red, green, blue, alpha));
            }

            redScale.FloatValue   = red.FloatValue;
            greenScale.FloatValue = green.FloatValue;
            blueScale.FloatValue  = blue.FloatValue;
            alphaScale.FloatValue = alpha.FloatValue;

            onDisplayUpdated();
        }
예제 #27
0
        public virtual VSMXBaseObject getPos(VSMXBaseObject @object)
        {
            VSMXInterpreter interpreter = @object.Interpreter;
            VSMXArray       pos         = new VSMXArray(interpreter, 3);

            pos.setPropertyValue(0, new VSMXNumber(interpreter, posX.FloatValue));
            pos.setPropertyValue(1, new VSMXNumber(interpreter, posY.FloatValue));
            pos.setPropertyValue(2, new VSMXNumber(interpreter, posZ.FloatValue));

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("getPos() returning {0}", pos));
            }

            return(pos);
        }
예제 #28
0
        public virtual VSMXBaseObject getColor(VSMXBaseObject @object)
        {
            VSMXInterpreter interpreter = @object.Interpreter;
            VSMXArray       color       = new VSMXArray(interpreter, 4);

            color.setPropertyValue(0, new VSMXNumber(interpreter, redScale.FloatValue));
            color.setPropertyValue(1, new VSMXNumber(interpreter, greenScale.FloatValue));
            color.setPropertyValue(2, new VSMXNumber(interpreter, blueScale.FloatValue));
            color.setPropertyValue(3, new VSMXNumber(interpreter, alphaScale.FloatValue));

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("getColor() returning {0}", color));
            }

            return(color);
        }
예제 #29
0
        public virtual VSMXBaseObject changeResource(VSMXBaseObject @object, VSMXBaseObject resource)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("Controller.changeResource({0})", resource));
            }

            string newResource = resource.StringValue;

            if (!this.resource.Equals(newResource))
            {
                IAction action = new ChangeResourceAction(this, newResource);
                Emulator.Scheduler.addAction(action);
            }

            // Returning true/false?
            return(VSMXBoolean.singletonTrue);
        }
예제 #30
0
        public virtual void onChapter(int chapterNumber)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("MoviePlayer.onChapter chapterNumber={0:D}", chapterNumber));
            }

            VSMXBaseObject callback = object.getPropertyValue("onChapter");

            if (callback is VSMXFunction)
            {
                VSMXBaseObject argument = new VSMXObject(interpreter, null);
                argument.setPropertyValue("chapterNumber", new VSMXNumber(interpreter, chapterNumber));

                VSMXBaseObject[] arguments = new VSMXBaseObject[1];
                arguments[0] = argument;
                interpreter.interpretFunction((VSMXFunction)callback, null, arguments);
            }
        }