Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Howto: Some little tips with your Beep-Media-Player.

  1. #1
    Join Date
    Jul 2005
    Location
    Italy
    Beans
    6

    Howto: Some little tips with your Beep-Media-Player.

    This howto shows some application of the plugin bmp-songchange, a port of the old xmms songchange plugin.

    Lets go.
    Open a terminal session and enter:
    Code:
    wget http://joeyrs.altervista.org/bmp-songchange_0.0.1-2_i386.deb
    sudo dpkg -i bmp-songchange_0.0.1-2_i386.deb
    (I've made that package because there is no an official version. That one works fine in Ubuntu and Debian.)
    Now the Beep-Media-Player Songchange plugin is installed on our ubuntu, lets configure it.
    - Run beep-media-player and select Preferences -> Plugins -> General
    - Click in "Song Change 0.0.1" CheckBox (Activate it)
    - Click Preferences.

    In Song change Command Box type:
    Code:
     echo "Current Song: %s" >~/.bmp/songchange.dat
    (This outputs the title of your current song in a file.)

    In Playlist end Command Box type:
    Code:
    echo "" >~/.bmp/songchange.dat
    (This clear the file if the playlist ends.)

    You can optionally include these strings:
    %F frequency (in hertz)
    %c number of channels
    %f filename (full path)
    %l length (in milliseconds)
    %n name
    %r rate (in bits per second)
    %s name (an alias for %n)
    %t playlist position (%02d)

    From now you'll have the title of the current song in a file (~/.bmp/songchange.dat); how we can use it?

    XChat:
    Want to print in a channel the title of your current song? It's very simple, just type in your current xchat window:
    Code:
      /exec -o cat ~/.bmp/songchange.dat
    You can simplify that command in two modes:
    - Adding a button in the userlist panel:
    Type in your current xchat window:
    Code:
     /addbutton SongChange exec -o cat ~/.bmp/songchange.dat
    - Making an alias:
    Select Menu -> Settings -> Advanced -> Replace Menu
    Add a new alias typing in name box: song and in command box:
    Code:
    exec -o cat ~/.bmp/songchange.dat
    Click on Save Button.
    Now you can show your song typing: /song

    XOSD:
    XOSD is a simple library to display shaped text on your X display, like a TV on-screen display. You can use it for displaying the title of the current song. Install it by typing: apt-get install xosd-bin or using synaptic.
    After the install we can display the song title by using osd_cat command.
    Using XOSD (Example):
    Code:
    osd_cat -f"-adobe-helvetica-bold-*-*-*-20-*-*-*-*-*-*-*" -s1 -pbottom -o-40 -cgreen -d5 ~/.bmp/songchange.dat
    Making automatic the OSD SongChange:
    Let's return to Beep-Media-Player Preferences and modify:
    Code:
    echo "Current Song: %s" >~/.bmp/songchange.dat
    to:

    Code:
    echo "Current Song: %s" >~/.bmp/songchange.dat && osd_cat -f"-adobe-helvetica-bold-*-*-*-20-*-*-*-*-*-*-*" -d5 ~/.bmp/songchange.dat
    From now osd_cat displays your current song title every time the song changes,
    you can refer at http://ldots.org/xosd-guide/index.html for personalizing your OSD Title.
    Here is an example of OSD SongChange: http://img69.imageshack.us/img69/4619/xosd7sl.png

    You can use both of these tips together.
    That's all. Hope this are useful, any comment would be appreciated.
    Last edited by JoeyrS; July 18th, 2005 at 06:36 PM.

  2. #2
    Join Date
    Feb 2005
    Location
    Italy
    Beans
    34
    Distro
    Dapper Drake Testing/

    Re: Howto: Some little tips with your Beep-Media-Player.

    nice trick.. thanks!

  3. #3
    Join Date
    Feb 2005
    Location
    Geneva, Switzerland
    Beans
    976

    Re: Howto: Some little tips with your Beep-Media-Player.

    Thank you for this good tip !

  4. #4
    Join Date
    Jul 2005
    Location
    Italy
    Beans
    6

    Re: Howto: Some little tips with your Beep-Media-Player.

    Another Tip:
    Want to show the lenght of your current song in minutes and seconds?
    I wrote down this simple bash script, it converts from millisec to Minutes:Seconds

    Code:
    #!/bin/bash
    if [ $# -eq 1 ] ; then
      Lenght="$(echo "scale=2; ($1/1000)/60" | bc)"
      Point=`expr index "$Lenght" .`
      Minutes=`expr substr $Lenght 1 $(( $Point - 1 ))`
      Seconds="$(echo "scale=2; (${Lenght:2}/100)*60" | bc)"
      Point=`expr index "$Seconds" .`
      Seconds=`expr substr $Seconds 1 $(( $Point - 1 ))`
      if [ ${#Minutes} = 1 ] ; then Minutes=0$Minutes ; fi
      if [ ${#Seconds} = 1 ] ; then Seconds=0$Seconds ; fi
      echo $Minutes:$Seconds
    fi
    Copy and paste in a new file (for ex. "converter") , save and make it executable by typing: chmod +x converter.

    Than back to beep-media-player's preferences and add to echo: $(/path/to/your/file/converter %l)

    The script read the lenght in milliseconds and outputs in [mm:ss]

    The final command are like this: (with XOSD)
    Code:
    echo "* Now Listening: « %s» [$(/home/joeyrs/converter %l)]" >~/.bmp/songchange.txt && osd_cat -f"-adobe-helvetica-bold-*-*-*-20-*-*-*-*-*-*-*" -s1 -pbottom -o-40 -cgreen -d5 .bmp/songchange.dat
    Hope this are helpful

  5. #5

    Re: Howto: Some little tips with your Beep-Media-Player.

    This is a pretty cool tip. However, a few questions:

    -my OSD shows at the top left, where there's a lot of stuff already - how can I change that?
    -how can I change the font size?
    -how can I change the font color from red?
    -how can I enable the drop shadow?

    Thanks!

  6. #6
    Join Date
    Jul 2005
    Location
    Italy
    Beans
    6

    Re: Howto: Some little tips with your Beep-Media-Player.

    Quote Originally Posted by maruchan
    This is a pretty cool tip. However, a few questions:

    -my OSD shows at the top left, where there's a lot of stuff already - how can I change that?
    -how can I change the font size?
    -how can I change the font color from red?
    -how can I enable the drop shadow?

    Thanks!
    For the position you can use these opt on osd_cat:
    -A <left/right/center>
    -p <top/middle/bottom>
    -o (This is the offset, use with positive or negative integers)

    Changing Font Size:
    You have two ways for changing the font size:
    1) Using a tool like gtkfontsel (sudo apt-get install gtkfontsel) and choosing your own font type and size;

    2) In my example
    Code:
     osd_cat -f"-adobe-helvetica-bold-*-*-*-20-*-*-*-*-*-*-*"
    You have to change only the number "20". (Check if the size you're choosing is avaible for the current font, else you will get an error from osd_cat like: "ABORT: Requested font not found").

    Changing the font color:
    Changing the font color is very simple, you can use the option:

    -c <color>

    The default color is red but you can choose your favourite color (white, cyan, blue, green and much more).

    Enabling shadow offset
    Simply using:

    -s <offset>

    Ex. osd_cat -s 2 and it will give you the shadow effect.

    All opts in one string:
    Code:
    osd_cat -A center -p bottom -o -40 -f"-adobe-helvetica-bold-*-*-*-20-*-*-*-*-*-*-*" -c green -s 2
    Quote Originally Posted by maruchan
    Thanks!
    You're welcome

  7. #7

    Re: Howto: Some little tips with your Beep-Media-Player.

    Awesome. Thanks for the help.

  8. #8
    Join Date
    Jun 2005
    Location
    Houston, Texas
    Beans
    304

    Re: Howto: Some little tips with your Beep-Media-Player.

    Sounds pretty cool, can somebody please post a screenshot of this OSD?

  9. #9
    Join Date
    Jul 2005
    Location
    Italy
    Beans
    6

    Re: Howto: Some little tips with your Beep-Media-Player.

    HERE There is an example of XOSD + SoundChange Plugin.

    (Look at the bottom left of the image).

  10. #10
    Join Date
    Jun 2005
    Location
    Roma
    Beans
    86

    Re: Howto: Some little tips with your Beep-Media-Player.

    Very good job JoeyrS!
    "se sarà così, bene; se fosse stato così, sarebbe stato bene; ma poiché non è così, non lo è. Questa è la logica" (Alice nel paese delle meraviglie)
    http://feanor83.altervista.org

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •