diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/customseek.m b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/customseek.m new file mode 100755 index 00000000..f0fa045a --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/customseek.m @@ -0,0 +1,111 @@ +//---------------------------------------------------------------------------------------- +// +// customseek.m +// +//---------------------------------------------------------------------------------------- +// Use like this : +// #define CUSTOM_SEEK_VAR MyVar +// #include "customseek.m" +// +// +// What you need : +// _MyVarInit(Layer seeksurface, Layer seekghost, Map seekmap); +// _MyVarShutdown(); +// + + + +Global Layer _##CUSTOM_SEEK_VAR##Surface; +Global Layer _##CUSTOM_SEEK_VAR##Ghost; +Global Map _##CUSTOM_SEEK_VAR##Map; +Global Int _##CUSTOM_SEEK_VAR##Clicked; +Global Timer _##CUSTOM_SEEK_VAR##Timer; +Global Int _##CUSTOM_SEEK_VAR##CurPos; + +Function _##CUSTOM_SEEK_VAR##Init(Layer s, Layer g, Map m); +Function _##CUSTOM_SEEK_VAR##Update(int newpos); +Function _##CUSTOM_SEEK_VAR##UpdateXY(int x, int y); +Function _##CUSTOM_SEEK_VAR##SeekTo(int x, int y); +Function _##CUSTOM_SEEK_VAR##Shutdown(); + +_##CUSTOM_SEEK_VAR##Init(Layer s, Layer g, Map m) { + _##CUSTOM_SEEK_VAR##Surface = s; + _##CUSTOM_SEEK_VAR##Ghost = g; + _##CUSTOM_SEEK_VAR##Map = m; + _##CUSTOM_SEEK_VAR##Update(0); + _##CUSTOM_SEEK_VAR##Timer = new Timer; + _##CUSTOM_SEEK_VAR##Timer.setDelay(150); + _##CUSTOM_SEEK_VAR##Timer.start(); +} + +_##CUSTOM_SEEK_VAR##Shutdown() { + delete _##CUSTOM_SEEK_VAR##Timer; +} + +_##CUSTOM_SEEK_VAR##Surface.onLeftButtonDown(int x, int y) { + if (getPlayItemLength() == 0) return; + if (Strleft(getPlayItemString(), 4) == "http") return; + _##CUSTOM_SEEK_VAR##Clicked = 1; + _##CUSTOM_SEEK_VAR##UpdateXY(x, y); +} + +_##CUSTOM_SEEK_VAR##Surface.onMouseMove(int x, int y) { + if (_##CUSTOM_SEEK_VAR##Clicked) { + if (getPlayItemLength() == 0) { + _##CUSTOM_SEEK_VAR##Clicked = 0; + return; + } + _##CUSTOM_SEEK_VAR##UpdateXY(x, y); + } +} + +_##CUSTOM_SEEK_VAR##Surface.onLeftButtonUp(int x, int y) { + if (!_##CUSTOM_SEEK_VAR##Clicked) return; + _##CUSTOM_SEEK_VAR##Clicked = 0; + _##CUSTOM_SEEK_VAR##SeekTo(x, y); +} + +_##CUSTOM_SEEK_VAR##SeekTo(int x, int y) { + int n = _##CUSTOM_SEEK_VAR##Map.getValue(x, y); + seekTo(getPlayItemLength() * (n / 255)); +} + +_##CUSTOM_SEEK_VAR##UpdateXY(int x, int y) { + int n = _##CUSTOM_SEEK_VAR##Map.getValue(x, y); + Region r = new Region; + r.loadFromMap(_##CUSTOM_SEEK_VAR##Map, n, 1); + r.offset(-_##CUSTOM_SEEK_VAR##Ghost.getLeft(), -_##CUSTOM_SEEK_VAR##Ghost.getTop()); + _##CUSTOM_SEEK_VAR##Ghost.setRegion(r); + delete r; +} + +_##CUSTOM_SEEK_VAR##Update(int newpos) { + float p; + int l = getPlayItemLength(); + if (l == 0) p = 0; + else p = newpos / l * 255; + Region r = new Region; + r.loadFromMap(_##CUSTOM_SEEK_VAR##Map, p, 1); + _##CUSTOM_SEEK_VAR##CurPos = p; + r.offset(-_##CUSTOM_SEEK_VAR##Ghost.getLeft(), -_##CUSTOM_SEEK_VAR##Ghost.getTop()); + _##CUSTOM_SEEK_VAR##Ghost.setRegion(r); + delete r; +} + +_##CUSTOM_SEEK_VAR##Timer.onTimer() { + if (_##CUSTOM_SEEK_VAR##Clicked) return; + int l = getPlayItemLength(); + if (l > 0) { + int p = getPosition() / l * 255; + if (p != _##CUSTOM_SEEK_VAR##CurPos) { + _##CUSTOM_SEEK_VAR##Update(getPosition()); + } + } else { + if (_##CUSTOM_SEEK_VAR##CurPos != 0) + _##CUSTOM_SEEK_VAR##Update(0); + _##CUSTOM_SEEK_VAR##CurPos = 0; + } +} + + + diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/dragvolume.m b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/dragvolume.m new file mode 100755 index 00000000..8b93311d --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/dragvolume.m @@ -0,0 +1,67 @@ +//---------------------------------------------------------------------------------------- +// +// dragvolume.m +// +//---------------------------------------------------------------------------------------- +// Use like this : +// #define DRAG_VOLUME_VAR MyVar +// #include "dragvolume.m" +// +// +// _MyVarInit(AnimatedLayer l); // init dragvolume +// _MyVarSetMaxDistance(Int nPixels); // set 100% pixel distance +// + + + +Global AnimatedLayer _##DRAG_VOLUME_VAR##AnimLayer; +Global Int _##DRAG_VOLUME_VAR##Clicked; +Global Int _##DRAG_VOLUME_VAR##Y; +Global Int _##DRAG_VOLUME_VAR##V; +Global Int _##DRAG_VOLUME_VAR##Max; + +Function _##DRAG_VOLUME_VAR##Init(AnimatedLayer l); +Function _##DRAG_VOLUME_VAR##Update(int vol); +Function _##DRAG_VOLUME_VAR##SetMaxDistance(int pixels); +Function _##DRAG_VOLUME_VAR##UpdateY(int y); + +_##DRAG_VOLUME_VAR##Init(AnimatedLayer l) { + _##DRAG_VOLUME_VAR##AnimLayer = l; + _##DRAG_VOLUME_VAR##Update(getVolume()); +} + +_##DRAG_VOLUME_VAR##AnimLayer.onLeftButtonDown(int x, int y) { + _##DRAG_VOLUME_VAR##Clicked = 1; + _##DRAG_VOLUME_VAR##Y = y; + _##DRAG_VOLUME_VAR##V = getVolume(); +} + +_##DRAG_VOLUME_VAR##AnimLayer.onMouseMove(int x, int y) { + if (_##DRAG_VOLUME_VAR##Clicked) { + _##DRAG_VOLUME_VAR##updateY(y); + } +} + +_##DRAG_VOLUME_VAR##AnimLayer.onLeftButtonUp(int x, int y) { + _##DRAG_VOLUME_VAR##Clicked = 0; +} + +_##DRAG_VOLUME_VAR##SetMaxDistance(int npix) { + _##DRAG_VOLUME_VAR##Max = npix; +} + +_##DRAG_VOLUME_VAR##UpdateY(int y) { + float p = (_##DRAG_VOLUME_VAR##Y - y) / _##DRAG_VOLUME_VAR##Max; + SetVolume(_##DRAG_VOLUME_VAR##V + p * 255); // range is checked +} + +_##DRAG_VOLUME_VAR##Update(int vol) { + float p = vol / 255; + _##DRAG_VOLUME_VAR##AnimLayer.gotoFrame(p * (_##DRAG_VOLUME_VAR##AnimLayer.getLength()-1)); +} + +#ifndef _##DRAG_VOLUME_VAR##NOSYSTEMHOOK +System.onVolumeChanged(int newvol) { + _##DRAG_VOLUME_VAR##Update(newvol); +} +#endif diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/rotationlayer.m b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/rotationlayer.m new file mode 100755 index 00000000..9652db25 --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/rotationlayer.m @@ -0,0 +1,61 @@ +//---------------------------------------------------------------------------------------- +// +// rotationlayer.m +// +//---------------------------------------------------------------------------------------- +// Use like this : +// #define ROTATION_LAYER_VAR MyVar +// #include "rotationlayer.m" +// +// _MyVarInit(String containername, String layoutname, String layername); // init rotationlayer +// _MyVarRotateDegree(double r); // in degrees +// _MyVarRotate(double r); // in radians +// double _MyVarGetRotationDegree(); // in degrees +// double _MyVarGetRotation(); // in radians +// + +#define PI 3.1415926536 + +Global Double _##ROTATION_LAYER_VAR##R; +Global Layer _##ROTATION_LAYER_VAR##Layer; + +Function _##ROTATION_LAYER_VAR##Init(String containername, String layoutname, String layername); +Function _##ROTATION_LAYER_VAR##RotateDegree(double r); +Function _##ROTATION_LAYER_VAR##Rotate(double r); +Function double _##ROTATION_LAYER_VAR##GetRotationDegree(); +Function double _##ROTATION_LAYER_VAR##GetRotation(); + +_##ROTATION_LAYER_VAR##RotateDegree(double r) { + _##ROTATION_LAYER_VAR##Rotate(r * PI / 180.0); +} + +_##ROTATION_LAYER_VAR##Rotate(double r) { + _##ROTATION_LAYER_VAR##R = r; + _##ROTATION_LAYER_VAR##Layer.fx_update(); +} + +double _##ROTATION_LAYER_VAR##GetRotationDegree() { + return _##ROTATION_LAYER_VAR##R * 180 / PI; +} + +double _##ROTATION_LAYER_VAR##GetRotation() { + return _##ROTATION_LAYER_VAR##R; +} + +_##ROTATION_LAYER_VAR##Init(String containername, String layoutname, String layername) { + _##ROTATION_LAYER_VAR##Layer = getContainer(containername).getLayout(layoutname).getObject(layername); + _##ROTATION_LAYER_VAR##Layer.fx_setGridSize(1,1); + _##ROTATION_LAYER_VAR##Layer.fx_setBgFx(0); + _##ROTATION_LAYER_VAR##Layer.fx_setWrap(1); + _##ROTATION_LAYER_VAR##Layer.fx_setBilinear(1); + _##ROTATION_LAYER_VAR##Layer.fx_setRect(0); + _##ROTATION_LAYER_VAR##Layer.fx_setClear(0); + _##ROTATION_LAYER_VAR##Layer.fx_setLocalized(1); + _##ROTATION_LAYER_VAR##Layer.fx_setRealtime(0); + _##ROTATION_LAYER_VAR##Layer.fx_setEnabled(1); +} + +_##ROTATION_LAYER_VAR##Layer.fx_onGetPixelR(double r, double d, double x, double y) { + return r + _##ROTATION_LAYER_VAR##R; +} + diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/std.mi b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/std.mi new file mode 100755 index 00000000..ee48e189 --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/Lib/std.mi @@ -0,0 +1,392 @@ +//---------------------------------------------------------------------------------------------------------------- +// std.mi +// +// standard definitions for internal objects +//---------------------------------------------------------------------------------------------------------------- + +// GUIDS + +extern class @{51654971-0D87-4a51-91E3-A6B53235F3E7}@ @{00000000-0000-0000-0000-000000000000}@ Object; +extern class @{D6F50F64-93FA-49b7-93F1-BA66EFAE3E98}@ Object SystemObject; +extern class @{E90DC47B-840D-4ae7-B02C-040BD275F7FC}@ Object Container; +extern class @{00C074A0-FEA2-49a0-BE8D-FABBDB161640}@ Object Wac; +extern class @{B2023AB5-434D-4ba1-BEAE-59637503F3C6}@ Object &List; +extern class @{38603665-461B-42a7-AA75-D83F6667BF73}@ Object ⤅ +extern class @{F4787AF4-B2BB-4ef7-9CFB-E74BA9BEA88D}@ Object &PopupMenu; +extern class @{3A370C02-3CBF-439f-84F1-86885BCF1E36}@ Object &Region; +extern class @{5D0C5BB6-7DE1-4b1f-A70F-8D1659941941}@ Object &Timer; +extern class @{4EE3E199-C636-4bec-97CD-78BC9C8628B0}@ Object &GuiObject; +extern class @{45BE95E5-2072-4191-935C-BB5FF9F117FD}@ GuiObject &Group; +extern class @{60906D4E-537E-482e-B004-CC9461885672}@ Group &Layout; +extern class @{403ABCC0-6F22-4bd6-8BA4-10C829932547}@ GuiObject &Component; +extern class @{97AA3E4D-F4D0-4fa8-817B-0AF22A454983}@ GuiObject &ComponentBucket; +extern class @{64E4BBFA-81F4-49d9-B0C0-A85B2EC3BCFD}@ GuiObject &Edit; +extern class @{62B65E3F-375E-408d-8DEA-76814AB91B77}@ GuiObject &Slider; +extern class @{CE4F97BE-77B0-4e19-9956-D49833C96C27}@ GuiObject &Vis; +extern class @{A8C2200D-51EB-4b2a-BA7F-5D4BC65D4C71}@ GuiObject &Browser; +extern class @{8D1EBA38-489E-483e-B960-8D1F43C5C405}@ GuiObject &EqVis; +extern class @{0F08C940-AF39-4b23-80F3-B8C48F7EBB59}@ GuiObject &Status; +extern class @{EFAA8672-310E-41fa-B7DC-85A9525BCB4B}@ GuiObject &Text; +extern class @{7DFD3244-3751-4e7c-BF40-82AE5F3ADC33}@ GuiObject &Title; +extern class @{5AB9FA15-9A7D-4557-ABC8-6557A6C67CA9}@ GuiObject &Layer; +extern class @{698EDDCD-8F1E-4fec-9B12-F944F909FF45}@ GuiObject &Button; +extern class @{6B64CD27-5A26-4c4b-8C59-E6A70CF6493A}@ Layer &AnimatedLayer; +extern class @{B4DCCFFF-81FE-4bcc-961B-720FD5BE0FFF}@ Button &ToggleButton; + +// class tree member functions & events + + // Object + +extern String Object.getClassName(); +extern String Object.getId(); +extern Int Object.onNotify(String, int, int); + + // System + +extern SystemObject.onScriptLoaded(); +extern SystemObject.onScriptUnloading(); +extern SystemObject.onQuit(); +extern SystemObject.onKeyDown(String); +extern SystemObject.onCreateLayout(Layout); +extern SystemObject.onShowLayout(Layout); +extern SystemObject.onHideLayout(Layout); +extern SystemObject.onStop(); +extern SystemObject.onPlay(); +extern SystemObject.onPause(); +extern SystemObject.onResume(); +extern SystemObject.onTitleChange(String); +extern SystemObject.onEqBandChanged(int, int); +extern SystemObject.onEqPreampChanged(int); +extern SystemObject.onEqChanged(int); +extern SystemObject.onVolumeChanged(int); +extern SystemObject.onSeek(int); +extern Container SystemObject.getContainer(String); +extern Container SystemObject.newDynamicContainer(String); +extern Int SystemObject.getNumContainers(); +extern Container SystemObject.enumContainer(Int); +extern Wac SystemObject.getWac(String); +extern Int SystemObject.messageBox(String, String, Int, String); +extern String SystemObject.getPlayItemString(); +extern Int SystemObject.getPlayItemLength(); +extern String SystemObject.getPlayItemMetaDataString(String); +extern SystemObject.playFile(String); +extern Int SystemObject.getLeftVuMeter(); +extern Int SystemObject.getRightVuMeter(); +extern Int SystemObject.getVolume(); +extern SystemObject.setVolume(Int); +extern SystemObject.play(); +extern SystemObject.stop(); +extern SystemObject.pause(); +extern SystemObject.next(); +extern SystemObject.previous(); +extern SystemObject.eject(); +extern SystemObject.seekTo(Int); +extern Int SystemObject.getPosition(); +extern SystemObject.setEqBand(int, Int); +extern SystemObject.setEqPreamp(Int); +extern SystemObject.setEq(Int); +extern Int SystemObject.getEqBand(int); +extern int SystemObject.getEqPreamp(); +extern int SystemObject.getEq(); +extern int SystemObject.getMousePosX(); +extern int SystemObject.getMousePosY(); +extern String SystemObject.integerToString(Int); +extern Int SystemObject.StringToInteger(String); +extern String SystemObject.floatToString(float, int); +extern Float SystemObject.stringToFloat(String); +extern String SystemObject.integerToTime(Int); +extern String SystemObject.strmid(String, Int, Int); +extern String SystemObject.Strleft(string, int); +extern string SystemObject.strright(string, int); +extern int SystemObject.strsearch(string, string); +extern int SystemObject.strlen(string); +extern string SystemObject.strupper(string); +extern string SystemObject.strlower(string); +extern string SystemObject.urlEncode(string); +extern string SystemObject.removePath(string); +extern string SystemObject.getToken(string, string, int); +extern double SystemObject.sin(double); +extern double SystemObject.cos(double); +extern double SystemObject.tan(double); +extern double SystemObject.asin(double); +extern double SystemObject.acos(double); +extern double SystemObject.atan(double); +extern double SystemObject.pow(double); +extern double SystemObject.sqr(double); +extern double SystemObject.sqrt(double); +extern int SystemObject.random(int); +extern SystemObject.setPrivateString(string, string, string); +extern SystemObject.setPrivateInt(string, string, int); +extern String SystemObject.getPrivateString(String, String, String); +extern Int SystemObject.getPrivateInt(String, String, Int); +extern SystemObject.setPublicString(String, String); +extern SystemObject.setPublicInt(String, Int); +extern String SystemObject.getPublicString(String, String); +extern Int SystemObject.getPublicInt(String, Int); +extern String SystemObject.getParam(); +extern Int SystemObject.getViewportWidth(); +extern Int SystemObject.getViewportHeight(); +extern SystemObject.debugString(String, Int); +extern SystemObject.ddeSend(String, String, Int); + + // Container + +extern Container.onSwitchToLayout(Layout); +extern Container.onHideLayout(Layout); +extern Container.onShowLayout(Layout); +extern Layout Container.getLayout(String); +extern Int Container.getNumLayouts(); +extern Layout Container.enumLayout(Int); +extern Container.switchToLayout(Layout); +extern Container.show(); +extern Container.hide(); +extern Container.toggle(); + + // Wac + +extern String Wac.getGuid(); +extern String Wac.getName(); +extern Int Wac.sendCommand(String, Int, Int, String); +extern Wac.show(); +extern Wac.hide(); +extern Boolean Wac.isVisible(); +extern Wac.onNotify(String, Int, Int); +extern Wac.onShow(); +extern Wac.onHide(); +extern Wac.setStatusBar(Boolean); +extern Boolean Wac.getStatusBar(); + + + // GuiObject + +extern GuiObject.show(); +extern GuiObject.hide(); +extern int GuiObject.isVisible(); +extern GuiObject.onSetVisible(Boolean); +extern GuiObject.setAlpha(int); +extern int GuiObject.getAlpha(); +extern GuiObject.onLeftButtonUp(int, int); +extern GuiObject.onLeftButtonDown(int, int); +extern GuiObject.onRightButtonUp(int, int); +extern GuiObject.onRightButtonDown(int, int); +extern GuiObject.onRightButtonDblClk(int, int); +extern GuiObject.onLeftButtonDblClk(int, int); +extern GuiObject.onMouseMove(int, int); +extern GuiObject.onEnterArea(); +extern GuiObject.onLeaveArea(); +extern GuiObject.setEnabled(boolean); +extern boolean GuiObject.getEnabled(); +extern GuiObject.onEnable(boolean); +extern GuiObject.resize(int, int, int, int); +extern GuiObject.onResize(int, int, int, int); +extern boolean GuiObject.isMouseOver(int, int); +extern int GuiObject.getLeft(); +extern int GuiObject.getTop(); +extern int GuiObject.getWidth(); +extern int GuiObject.getHeight(); +extern GuiObject.setTargetX(int); +extern GuiObject.setTargetY(int); +extern GuiObject.setTargetW(int); +extern GuiObject.setTargetH(int); +extern GuiObject.setTargetA(int); +extern GuiObject.setTargetSpeed(float); +extern GuiObject.gotoTarget(); +extern GuiObject.onTargetReached(); +extern boolean GuiObject.isGoingToTarget(); +extern GuiObject.setXmlParam(String, String); +extern GuiObject.init(Layout); +extern GuiObject.bringToFront(); +extern GuiObject.bringToBack(); +extern GuiObject.bringAbove(GuiObject); +extern GuiObject.bringBelow(GuiObject); + // Group + +extern GuiObject Group.getObject(String); +extern Int Group.getNumObjects(); +extern GuiObject Group.enumObject(Int); +extern Group.onCreateObject(GuiObject); +extern Int Group.getMousePosX(); +extern Int Group.getMousePosY(); + + + // Layout + +extern Layout.onDock(); +extern Layout.onUndock(); +extern Layout.onScale(Double); +extern Double Layout.getScale(); +extern Layout.setScale(Double); + + + // List + +extern List.addItem(Any); +extern List.removeItem(int); +extern Any List.enumItem(int); +extern Int List.findItem(Any); +extern int List.getNumItems(); +extern List.removeAll(); + + // Map + +extern Int Map.getValue(int, int); +extern Boolean Map.inRegion(int, int); +extern Map.loadMap(String); +extern Int Map.getWidth(); +extern Int Map.getHeight(); +extern Region Map.getRegion(); + + // PopupMenu + +extern PopupMenu.addSubMenu(PopupMenu, String); +extern PopupMenu.addCommand(String, Int, Boolean, Boolean); +extern PopupMenu.addSeparator(); +extern Int PopupMenu.popAtXY(int, int); +extern Int PopupMenu.popAtMouse(); +extern Int PopupMenu.getNumCommands(); +extern PopupMenu.checkCommand(int, boolean); +extern PopupMenu.disableCommand(int, boolean); + + // Region + +extern Region.add(Region); +extern Region.sub(Region); +extern Region.offset(int, int); +extern Region.stretch(double); +extern Region.copy(Region); +extern Region.loadFromMap(Map, Int, Boolean); +extern Region.loadFromBitmap(String); +extern Int Region.getBoundingBoX(); +extern Int Region.getBoundingBoY(); +extern Int Region.getBoundingBoW(); +extern Int Region.getBoundingBoH(); + + // Timer + +extern Timer.onTimer(); +extern Timer.setDelay(int); +extern Int Timer.getDelay(); +extern Timer.start(); +extern Timer.stop(); + + // Component + +extern Component.onGetWac(Wac); +extern String Component.getGuid(); +extern Wac Component.getWac(); +extern Component.setRegionFromMap(Map, Int, Boolean); +extern Component.setRegion(Region); + + // Edit + +extern Edit.onEnter(); +extern Edit.onAbort(); +extern Edit.onIdleEditUpdate(); +extern Edit.onEditUpdate(); +extern Edit.setText(String); +extern String Edit.getText(); + + // Slider + +extern Slider.onSetPosition(int); +extern Slider.onPostedPosition(int); +extern Slider.onSetFinalPosition(int); +extern Slider.setPosition(int); +extern Int Slider.getPosition(); + + // Vis + +extern Vis.onFrame(); +extern Vis.setRealtime(Boolean); +extern Boolean Vis.getRealtime(); + + // Browser + +extern Browser.gotoUrl(String); +extern Browser.back(); +extern Browser.forward(); + + // Text + +extern Text.setText(String); + + // Layer + +extern Layer.onBeginResize(int, int, int, int); +extern Layer.onEndResize(int, int, int, int); +extern Layer.fx_onInit(); +extern Layer.fx_onFrame(); +extern Double Layer.fx_onGetPixelR(double, double, double, double); +extern Double Layer.fx_onGetPixelD(double, double, double, double); +extern Double Layer.fx_onGetPixelX(double, double, double, double); +extern Double Layer.fx_onGetPixelY(double, double, double, double); +extern Double Layer.fx_onGetPixelA(double, double, double, double); +extern Layer.setRegionFromMap(Map, int, boolean); +extern Layer.setRegion(Region); +extern Layer.fx_setEnabled(boolean); +extern Boolean Layer.fx_getEnabled(); +extern Layer.fx_setWrap(Boolean); +extern Boolean Layer.fx_getWrap(); +extern Layer.fx_setRect(Boolean); +extern Boolean Layer.fx_getRect(); +extern Layer.fx_setBgFx(Boolean); +extern Boolean Layer.fx_getBgFx(); +extern Layer.fx_setClear(Boolean); +extern Boolean Layer.fx_getClear(); +extern Layer.fx_setSpeed(Int); +extern Int Layer.fx_getSpeed(); +extern Layer.fx_setRealtime(Boolean); +extern Boolean Layer.fx_getRealtime(); +extern Layer.fx_setLocalized(Boolean); +extern Boolean Layer.fx_getLocalized(); +extern Layer.fx_setBilinear(Boolean); +extern Boolean Layer.fx_getBilinear(); +extern Layer.fx_setAlphaMode(Boolean); +extern Boolean Layer.fx_getAlphaMode(); +extern Layer.fx_setGridSize(Int, Int); +extern Layer.fx_update(); +extern Layer.fx_restart(); + + // Button + +extern Button.onActivate(); +extern Button.onLeftClick(); +extern Button.onRightClick(); +extern Button.setActivated(Boolean); +extern Boolean Button.getActivated(); +extern Button.leftClick(); +extern Button.rightClick(); + + // AnimatedLayer + +extern AnimatedLayer.onPlay(); +extern AnimatedLayer.onPause(); +extern AnimatedLayer.onResume(); +extern AnimatedLayer.onStop(); +extern AnimatedLayer.onFrame(Int); +extern AnimatedLayer.setSpeed(Int); +extern AnimatedLayer.gotoFrame(int); +extern AnimatedLayer.setStartFrame(Int); +extern AnimatedLayer.setEndFrame(int); +extern AnimatedLayer.setAutoReplay(Boolean); +extern AnimatedLayer.play(); +extern AnimatedLayer.stop(); +extern AnimatedLayer.pause(); +extern Boolean AnimatedLayer.isPlaying(); +extern Boolean AnimatedLayer.isPaused(); +extern Boolean AnimatedLayer.isStopped(); +extern Int AnimatedLayer.getStartFrame(); +extern Int AnimatedLayer.getEndFrame(); +extern Int AnimatedLayer.getLength(); +extern Int AnimatedLayer.getDirection(); +extern Boolean AnimatedLayer.getAutoReplay(); +extern Int AnimatedLayer.getCurFrame(); +extern AnimatedLayer.setRealtime(Boolean); + + // ToggleButton + +extern ToggleButton.onToggle(Boolean); + + +.CODE + diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/mc.exe b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/mc.exe new file mode 100755 index 00000000..d574c25e Binary files /dev/null and b/experiments/maki-interpreter/reference/maki_compiler/v1.1.0.a9 (Winamp 3 alpha 8r)/mc.exe differ diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/centerlayer.m b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/centerlayer.m new file mode 100755 index 00000000..43ac1540 --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/centerlayer.m @@ -0,0 +1,47 @@ +// ---------------------------------------------------------------------- +// centerlayer.m +// ---------------------------------------------------------------------- +// by Brennan +// Use like this : +// #define CENTER_VAR MyVar +// Global MyVar; +// #include "centerlayer.h" +// Layout l = getContainer("containername").getLayout("layoutname"); +// MyVar = l.getObject("something"); +// _MyVarInit(Layer MyVar, Layout l, int centerx, int centery); +// ---------------------------------------------------------------------- + +Global Layer _##CENTER_VAR##Layer; +Global Layout _##CENTER_VAR##Layout; // parent Layout to center in +Global Int _##CENTER_VAR##centerx; // should we center x? +Global Int _##CENTER_VAR##centery; // should we center y? + +Function _##CENTER_VAR##Init(Layer _layer, Layout parentLayout, int centerx, int centery); +Function _##CENTER_VAR##handleResize(); + +_##CENTER_VAR##Init(Layer _layer, Layout parentLayout, int centerx, int centery) { + _##CENTER_VAR##Layer = _layer; + _##CENTER_VAR##Layout = parentLayout; + _##CENTER_VAR##centerx = centerx; + _##CENTER_VAR##centery = centery; + _##CENTER_VAR##handleResize(); +} + +_##CENTER_VAR##handleResize() { + int myw = _##CENTER_VAR##Layout.getWidth(); + int myh = _##CENTER_VAR##Layout.getHeight(); + + int layerw = _##CENTER_VAR##Layer.getWidth(); + int layerh = _##CENTER_VAR##Layer.getHeight(); + + int x = _##CENTER_VAR##Layer.getLeft(); + int y = _##CENTER_VAR##Layer.getTop(); + if (_##CENTER_VAR##centerx) x = (myw - layerw)/2; + if (_##CENTER_VAR##centery) y = (myh - layerh)/2; + + _##CENTER_VAR##Layer.resize(x, y, layerw, layerh); +} + +_##CENTER_VAR##Layout.onResize(int x, int y, int w, int h) { + _##CENTER_VAR##handleResize(); +} diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/config.mi b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/config.mi new file mode 100755 index 00000000..c0aaca75 --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/config.mi @@ -0,0 +1,16 @@ +extern class @{593DBA22-D077-4976-B952-F4713655400B}@ Object _predecl Config; +extern class @{D4030282-3AAB-4d87-878D-12326FADFCD5}@ Object ConfigItem; +extern class @{24DEC283-B76E-4a36-8CCC-9E24C46B6C73}@ Object ConfigAttribute; + +extern ConfigItem Config.getItem(String item_name); +extern ConfigItem Config.getItemByGuid(String item_guid); + +extern ConfigAttribute ConfigItem.getAttribute(String attr_name); +extern String ConfigItem.getGuid(String attr_name); + +extern ConfigAttribute.setData(String value); +extern String ConfigAttribute.getData(); +extern ConfigAttribute.onDataChanged(); +extern ConfigItem ConfigAttribute.getParentItem(); +extern String ConfigAttribute.getAttributeName(); + diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/customseek.m b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/customseek.m new file mode 100755 index 00000000..7afd084c --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/customseek.m @@ -0,0 +1,118 @@ +//---------------------------------------------------------------------------------------- +// +// customseek.m +// +//---------------------------------------------------------------------------------------- +// Use like this : +// #define CUSTOM_SEEK_VAR MyVar +// #include "customseek.m" +// +// +// What you need : +// _MyVarInit(Layer seeksurface, Layer seekghost, Map seekmap); +// _MyVarShutdown(); +// + + + +Global Layer _##CUSTOM_SEEK_VAR##Surface; +Global Layer _##CUSTOM_SEEK_VAR##Ghost; +Global Map _##CUSTOM_SEEK_VAR##Map; +Global Int _##CUSTOM_SEEK_VAR##Clicked; +Global Timer _##CUSTOM_SEEK_VAR##Timer; +Global Int _##CUSTOM_SEEK_VAR##CurPos; + +Function _##CUSTOM_SEEK_VAR##Init(Layer s, Layer g, Map m); +Function _##CUSTOM_SEEK_VAR##Update(int newpos); +Function _##CUSTOM_SEEK_VAR##UpdateXY(int x, int y); +Function _##CUSTOM_SEEK_VAR##SeekTo(int x, int y); +Function _##CUSTOM_SEEK_VAR##Shutdown(); + +_##CUSTOM_SEEK_VAR##Init(Layer s, Layer g, Map m) { + _##CUSTOM_SEEK_VAR##Surface = s; + _##CUSTOM_SEEK_VAR##Ghost = g; + _##CUSTOM_SEEK_VAR##Map = m; + _##CUSTOM_SEEK_VAR##Update(0); + _##CUSTOM_SEEK_VAR##Timer = new Timer; + _##CUSTOM_SEEK_VAR##Timer.setDelay(500); + _##CUSTOM_SEEK_VAR##Timer.start(); +} + +_##CUSTOM_SEEK_VAR##Shutdown() { + delete _##CUSTOM_SEEK_VAR##Timer; +} + +_##CUSTOM_SEEK_VAR##Surface.onLeftButtonDown(int x, int y) { + if (getPlayItemLength() <= 0) return; + if (Strleft(getPlayItemString(), 4) == "http") return; + _##CUSTOM_SEEK_VAR##Clicked = 1; + _##CUSTOM_SEEK_VAR##UpdateXY(x, y); +} + +_##CUSTOM_SEEK_VAR##Surface.onMouseMove(int x, int y) { + if (_##CUSTOM_SEEK_VAR##Clicked) { + if (getPlayItemLength() == 0) { + _##CUSTOM_SEEK_VAR##Clicked = 0; + return; + } + _##CUSTOM_SEEK_VAR##UpdateXY(x, y); + } +} + +_##CUSTOM_SEEK_VAR##Surface.onLeftButtonUp(int x, int y) { + if (!_##CUSTOM_SEEK_VAR##Clicked) return; + _##CUSTOM_SEEK_VAR##Clicked = 0; + _##CUSTOM_SEEK_VAR##SeekTo(x, y); +} + +_##CUSTOM_SEEK_VAR##SeekTo(int x, int y) { + int n = _##CUSTOM_SEEK_VAR##Map.getValue(x, y); + seekTo(getPlayItemLength() * (n / 255)); +} + +_##CUSTOM_SEEK_VAR##UpdateXY(int x, int y) { + int n = _##CUSTOM_SEEK_VAR##Map.getValue(x, y); + Region r = new Region; + r.loadFromMap(_##CUSTOM_SEEK_VAR##Map, n, 1); + r.offset(-_##CUSTOM_SEEK_VAR##Ghost.getLeft(), -_##CUSTOM_SEEK_VAR##Ghost.getTop()); + _##CUSTOM_SEEK_VAR##Ghost.setRegion(r); + #ifdef CUSTOM_SEEK_CALLBACK + int n = _##CUSTOM_SEEK_VAR##Map.getValue(x, y); + _##CUSTOM_SEEK_VAR##OnUpdate(r, getPlayItemLength() * (n / 255)); + #endif + delete r; +} + +_##CUSTOM_SEEK_VAR##Update(int newpos) { + float p; + int l = getPlayItemLength(); + if (l == 0) p = 0; + else p = newpos / l * 255; + Region r = new Region; + r.loadFromMap(_##CUSTOM_SEEK_VAR##Map, p, 1); + _##CUSTOM_SEEK_VAR##CurPos = p; + r.offset(-_##CUSTOM_SEEK_VAR##Ghost.getLeft(), -_##CUSTOM_SEEK_VAR##Ghost.getTop()); + _##CUSTOM_SEEK_VAR##Ghost.setRegion(r); + #ifdef CUSTOM_SEEK_CALLBACK + _##CUSTOM_SEEK_VAR##OnUpdate(r, newpos); + #endif + delete r; +} + +_##CUSTOM_SEEK_VAR##Timer.onTimer() { + if (_##CUSTOM_SEEK_VAR##Clicked) return; + int l = getPlayItemLength(); + if (l > 0) { + int p = getPosition() / l * 255; + if (p != _##CUSTOM_SEEK_VAR##CurPos) { + _##CUSTOM_SEEK_VAR##Update(getPosition()); + } + } else { + if (_##CUSTOM_SEEK_VAR##CurPos != 0) + _##CUSTOM_SEEK_VAR##Update(0); + _##CUSTOM_SEEK_VAR##CurPos = 0; + } +} + + + diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/dragvolume.m b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/dragvolume.m new file mode 100755 index 00000000..8b93311d --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/dragvolume.m @@ -0,0 +1,67 @@ +//---------------------------------------------------------------------------------------- +// +// dragvolume.m +// +//---------------------------------------------------------------------------------------- +// Use like this : +// #define DRAG_VOLUME_VAR MyVar +// #include "dragvolume.m" +// +// +// _MyVarInit(AnimatedLayer l); // init dragvolume +// _MyVarSetMaxDistance(Int nPixels); // set 100% pixel distance +// + + + +Global AnimatedLayer _##DRAG_VOLUME_VAR##AnimLayer; +Global Int _##DRAG_VOLUME_VAR##Clicked; +Global Int _##DRAG_VOLUME_VAR##Y; +Global Int _##DRAG_VOLUME_VAR##V; +Global Int _##DRAG_VOLUME_VAR##Max; + +Function _##DRAG_VOLUME_VAR##Init(AnimatedLayer l); +Function _##DRAG_VOLUME_VAR##Update(int vol); +Function _##DRAG_VOLUME_VAR##SetMaxDistance(int pixels); +Function _##DRAG_VOLUME_VAR##UpdateY(int y); + +_##DRAG_VOLUME_VAR##Init(AnimatedLayer l) { + _##DRAG_VOLUME_VAR##AnimLayer = l; + _##DRAG_VOLUME_VAR##Update(getVolume()); +} + +_##DRAG_VOLUME_VAR##AnimLayer.onLeftButtonDown(int x, int y) { + _##DRAG_VOLUME_VAR##Clicked = 1; + _##DRAG_VOLUME_VAR##Y = y; + _##DRAG_VOLUME_VAR##V = getVolume(); +} + +_##DRAG_VOLUME_VAR##AnimLayer.onMouseMove(int x, int y) { + if (_##DRAG_VOLUME_VAR##Clicked) { + _##DRAG_VOLUME_VAR##updateY(y); + } +} + +_##DRAG_VOLUME_VAR##AnimLayer.onLeftButtonUp(int x, int y) { + _##DRAG_VOLUME_VAR##Clicked = 0; +} + +_##DRAG_VOLUME_VAR##SetMaxDistance(int npix) { + _##DRAG_VOLUME_VAR##Max = npix; +} + +_##DRAG_VOLUME_VAR##UpdateY(int y) { + float p = (_##DRAG_VOLUME_VAR##Y - y) / _##DRAG_VOLUME_VAR##Max; + SetVolume(_##DRAG_VOLUME_VAR##V + p * 255); // range is checked +} + +_##DRAG_VOLUME_VAR##Update(int vol) { + float p = vol / 255; + _##DRAG_VOLUME_VAR##AnimLayer.gotoFrame(p * (_##DRAG_VOLUME_VAR##AnimLayer.getLength()-1)); +} + +#ifndef _##DRAG_VOLUME_VAR##NOSYSTEMHOOK +System.onVolumeChanged(int newvol) { + _##DRAG_VOLUME_VAR##Update(newvol); +} +#endif diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/pldir.mi b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/pldir.mi new file mode 100755 index 00000000..4529e897 --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/pldir.mi @@ -0,0 +1,5 @@ +extern class @{61A7ABAD-7D79-41f6-B1D0-E1808603A4F4}@ Object _predecl PlDir; + +extern PlDir.showCurrentlyPlayingEntry(); + + diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/rotationlayer.m b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/rotationlayer.m new file mode 100755 index 00000000..ba8a2796 --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/rotationlayer.m @@ -0,0 +1,63 @@ +//---------------------------------------------------------------------------------------- +// +// rotationlayer.m +// +//---------------------------------------------------------------------------------------- +// Use like this : +// #define ROTATION_LAYER_VAR MyVar +// #include "rotationlayer.m" +// +// _MyVarInit(Group parentgroup, String layername); // init rotationlayer +// _MyVarRotateDegree(double r); // in degrees +// _MyVarRotate(double r); // in radians +// double _MyVarGetRotationDegree(); // in degrees +// double _MyVarGetRotation(); // in radians +// + +#ifndef PI +#define PI 3.1415926536 +#endif + +Global Double _##ROTATION_LAYER_VAR##R; +Global Layer _##ROTATION_LAYER_VAR##Layer; + +Function _##ROTATION_LAYER_VAR##Init(Group parentgroup, String layername); +Function _##ROTATION_LAYER_VAR##RotateDegree(double r); +Function _##ROTATION_LAYER_VAR##Rotate(double r); +Function double _##ROTATION_LAYER_VAR##GetRotationDegree(); +Function double _##ROTATION_LAYER_VAR##GetRotation(); + +_##ROTATION_LAYER_VAR##RotateDegree(double r) { + _##ROTATION_LAYER_VAR##Rotate(r * PI / 180.0); +} + +_##ROTATION_LAYER_VAR##Rotate(double r) { + _##ROTATION_LAYER_VAR##R = r; + _##ROTATION_LAYER_VAR##Layer.fx_update(); +} + +double _##ROTATION_LAYER_VAR##GetRotationDegree() { + return _##ROTATION_LAYER_VAR##R * 180 / PI; +} + +double _##ROTATION_LAYER_VAR##GetRotation() { + return _##ROTATION_LAYER_VAR##R; +} + +_##ROTATION_LAYER_VAR##Init(Group parentgroup, String layername) { + _##ROTATION_LAYER_VAR##Layer = parentgroup.getObject(layername); + _##ROTATION_LAYER_VAR##Layer.fx_setGridSize(1,1); + _##ROTATION_LAYER_VAR##Layer.fx_setBgFx(0); + _##ROTATION_LAYER_VAR##Layer.fx_setWrap(1); + _##ROTATION_LAYER_VAR##Layer.fx_setBilinear(1); + _##ROTATION_LAYER_VAR##Layer.fx_setRect(0); + _##ROTATION_LAYER_VAR##Layer.fx_setClear(0); + _##ROTATION_LAYER_VAR##Layer.fx_setLocalized(1); + _##ROTATION_LAYER_VAR##Layer.fx_setRealtime(0); + _##ROTATION_LAYER_VAR##Layer.fx_setEnabled(1); +} + +_##ROTATION_LAYER_VAR##Layer.fx_onGetPixelR(double r, double d, double x, double y) { + return r + _##ROTATION_LAYER_VAR##R; +} + diff --git a/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/std.mi b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/std.mi new file mode 100755 index 00000000..443f7dd0 --- /dev/null +++ b/experiments/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/Lib/std.mi @@ -0,0 +1,2085 @@ +//---------------------------------------------------------------------------------------------------------------- +// std.mi +// +// standard definitions for internal objects +//---------------------------------------------------------------------------------------------------------------- + +#ifndef true +#define true 1 +#endif +#ifndef false +#define false 0 +#endif + + +// GUIDS +extern class @{51654971-0D87-4a51-91E3-A6B53235F3E7}@ @{00000000-0000-0000-0000-000000000000}@ Object; +extern class @{D6F50F64-93FA-49b7-93F1-BA66EFAE3E98}@ Object _predecl System; +extern class @{E90DC47B-840D-4ae7-B02C-040BD275F7FC}@ Object Container; +extern class @{00C074A0-FEA2-49a0-BE8D-FABBDB161640}@ Object Wac; +extern class @{B2023AB5-434D-4ba1-BEAE-59637503F3C6}@ Object &List; +extern class @{38603665-461B-42a7-AA75-D83F6667BF73}@ Object ⤅ +extern class @{F4787AF4-B2BB-4ef7-9CFB-E74BA9BEA88D}@ Object &PopupMenu; +extern class @{3A370C02-3CBF-439f-84F1-86885BCF1E36}@ Object &Region; +extern class @{5D0C5BB6-7DE1-4b1f-A70F-8D1659941941}@ Object &Timer; +extern class @{4EE3E199-C636-4bec-97CD-78BC9C8628B0}@ Object &GuiObject; +extern class @{45BE95E5-2072-4191-935C-BB5FF9F117FD}@ GuiObject &Group; +extern class @{60906D4E-537E-482e-B004-CC9461885672}@ Group &Layout; +extern class @{403ABCC0-6F22-4bd6-8BA4-10C829932547}@ GuiObject &Component; +extern class @{97AA3E4D-F4D0-4fa8-817B-0AF22A454983}@ GuiObject &ComponentBucket; +extern class @{64E4BBFA-81F4-49d9-B0C0-A85B2EC3BCFD}@ GuiObject &Edit; +extern class @{62B65E3F-375E-408d-8DEA-76814AB91B77}@ GuiObject &Slider; +extern class @{CE4F97BE-77B0-4e19-9956-D49833C96C27}@ GuiObject &Vis; +extern class @{A8C2200D-51EB-4b2a-BA7F-5D4BC65D4C71}@ GuiObject &Browser; +extern class @{8D1EBA38-489E-483e-B960-8D1F43C5C405}@ GuiObject &EqVis; +extern class @{0F08C940-AF39-4b23-80F3-B8C48F7EBB59}@ GuiObject &Status; +extern class @{EFAA8672-310E-41fa-B7DC-85A9525BCB4B}@ GuiObject &Text; +extern class @{7DFD3244-3751-4e7c-BF40-82AE5F3ADC33}@ GuiObject &Title; +extern class @{5AB9FA15-9A7D-4557-ABC8-6557A6C67CA9}@ GuiObject &Layer; +extern class @{698EDDCD-8F1E-4fec-9B12-F944F909FF45}@ GuiObject &Button; +extern class @{6B64CD27-5A26-4c4b-8C59-E6A70CF6493A}@ Layer &AnimatedLayer; +extern class @{B4DCCFFF-81FE-4bcc-961B-720FD5BE0FFF}@ Button &ToggleButton; +extern class @{01E28CE1-B059-11d5-979F-E4DE6F51760A}@ GuiObject &GroupList; +extern class @{80F0F8BD-1BA5-42a6-A093-3236A00C8D4A}@ Group &CfgGroup; +extern class @{CDCB785D-81F2-4253-8F05-61B872283CFA}@ GuiObject &QueryList; +extern class @{9B2E341B-6C98-40fa-8B85-0C1B6EE89405}@ GuiObject &MouseRedir; +extern class @{36D59B71-03FD-4af8-9795-0502B7DB267A}@ GuiObject &DropDownList; +extern class @{7FD5F210-ACC4-48df-A6A0-5451576CDC76}@ GuiObject &LayoutStatus; +extern class @{B5BAA535-05B3-4dcb-ADC1-E618D28F6896}@ GuiObject &TabSheet; + + +// class tree member functions & events + +//***************************************************************************** +// Object CLASS +//***************************************************************************** +/** + Object Class. + + @short This is the base class from which all other classes inherit. + @author Nullsoft Inc. + @ver 1.0 +*/ + +/** + getClassName() + + Returns the class name for the object. + + @ret The class name. +*/ +extern String Object.getClassName(); + +/** + getId() + +*/ +extern String Object.getId(); + +/** + onNotify() + + @ret + @param command + @param param + @param a + @param b +*/ +extern Int Object.onNotify(String command, String param, int a, int b); + +//***************************************************************************** +// System CLASS +//***************************************************************************** +/** + System Class. + + @short The system class are basic system functions accessible to all. + @author Nullsoft Inc. + @ver 1.0 +*/ + +/** + onScriptLoaded() + + Hookable. Event happens when script has just finished being loaded. + No params. +*/ +extern System.onScriptLoaded(); + +/** + onScriptUnloading() + + Hookable. Event happens when script is going to be unloaded. + No params. +*/ +extern System.onScriptUnloading(); + +/** + onQuit() + + Hookable. Event happens when the user quits the application. + No params. +*/ +extern System.onQuit(); + +/** + onSetXuiParam(String param, String value) + + Hookable. Event happens when the script is in a group implementing + an xuiobject and a parameter has not been recognized by the group or + the embedded object. + + No params. +*/ +extern System.onSetXuiParam(String param, String value); + +/** + onKeyDown() + + Hookable. Event happens when the user presses a key on the keyboard. + + @param key The key that was pressed. +*/ +extern System.onKeyDown(String key); + +/** + onAccelerator() + + Hookable. Event happens when the user presses an accelerator key. + + @param action The action to perform (from locales) + @param section The locales section for the accelerator. + @param key The key, ie: "tab", "ctrl+a". +*/ +extern System.onAccelerator(String action, String section, String key); + +/** + onCreateLayout() + + Hookable. Event happens when a layout is created. + + @param _layout The layout that was just created. +*/ +extern System.onCreateLayout(Layout _layout); + +/** + onShowLayout() + + Hookable. Event happens when a layout is about to be shown. + This even only happens if the layout was previously hidden. + + @param _layout The layout that's about to be shown. +*/ +extern System.onShowLayout(Layout _layout); + +/** + onHideLayout() + + Hookable. + + @param _layout The layout that's about to be hidden. +*/ +extern System.onHideLayout(Layout _layout); + +/** + onStop() + + Hookable. Event happens when Winamp3 stops playing a file. + No params. +*/ +extern System.onStop(); + +/** + onPlay() + + Hookable. Event happens when Winamp3 starts playing a file. + No params. +*/ +extern System.onPlay(); + +/** + onPause() + + Hookable. Event happens when Winamp3 pauses playback. + No params. +*/ +extern System.onPause(); + +/** + onResume() + + Hookable. Event happens when Winamp3 resumes playback. + Event only happens when the song was previously set in a paused state. + No params. +*/ +extern System.onResume(); + +/** + onTitleChange() + + Hookable. Event happens when the song title changes. +*/ +extern System.onTitleChange(String newtitle); + +extern System.onTitle2Change(String newtitle2); +extern System.onInfoChange(String info); +extern System.onStatusMsg(String msg); + +/** + onEqBandChanged() + + Hookable. Event happens when an equalizer band changes values. + The bands are numbered from 0 to 9 (0 being 60Hz and 9 being 16kHz) + and their values range from -127 to +127. + + @param band The frequency band that has changed. + @param newvalue The new value of the frequency band. +*/ +extern System.onEqBandChanged(int band, int newvalue); + +/** + onEqPreampChanged() + + Hookable. Event happens when the equalizer pre-amp has changed + values. Range of the value is from -127 to +127. + + @param newvalue The new pre-amp value. +*/ +extern System.onEqPreampChanged(int newvalue); + +/** + onEqChanged() + + Hookable. Event happens when the EQ is switched on or off. + 0 means the EQ was turned off. 1 means it was turned on. + You might want to use true and false to verify this, it's a bit + more elegant. :) + + @param newstatus The new status of the EQ. +*/ +extern System.onEqChanged(int newstatus); + +/** + onVolumeChanged() + + Hookable. Event happens when the volume was changed. + The range of the volume is from 0 to 255. + + @param newvol The new volume value. +*/ +extern System.onVolumeChanged(int newvol); + +/** + onSeek() + + Hookable. Event happens when the user seeks + to a position in the track. + + @param newpos The seekers new position. +*/ +extern System.onSeek(int newpos); + +/** + getContainer() + + @ret The requested container. + @param container_id The containers identifier string. +*/ +extern Container System.getContainer(String container_id); + +/** + newDynamicContainer() + + @ret The new container. + @param container_id The identifier for the container you want to create. +*/ +extern Container System.newDynamicContainer(String container_id); + +/** + newGroup() + + @ret The new group. + @param group_id The identifier for the group you want to create. +*/ +extern Group System.newGroup(String group_id); + +extern Layout System.newGroupAsLayout(String group_id); + +/** + getNumContainers() + + Get the number of containers currently created. + + @ret The number of containers. +*/ +extern Int System.getNumContainers(); + +/** + enumContainer() + + Returns the name of the container associated with it's number. + Use getNumContainers() to fetch the number of containers present. + The containers are numbered from 0 to the value returned by getNumContainers(). + + @ret The name of the specified container. + @param num The container's number for which you want to know the name. +*/ +extern Container System.enumContainer(Int num); + +/** + getWac() + + Gets the reference to the wac identified by the guid sent. + + @ret The requested WAC. + @param wac_guid The WAC's GUID. +*/ +extern Wac System.getWac(String wac_guid); + +/** + messageBox() + + Creates a message box. + The flag paramater lets you set the style of the message box. + Just use the OR bitwise operator to set the style you want. + Here's a list of the flags you can use: + + MSGBOX_OK Adds an OK button. (1) + MSGBOX_CANCEL Adds a CANCEL button. (2) + MSGBOX_YES Adds a YES button. (4) + MSGBOX_NO Adds a NO button. (8) + MSGBOX_ALL Adds ALL buttons. (16) + MSGBOX_NEXT Adds a NEXT button. (32) + MSGBOX_PREVIOUS Adds a PREVIOUS button. (64) + + Note that the notanymore_id parameter stores the users answer in the + configuration file with the entry name specified by it's value. + + @ret The value of the button that was pressed (example: if OK is pressed, 1 is returned). + @param message The message you want to display. + @param msgtitle The title of the message box. + @param flag The message box style you want. + @param notanymore_id Configuration item name in which to store the users answer. +*/ +extern Int System.messageBox(String message, String msgtitle, Int flag, String notanymore_id); + +/** + getPlayItemString() + + @ret The name of what is playing. +*/ +extern String System.getPlayItemString(); + +/** + getPlayItemLength() + + Get the length of the track currently playing, in milliseconds. + + @ret Length of the track, in seconds. +*/ +extern Int System.getPlayItemLength(); + +/** + getPlayItemMetaDataString() + + Get metadata for the track currently playing. The metadata field names that + are available are the following: + + **ADD LIST** + + @ret The requested metadata. + @param metadataname The name of the metadata field you want to read. +*/ +extern String System.getPlayItemMetaDataString(String metadataname); + +/** + playFile() + + Play the requested file. Path and filename are required + with proper extension (example: playFile("c:\music\mp3\file.mp3"); ). + It also works with URL's (example: playFile("http://myshoutcast.com:8000"); ). + + @param playitem The path and filename to play. +*/ +extern System.playFile(String playitem); + +/** + getLeftVuMeter() + + Get the value of the left vu meter. + Range is from 0 to 255. Linear. + + @ret The value of the left vu meter. +*/ +extern Int System.getLeftVuMeter(); + +/** + getRightVuMeter() + + Get the value of the right vu meter. + Range is from 0 to 255. Linear. + + @ret The value of the left vu meter. +*/ +extern Int System.getRightVuMeter(); + +/** + getVolume() + + Get the current volume. Range is from 0 to 255. + + @ret The current volume. +*/ +extern Int System.getVolume(); + +/** + setVolume() + + Set the volume to the desired value. + Range is from 0 to 255. + + @param vol The desired volume value. +*/ +extern System.setVolume(Int vol); + +/** + play() + + Trigger the play event. +*/ +extern System.play(); + +/** + stop() + + Trigger the stop event. +*/ +extern System.stop(); + +/** + pause() + + Trigger the pause event. +*/ +extern System.pause(); + +/** + next() + + Trigger the next event. +*/ +extern System.next(); + +/** + previous() + + Trigger the previous event. +*/ +extern System.previous(); + +/** + eject() + + Trigger the eject event. +*/ +extern System.eject(); + +/** + seekTo() + + Seek to the desired position in the track. Range is from + 0 to SONG LENGTH (in milliseconds). +*/ +extern System.seekTo(Int pos); + +/** + getPosition() + + Get the current position in the track currently playing, + in milliseconds. + + @ret The current position in the track. +*/ +extern Int System.getPosition(); + +/** + setEqBand() + + Sets the requested equalizer band to the specified value. + The bands are numbered from 0 (60Hz) to 9 (16kHz) and + each range from -127 to +127. + + @param band The EQ band to set. + @param value The desired value for the specified band. +*/ +extern System.setEqBand(int band, Int value); + +/** + setEqPreamp() + + Set the equalizer pre-amp to the desired value. + Range is from -127 to +127 (0 means no preamp). + + @param value The desired value for the pre-amp. +*/ +extern System.setEqPreamp(Int value); + +/** + Set the equalizer to the desired state. On or off. + 0 is off, 1 is on. + + @param onoff The desired state for the eq. +*/ +extern System.setEq(Int onoff); + +/** + getEqBand() + + Get the value of an equalizer band. The bands + are numbered from 0 (60Hz) to 9 (16kHz). The return + value range is from -127 to +127. + + @ret The value of the band. + @param band The eq band number you want to get. +*/ +extern Int System.getEqBand(int band); + +/** + getEqPreamp() + + Get the equalizer preamp value. The value range is + from -127 to +127 (0 means no preamp). + + @ret The preamp's current value. +*/ +extern int System.getEqPreamp(); + +/** + getEq() + + Get the equalizer state. 0 for off, 1 for on. + Remember to compare return value to true and false. + + @ret The EQ's state. +*/ +extern int System.getEq(); + +/** + getMousePosX() + + This returns the X position of the mouse in the screen, + using the screen coordinate system. + + @ret The mouse's current X pos. +*/ +extern int System.getMousePosX(); + +/** + getMousePosY() + + This returns the Y position of the mouse in the screen, + using the screen coordinate system. + + @ret The mouse's current Y pos. +*/ +extern int System.getMousePosY(); + +/** + integerToString() + + Get the string representation of an integer. + + @ret The string equivalent of the integer. + @param value The integer to change into a string. +*/ +extern String System.integerToString(Int value); + +/** + StringToInteger() + + Get the integer representation of a string. + + @ret The integer equivalent of the string. + @param str The string to change into an integer. +*/ +extern Int System.StringToInteger(String str); + +/** + floatToString() + + Get the string representation of a floating point number. + + @ret The string representation of the float number. + @param value The float to convert. + @param ndigits Number of digits after the decimal point you want. +*/ +extern String System.floatToString(float value, int ndigits); + +/** + stringToFloat() + + Get the floating point representation of a string. + + @ret The float representation of the string. + @param str The string to convert. +*/ +extern Float System.stringToFloat(String str); + +/** + integerToLongTime() + + Convert a time in seconds to a HH:MM:SS value. + + @ret The string representation of the time (HH:MM:SS). + @param value Timestamp to use. +*/ +extern String System.integerToLongTime(Int value); + +/** + integerToTime() + + Convert a time in seconds to a MM:SS value. + + @ret The string representation of the time (MM:SS). + @param value Timestamp to use. +*/ +extern String System.integerToTime(Int value); + +/** + strmid() + + Get a substring from a string. + + @ret The substring. + @param str The string. + @param start The start position. + @param len The length of the string to extract, from start position. +*/ +extern String System.strmid(String str, Int start, Int len); + +/** + strleft() + + Get a substring from a string, starting from the left. + + @ret The substring. + @param str The string. + @param nchars The length of the string to extract, from the left. +*/ +extern String System.Strleft(string str, int nchars); + +/** + strright() + + Get a substring from a string, starting from the right. Since + the start point is the right of the string (or the end). It will + extract the string starting from the END going towards the BEGINNING. + + @ret The substring. + @param str The string. + @param nchars The length of the string to extract, from the right. +*/ +extern string System.strright(string str, int nchars); + +/** + strsearch() + + Search a string for any occurance of substring. If the substring was + found in the string, it will return the position of the substring in + the string searched. If the substring is not found, the return value + is -1. + + @ret Position at which the substring was found. + @param str The string to search in. + @param substr The substring to find. +*/ +extern int System.strsearch(string str, string substr); + +/** + strlen() + + Returns the length of the string. + + @ret The length of the string. + @param str The string. +*/ +extern int System.strlen(string str); + +/** + strupper() + + Convert a string to all uppercase. + + @ret The uppercase string. + @param str The string to uppercase. +*/ +extern string System.strupper(string str); + +/** + strlower() + + Convert a string to all lowercase. + + @ret The lowercase string. + @param str The string to lowercase. +*/ +extern string System.strlower(string str); + +/** + urlEncode() + + URL Encode a string. Characters that are NOT encoded + are: All letters, All digits, underscore (_), dash (-) and + period (.). + + @ret The URL encoded string. + @param url The string to URL encode. +*/ +extern string System.urlEncode(string url); + +/** + removePath() + + Remove the path from a fullpath. (example: + c:\music\mp3\test.mp3 -> test.mp3) + Also works on URL's. + + @ret The filename with the path removed. + @param str The fullpath of a file. +*/ +extern string System.removePath(string str); + +/** + getToken() + + Retreive a token from a list of tokens seperated by separator. + The index starts at 0, not 1, so be careful. + Here's a short example: + getToken("1,2,3,4,5", ",", 3); + Would return, 3. If the token you ask for doesn't exist, an + empty string is returned. + + @ret The token requested. + @param str The tokenenized string. + @param separator The separator to use. + @param tokennum The token to retreive. +*/ +extern string System.getToken(string str, string separator, int tokennum); + +/** + sin() + + Takes an angle in radians and returns the ratio of two sides of a right triangle. + The ratio is the length of the side opposite the angle divided by the length + of the hypotenuse. The result range is from -1 to 1. + + Converting from degrees to radians can be done by multiplying degrees by PI/180. + + @ret The sine value of the angle. + @param value The angle for which you want to know the sine value. +*/ +extern double System.sin(double value); + +/** + cos() + + Takes an angle in radians and returns the ratio of the two sides of a right triangle. + The ratio is the length of the side adjacent to the angle divided by the length of the + hypotenuse. The result is range is from -1 to 1. + + @ret The cosine value of the angle. + @param value The angle for which you want to know the cosine value. +*/ +extern double System.cos(double value); + +/** + tan() + + Takes an angle in radians and returns the ratio between two sides of a right triangle. + The ratio is sin(x) divided by cos(x). + + @ret The tangent value of the angle. + @param value The angle for which you want to know the tangent value. +*/ +extern double System.tan(double value); + +/** + asin() + + Takes a sine value ranging from -1 to 1 and returns the angle in radians. + The return value ranges from -PI/2 to +PI/2. + + @ret The angle in radians. + @param value The sine value for which you want to know the angle. +*/ +extern double System.asin(double value); + +/** + acos() + + Takes a cosine value ranging from -1 to 1 and returns the angle in radians. + The return value ranges from -PI/2 to +PI/2. + + @ret The angle in radians. + @param value The cosine value for which you want to know the angle. +*/ +extern double System.acos(double value); + +/** + atan() + + Takes an angle in radians and returns the ration between two sides of a right triangle. + The ratio is cos(x) divided by sin(x). + + @ret The arc tangent value of the angle. +*/ +extern double System.atan(double value); + +/** + atan2() + + @ret The arctangent of y/x. +*/ +extern double System.atan2(double y, double x); + + +/** + pow() + + Elevate a number to the N'th power. + + @ret The number + @param value The number you want to elevate to the N power. + @param pvalue The power to which you want to elevate the number. +*/ +extern double System.pow(double value, double pvalue); + +/** + sqr() + + Get the square of a number. + + @ret The number, squared. + @param value The number for which you want the square value. +*/ +extern double System.sqr(double value); + +/** + sqrt() + + Get the square root of a number. + + @ret The square root of the number. + @param value The number for which you want the square root value. +*/ +extern double System.sqrt(double value); + +/** + random() + + Get a randomely generated number. The random number will not + be bigger than the max value indicated. Smallest value is 0. + + @ret The random number. + @param max The maximum value of the random number to return. +*/ +extern int System.random(int max); + +/** + setPrivateString() + + Create a private config entry for your script, of String type. + + @param section The section for the entry. + @param item The item name for the entry. + @param value The value of the entry. +*/ +extern System.setPrivateString(string section, string item, string value); + +/** + setPrivateInt() + + Create a private config entry for your script, of Int type. + + @param section The section for the entry. + @param item The item name for the entry. + @param value The value of the entry. +*/ +extern System.setPrivateInt(string section, string item, int value); + +/** + getPrivateString() + + Read a private config entry of String type. Returns + the specified default value if the section and item isn't + found. + + @ret The value of the config entry. + @param section The section from which to read the entry. + @param item The name of the item to read. + @param defvalue The default value to return if no item is found. +*/ +extern String System.getPrivateString(String section, String item, String defvalue); + +/** + getPrivateInt() + + Read a private config entry of Integer type. Returns + the specified default value if the section and item isn't + found. + + @ret The value of the config entry. + @param section The section from which to read the entry. + @param item The name of the item to read. + @param defvalue The defautl value to return if no item is found. +*/ +extern Int System.getPrivateInt(String section, String item, Int defvalue); + +/** + setPublicString() + + Create a public config entry for your script, of String type. + + @param item The item name for the entry. + @param value The value of the entry. +*/ +extern System.setPublicString(String item, String value); + +/** + setPublicInt() + + Create a public config entry for your script, of Int type. + + @param item The item name of the entry. + @param value The value of the entry. +*/ +extern System.setPublicInt(String item, Int value); + +/** + getPublicString() + + Read a public config entry of String type. Returns + the specified default value if the item isn't found. + + @ret The value of the config entry. + @param item The item name to read. + @param defvalue The default value to return if no item is found. +*/ +extern String System.getPublicString(String item, String defvalue); + +/** + getPublicInt() + + Read a public config entry of Integer type. Returns + the specified default value if the item isn't found. + + @ret The value of the config entry. + @param item The item name to read. + @param defvalue The default value to return if no item is found. +*/ +extern Int System.getPublicInt(String item, Int defvalue); + +/** + getParam() + + Get the parameters with which the script is called. + This is the 'param="..."' attribute in the