Announcement

Collapse
No announcement yet.

Adding second clock to the normal window when using Bento

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

  • Adding second clock to the normal window when using Bento

    [In the wake of solution from this discussion: https://forums.winamp.com/forum/skin...de-using-bento]


    In order to see more than just one clock, for Window Shade Mode I can use
    PHP Code:
    display="timeremaining" 

    and
    PHP Code:
    display="timeelapsed" 

    for two separate entries of

    PHP Code:
    text id="SongTime" 

    in the

    C:\Program Files (x86)\Winamp\Skins\Bento\xml\player-shade.xml

    file. This allows me to see one timer with info about how much time is left till a song ends and second showing how much of it has passed



    But how to do similar make-over for normal mode of Bento? Do I tackle with the

    C:\Program Files (x86)\Winamp\Skins\Bento\xml\player-normal-group.xml

    file?


    And if yes - then is it at all possible to implement such a makeover:

    #1] move the default clock down where Spectrum Analyzer / Oscilloscope is

    #2] then add that second clock next to the first one

    #3] move the Spectrum Analyzer / Oscilloscope​ from its left edge position to center i.e. to where Beat Visualization is

    #4] move the Beat Visualization from centered position to the right edge

    #5] make the Spectrum Analyzer / Oscilloscope​ appear only if the window with it happens to be in a given moment Spectrum Analyzer / Oscilloscope wide enough to show it in its entirety

    #6] make Beat Visualization appear only if the window with it happens to be in a given moment wide enough to show it in its entirety and only if Spectrum Analyzer / Oscilloscope​ is already visible

    #7] extend the line with ATF to the left edge thus utilize the empty space left after moving default clock down [i.e. after executing point #1]

    ?


    I other words: is it possible to add a second clock while also moving both of them down, forcing Spectrum Analyzer / Oscilloscope​ and Beat Visualization to the right - and then covering the empty space in the left top corner with scrolling tags' data?
    ​​

  • #2
    Here is, after adding also a third clock, visualization of what I would like to have:

    Click image for larger version

Name:	Winamp Bento clocks.jpg
Views:	213
Size:	86.4 KB
ID:	4617191
    Clocks from left to right are: total length, time elapsed, remaining time


    Is it possible to do such changes?

    Comment


    • #3
      If you are lucky then it is enough to edit player-normal-group.xml. But Bento is a heavily scripted skin and some scripts may interfere with your changes. I haven't checked. Try it and see what happens.

      Also bare in mind, what you intend to do is more than customization: it would be more like a derivative work. So if I were you, I would make a copy of (Big) Bento's directory, rename it to something like myBB, and experiment with myBB rather than (Big) Bento.
      Last edited by ariszlo; 28 May 2023, 19:40.
      Ariszló @ WinCustomize & DeviantArt

      Comment


      • #4
        Originally Posted by Wineroz View Post
        Is it possible to do such changes?
        Yes it is possible. (theoretically)

        The first timer would be just a text field showing track's length. You would need the following command: System.getPlayItemMetaDataString(String metadataname) and the metadata name would be "length".

        For the second one you would need a script file called oldtimer.m made by Plague decades ago- in which you would set the second timer to "timer_remaining".

        The third timer would be your default timer - so no need to touch/change it.

        But as ariszlo said, Bento is a "sensitive" skin regarding the coding within the script files. You make a change in one file and will not stop wondering while three others stopped working (which is actually always the case while manipulating other people's files). A lot of caution is adviced and if you have never done this before I would not recommend it.


        Edit: In my skin you can click on the timer and this changes the value from "timer_elapsed" to "timer_remaining" and vice versa. In case it works the same on Bento, all you need are:
        • text field showing the track's length
        • timer 1 showing the elapsed time
        • timer 2 showing the remaining time - after clicking on it
        Find out, in which file the timer is, copy and paste it, so you have the second one behind the first one. Change the id of the second one to something like "timer2". Change the x="" value of the second one. Start Winamp and click on timer 1 and 2 and see whether timer1 has value "timer_elapsed" and the other "timer_remaining". And if this works I will show you how to add the text field.

        I just added a second timer to my skin and it works:


        Click image for larger version

Name:	image.png
Views:	201
Size:	184.0 KB
ID:	4617222​​
        Quinto Black CT

        Comment


        • #5
          Originally Posted by PeterK. View Post
          Yes it is possible. (theoretically)​​
          It can be done simpler, see the display strings in the grey box under <text/> & <Wasabi:Text/> in the XML GUI Objects wiki.
          PHP Code:
          <text id="song length" display="songlength" [...] />
          <
          text id="time remaining" display="timeremaining" [...] />
          <
          text id="time elapsed" display="timeelapsed" [...] /> 

          However, there is a problem with this in Bento: songticker.maki sets the left edge of the songticker to the right edge of the text object with the id "SongTime". So the id of your last clock should be "SongTime" instead of "time elapsed":

          PHP Code:
          <text id="song length" display="songlength" [...] />
          <
          text id="time remaining" display="timeremaining" [...] />
          <
          text id="SongTime" display="timeelapsed" [...] /> 

          Your modifications may still break Bento, so to go safe, do your experiments in the myBB folder.
          Ariszló @ WinCustomize & DeviantArt

          Comment


          • #6
            Post deleted.

            Quinto Black CT

            Comment


            • #7
              I was wrong about using the "SongTime" id for the last clock but otherwise this seems to work with the right x and w values and songticker param:
              PHP Code:
              <text id="SongTime"
              x="7" y="8" h="31" w="85"
              font="player.bitmapfont.nums" timecolonwidth="6"
              display="songlength" align="right" alpha="220"
              />

              <
              text id="time remaining"
              x="92" y="8" h="31" w="102"
              font="player.bitmapfont.nums" timecolonwidth="6"
              display="timeremaining" align="right" alpha="220"
              />

              <
              text id="time elapsed"
              x="194" y="8" h="31" w="85"
              font="player.bitmapfont.nums" timecolonwidth="6"
              display="timeelapsed" align="right" alpha="220"
              />

              <
              script file="scripts/songticker.maki" param="187,big"/> 
              Ariszló @ WinCustomize & DeviantArt

              Comment


              • #8
                Hi ariszlo,

                I added your php code from above to the 'player-normal-group.xml' file for the Bento and Big Bento skins and it works very well. How can I make the font smaller, like half it's current size?

                Also, there is 1 thing that I've been wondering about forever. The sum of the 'timeremaining' and 'timeelapsed' is 1 second less than the 'songlength'. Is there anyway to correct this? Like adding a second to the 'timeremaining' or 'timeelapsed' value.
                Last edited by Aminifu; 31 May 2023, 02:34.
                Winamp v5.9.2.10042 - Quinto Black CT v3.8 skin
                Windows 11 Home 64-bit v22H2 desktop - Logitech Z906 5.1 speaker system

                Comment


                • #9
                  Originally Posted by Aminifu View Post
                  How can I make the font smaller, like half it's current size?
                  It is a bitmap font whose id is hard-coded in visualizer.maki. So one option is to rewrite visualizer.maki and edit some xml files. The other is to resize the image for the bitmap font and edit some xml tags in player-elements.xml.

                  Let's say you want to change the character height from 31 pixels to 16 pixels and the character width from 15 pixels to 8 pixels. The size of the original numfont.png is 240x184. This is how you do the maths for the resized image:

                  new width = (8/15)×240 = 128 pixels
                  new height = (16/31)×184 ≈ 95 pixels

                  Save the resized numfont.png as numfont-smaller.png.

                  Now this is how you modify the relevant xml tags in player-elements.xml:
                  PHP Code:
                  <bitmap id="player.bitmapfont.nums.source" file="window/numfont-smaller.png" x="0" y="0" h="48" w="128" gammagroup="DisplayText"/>

                  <
                  bitmapfont id="player.bitmapfont.nums" file="player.bitmapfont.nums.source" charwidth="8" charheight="16" hspacing="0" vspacing="-2"/>

                  <
                  bitmap id="player.bitmapfont.nums.noreflect.source" file="window/numfont-smaller.png" x="0" y="48" h="48" w="128" gammagroup="DisplayText"/>

                  <
                  bitmapfont id="player.bitmapfont.nums.noreflect" file="player.bitmapfont.nums.noreflect.source" charwidth="8" charheight="16" hspacing="0" vspacing="-2"/> 

                  And this is how you replace the original SongTime tag with the following three tags in player-normal-group.xml:

                  Deleted what I wrote here. Jump to my next post. The solution offered there is much better.

                  By adding two more timers, you increase the distance between the left edge of the Bento window and the song ticker. So it is advisable to change the x and w values of the song ticker and the info ticker, too:
                  PHP Code:
                  <SongTicker id="Songticker"
                    
                  x="94" y="6" h="20" w="-96" relatw="1"
                    
                  showlen="1" rightpadding="-3"
                    
                  rightclickaction="trackmenu" dblclickaction="trackinfo" align="right"
                    
                  color="color.display" size="13" valign="top" antialias="0"
                  />

                  <
                  Text id="InfoDisplay"
                    
                  x="94" y="6" h="20" w="-96" relatw="1" alpha="0"
                    
                  display="SONGTITLE" showlen="1" offsetx="-3" align="right"
                    
                  color="color.display" size="13" valign="top" antialias="0" ghost="1"
                  />​ 

                  Also the param of the xml tag calling songticker.maki:
                  PHP Code:
                  <script file="scripts/songticker.maki" param="16,big"/> 

                  Originally Posted by Aminifu View Post
                  Also, there is 1 thing that I've been wondering about forever. The sum of the 'timeremaining' and 'timeelapsed' is 1 second less than the 'songlength'. Is there anyway to correct this? Like adding a second to the 'timeremaining' or 'timeelapsed' value.
                  It is how Winamp converts milliseconds to MM:SS. It rounds all decimals down.
                  Last edited by ariszlo; 31 May 2023, 17:12.
                  Ariszló @ WinCustomize & DeviantArt

                  Comment


                  • #10
                    This is better than what I suggested in my previous post. No need for 3 different timer tags for song length, elapsed time and remaining time. It is enough to modify the height and width of the SongTime tag and let songtime.maki do the rest:

                    PHP Code:
                    <text id="SongTime"
                      
                    x="7" y="8" h="16" w="136"
                      
                    font="player.bitmapfont.nums" timecolonwidth="6"
                      
                    align="left" alpha="220"
                    />

                    <
                    script file="scripts/songtime.maki"/> 

                    The attached zip contains numfont-smaller.png and songtime.m. This forum does not seem to allow uploading maki binaries, so you will need to compile the maki yourself.

                    Originally Posted by Aminifu View Post
                    Also, there is 1 thing that I've been wondering about forever. The sum of the 'timeremaining' and 'timeelapsed' is 1 second less than the 'songlength'.
                    Songtime.maki fixes that.

                    Attached Files
                    Last edited by ariszlo; 3 June 2023, 17:16. Reason: updated songtime.m for streams
                    Ariszló @ WinCustomize & DeviantArt

                    Comment


                    • #11
                      Hi ariszlo,

                      Thanx a lot for looking further into this. I am having an issue, please see my reply to your post on the WACUP forum.
                      Winamp v5.9.2.10042 - Quinto Black CT v3.8 skin
                      Windows 11 Home 64-bit v22H2 desktop - Logitech Z906 5.1 speaker system

                      Comment


                      • #12
                        My issue is resolved. Thank you for helping me understand more about how scripts work with Winamp.
                        Winamp v5.9.2.10042 - Quinto Black CT v3.8 skin
                        Windows 11 Home 64-bit v22H2 desktop - Logitech Z906 5.1 speaker system

                        Comment


                        • #13
                          But what am I suppose to do to achieve this https://forums.winamp.com/forum/skin...190#post461719​?


                          I should add this
                          PHP Code:
                          <text id="SongTime"
                          x="7" y="8" h="31" w="85"
                          font="player.bitmapfont.nums" timecolonwidth="6"
                          display="songlength" align="right" alpha="220"
                          />

                          <
                          text id="time remaining"
                          x="92" y="8" h="31" w="102"
                          font="player.bitmapfont.nums" timecolonwidth="6"
                          display="timeremaining" align="right" alpha="220"
                          />

                          <
                          text id="time elapsed"
                          x="194" y="8" h="31" w="85"
                          font="player.bitmapfont.nums" timecolonwidth="6"
                          display="timeelapsed" align="right" alpha="220"
                          />

                          <
                          script file="scripts/songticker.maki" param="187,big"/> 

                          to file

                          C:\Program Files (x86)\Winamp\Skins\Bento\xml\player-normal-group.xml


                          And then compile a songticker.MAKI file? But from what code?


                          And is this a typo
                          PHP Code:
                          scripts/songtime.maki 

                          because correctly it should be
                          PHP Code:
                          scripts\songtime.maki 

                          ?


                          ​​

                          Comment


                          • #14
                            Originally Posted by Wineroz View Post
                            And then compile a songticker.MAKI file? But from what code?​​
                            Forget that. Use this instead.

                            Originally Posted by Wineroz View Post
                            And is this a typo
                            scripts/songtime.maki
                            No, it isn't. This is WasabiXML, not the Windows shell. Just read some of the XML files of Winamp Modern or Big Bento.
                            Last edited by ariszlo; 18 September 2023, 16:43. Reason: fixed a typo.
                            Ariszló @ WinCustomize & DeviantArt

                            Comment


                            • #15
                              Originally Posted by ariszlo View Post
                              Forget that. Use this instead.[...]
                              You mean I should insert this

                              Originally Posted by ariszlo View Post
                              [...]
                              PHP Code:
                              &lt;text id="SongTime"
                              x="7" y="8" h="16" w="136"
                              font="player.bitmapfont.nums" timecolonwidth="6"
                              align="left" alpha="220"
                              /&gt;

                              &
                              lt;script file="scripts/songtime.maki"/&gt
                              [...
                              into my

                              C:\Program Files (x86)\Winamp\Skins\Bento\xml\player-elements.xml

                              and then add to folder

                              C:\Program Files (x86)\Winamp\Skins\Bento\scripts

                              files songtime.m and songtime.maki from that attatched archive ?


                              If yes then it changes nothing - except for the script failure that appears when I open Winamp​​

                              Comment

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