Announcement

Collapse
No announcement yet.

Customvis

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Customvis

    Heyho!

    I want to create some custom visualisations like in MMD3. I also want to switch through them when klicked.

    What I have by now is the standard visualisation window and a seperate button, that opens the equalizer and shows the visualisation.

    How is this done? My idea was creating AnimatedLayers and something like a invisible button over the area for switching...

    If yes, how could I manage, that not all AnimatedLayers get loaded, but only the next pre-loaded. I think, that way, the system would not slow down too much...

    Right?

  • #2
    just use only one timer for all your anims. when the vis button is clicked, let setxmlparam(); change your anims image. also make sure the scripts checks the anims length again when a vis is changed. Hope you know what i mean

    -UUL

    Comment


    • #3
      ???

      I think, I know what you mean. But I also think, I have no idea, how that is implemented...

      I had a look into customvis by iPlayTheSpoons, and maybe I could modify it. But how will that setxmlparam();-thing work?

      Comment


      • #4
        A look at the std.mi can explain a lot

        like this:

        youranim.setXmlParam("image", "new_image");

        Comment


        • #5
          A look at the std.mi can explain a lot
          Yes, maybe for a coder... ;-)

          K, now let my code around for a while and post my efforts tomorrow.

          Comment


          • #6
            Guess what? I got it working!

            Now, it switches from the first to the second.

            And if I want to switch back or through more visuals? Does that work via a variable and if-else and myanim.getXmlParam("name");?

            BTW is it ok, when winamp has about 40% CPU-usage???

            Comment


            • #7
              Originally posted by i b o
              Guess what? I got it working!

              Now, it switches from the first to the second.


              Originally posted by i b o
              And if I want to switch back or through more visuals? Does that work via a variable and if-else and myanim.getXmlParam("name");?
              yup, you need the if thinge for that. and also make an integer to set your vis to

              sumthing like:

              code:
              button.onleftbuttonup(){
              if (visstate == 1) {
              myanim.setXmlParam("name2");
              visstate = 2;
              } else {
              myanim.setXmlParam("name1");
              visstate = 1;
              }

              Originally posted by i b o
              BTW is it ok, when winamp has about 40% CPU-usage???
              mine mostly is about 2%, but sumtimes it's higher, just depends on wich skin i use

              Comment


              • #8
                hey, i have the same problem. first of all, i used pre-made customvis.maki and it's working fine. i also want to add a button for toggling it on and off but i have some problems. first, i couldn't get used to command hierarchy of maki scripts and don't know what and where to add. second one, i think bigger, my mc.exe is not working. it was once, but not now. i'm not talking about error messages in ms-dos shell. the problem is when it begins preprocessing, a windows error message appears "this program has performed ... task. it will be shut down" how can i get rid of this problem? i have 2 copies of mc.exe and neither works fine.

                Comment


                • #9
                  Don'n know, if this is the ideal code, but it works.

                  This is an extension of the customvis.m of iPlayTheSpoons. Do I have to tell him, when I post his script in the forum?

                  PHP Code:
                  //-----------------------------------------------------------------------------
                  // customvis.m
                  //
                  // Creates two Custom Visualizations from Animated Layers and switches
                  // between them
                  // To Use this script:
                  //
                  // 1) Put the customvis.maki file in your scripts folder
                  // 2) Put <script id="customvis" file="scripts/customvis.maki"/> in the same group
                  //       as your animated layer
                  // 3) Done!
                  //
                  // by iPlayTheSpoons
                  //
                  //-----------------------------------------------------------------------------

                  #include "../../std.mi"

                  Function UpdateVis(Int Frame);

                  Global 
                  AnimatedLayer MainVis;
                  Global 
                  Button Changer;
                  Global 
                  Timer VisTimer;
                  Global 
                  Double LevelOneFrame;
                  Global 
                  Int LastFrameAnimNr;

                  System.onScriptLoaded() { 
                      
                  Group VisGroup getScriptGroup();
                      
                  MainVis VisGroup.getObject("MyVis");
                      
                  Changer getContainer("main").getLayout("normal").getObject("ChangeVis");
                      
                  VisTimer = new Timer;
                      
                  VisTimer.setDelay(50);
                      
                  VisTimer.start();
                      
                  MainVis.setSpeed(50);
                      
                  OneFrame 255/(MainVis.getLength());
                      
                  AnimNr 1;
                  }
                      
                  System.onScriptUnloading() {
                      
                  VisTimer.stop();
                      
                  delete VisTimer;
                  }


                  VisTimer.onTimer() {
                      
                  Level = ((System.getLeftVuMeter() + System.getRightVuMeter())/2);
                      
                  UpdateVis(Level/OneFrame);
                  }

                  UpdateVis(Int Frame){
                      
                  MainVis.setStartFrame(LastFrame);
                           
                  MainVis.setEndFrame(Frame);
                           
                  MainVis.play();
                           
                  LastFrame Frame;
                  }

                  Changer.onLeftButtonUp(int xint y) {
                      if (
                  AnimNr == 1) {    
                          
                  MainVis.setXmlParam("image""myvis2");
                          
                  AnimNr 2;
                      } else if (
                  AnimNr == ){
                          
                  MainVis.setXmlParam("image""myvis1");
                          
                  AnimNr 1;
                      }

                  Comment


                  • #10
                    also add this
                    code:
                    OneFrame = 255/(MainVis.getLength());
                    to your onleftbuttonup (if your different visualisation aren't the same lenght)

                    -UUL

                    Comment


                    • #11
                      THX!!!

                      don't know, if they are now, but this gives more freedom at vis-creating

                      Comment


                      • #12
                        any help for me?

                        Comment


                        • #13
                          Maybe you should have a look at this thread.

                          Need help in drawing and cutting and pasting them thar purty pictures into a Winamp Skin? A read-only forum with answers to the most commonly asked newbie skinning questions pulled from other forums.

                          Comment


                          • #14
                            i b o, i could manage to compile the maki file, but i couldn't figure out how xml code should be. can you post yours?

                            Comment


                            • #15
                              This is the part for my customvis. Does it help?

                              What does your code look like? Maybe showing it would help.


                              PHP Code:
                              <AnimatedLayer
                              id
                              ="MyVis"
                              x="6" y="226"
                              w="176" h="78"
                              image="myvis1"
                              autoplay="1" autoreplay="1"
                              speed="100"
                              alpha="128"
                              />
                              <
                              script id="customvis" file="scripts/customvis.maki"/>
                              <
                              button id="ChangeVis" x="6" y="226" w="176" h="78" image="player.eq_bg" tooltip="Change Visualisation" alpha="0"/> 

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎