Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Foo_osd (Read 100034 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Foo_osd

Reply #150
Working properly in all fullscreen applications would require hooking into those applications and inserting something into their rendering process. Not exactly something easy to do, and prone to being picked up by anti-cheating software.

Foo_osd

Reply #151
I can't see the text when I'm within a graphical fullscreen application, e.g. a game. For example, I tried Borderlands 2 and League of Legends and it's not shown. Both applications ran in fullscreen

For "Playback/Pause" I have assigned a global hotkey in foobar2000, in the foo_osd settings I have ticked "Overlay" and Automatically pop-up on: "Play" and "Pause".

When I start a video in full screen mode with the VLC Media Player Portable (Video Settings: "Accelerated video output (Overlay)" and "Always on top" = active) while foobar2000 is playing, the fullscreen-watched video hides the foo_osd text. Pressing fb2k's Playback/Pause-shortcut (twice) brings then the foo_osd text up in the foreground again. The same happens automatically when foobar starts playing the next track.

Maybe this works also when playing games.
This is HA. Not the Jerry Springer Show.

Foo_osd

Reply #152
Code: [Select]
$rgb(255,0,0,0,0,0)$if(%title%,%title%,%filename_ext%)$crlf()
[$rgb(255,0,0,0,0,0)%subtitle%$crlf()]
$rgb(255,0,0,0,0,0)$if(%artist%,%artist%,unknown artist)$crlf()
[$rgb(255,0,0,0,0,0)%album%]


I want to make the last three lines smaller and dimmer.


This never got a response, but I too would love a way to do this if at all possible.  Even if there were a way of using superscript or any other dirty trick to have text smaller on one line to others.

Foo_osd

Reply #153
At least the use of different colours is possible with foo_osd. Example code based on Razwerkz's original pattern:

Code: [Select]
$rgb(255,0,0)$if2(%title%,%filename_ext%)$rgb()$crlf()
[$rgb(227,0,0)%subtitle%$rgb()$crlf()]
$rgb(208,0,0)$if2(%artist%,unknown artist)$rgb()$crlf()
[$rgb(174,0,0)%album%$rgb()]



For the colour matching I created a new empty image with IrfanView, background colour = red. Then I reduced gradually the brightness via the menu Image > Color corrections. Clicking in the image and holding down the left mouse button shows the current RGB values in IrfanView's window title.
This is HA. Not the Jerry Springer Show.

Foo_osd

Reply #154


For the colour matching I created a new empty image with IrfanView, background colour = red. Then I reduced gradually the brightness via the menu Image > Color corrections. Clicking in the image and holding down the left mouse button shows the current RGB values in IrfanView's window title.

Thanks for the response, I considered darkening/Lightening the color, but it's useless unless you have a transparent background.  I have a transparent background so it doesn't interfere with what I'm working on.

The thing that interests me the most is the idea of changing the font size of different lines/words.  Is this just not possible?  For instance, the album name is not as important to me as the artist/title, so having it all in the same size is cluttered, but I don't like the idea of removing album info altogether.

Foo_osd

Reply #155
For instance, the album name is not as important to me as the artist/title, so having it all in the same size is cluttered, but I don't like the idea of removing album info altogether.


For myself, I found that adding some additional details made the separation between artist and album much more obvious. Here's what I'm using:



Foo_osd

Reply #156
For instance, the album name is not as important to me as the artist/title, so having it all in the same size is cluttered, but I don't like the idea of removing album info altogether.


For myself, I found that adding some additional details made the separation between artist and album much more obvious. Here's what I'm using:



Can I ask for the settings & font you used?  I like the style better than the default.  Thanks.

Foo_osd

Reply #157
Mine is not as beautiful, but better that the default one.
I used font Segoe UI light oblique with code (black text):
Code: [Select]
$rgb(0,0,0,0,0,0)[%artist% ]
$char(10)$rgb(0,0,0,0,0,0)$if(%title%, ♫[' '%album%' ']
$char(10)$rgb(0,0,0,0,0,0)%title%,%_filename%)[ '['%_time_elapsed%']']$if(%_ispaused%,'

[paused]')


Foo_osd

Reply #158
Regarding the fullscreen application issue (namely games) this works in some games and not in others. Borderless windowed will make it show up always, but some games it will just work over without it. It works fine over Intruder in fullscreen but not over BeamNG.drive in fullscreen.

Foo_osd

Reply #159
A few questions and a couple of features requests.

Does anybody has a titleformatting string to cleverly mock auto-wrapping
where long texts are broken only at spaces or at certain characters?
I made one but it breaks on length so it can cut words in a half.


I tried to use $put and $get to simplify the dealing with many colours
but I couldn't make it work:
Code: [Select]
$puts(pl,$rgb(255,255,60))
$get(pl)

Am I doing something wrong?


FR:
Is it possible to be able to set fix dimensions in pixels, cropping the text
if it exceeds the width. We can take care of wrapping (or mock it up).

Is it possible to have the window move a fixed (settable) number of pixels
in random directions every fixed (settable) number of seconds?
I'm trying to mock a screensaver behaviour without forcing you, the coder,
to have to deal with the screensavers issues I read about a few posts above.
I have this solid black background with the now playing info and
in this way I could set the "canvas" size bigger than the resolution of my monitor
(a sort of an overscan) but using a smaller area of my monitor resolution for the info.
In this way I can let the OSD move in each direction for a number of pixels
as the half of the difference from the canvas size and the display size without
uncovering the desktop and having the texts move around avery few seconds
like a screensaver would normally do.

It would be nice to be able to show little graphics (32x32, 24x24,16x16) in the OSD
as I can do in "Track info panel". I would use some icons to show to which situation
a track would fit: breakfast ; house cleaning; relax; listening; and so on.


If all this is too bothering, forget it, of course.

Thank you.


Foo_osd

Reply #160
Does anybody has a titleformatting string to cleverly mock auto-wrapping
where long texts are broken only at spaces or at certain characters?
I made one but it breaks on length so it can cut words in a half.

Read this:
http://wiki.hydrogenaud.io/index.php?title...tting_Reference

You can make a hard cut at the maximum amount of characters you ever want to see (suppose 12):
Code: [Select]
$cut(%title%,12)

Then check at what position the last space is in there:
Code: [Select]
$strrchr($cut(%title%,12), )

And use that to cut the string right where the space is:
Code: [Select]
$cut(%title%,$strrchr($cut(%title%,12), ))

However if there was no space at all, you'd be cutting at position 0, which we don't want. So we will check whether it's 0 or not and will act accordingly:
Code: [Select]
$ifgreater($strrchr($cut(%title%,12), ),0,
$cut(%title%,$strrchr($cut(%title%,12), )),
$cut(%title%,12))

There's also one more thing, if the string that we hard cut once contains a space but is otherwise really short, we'd be cutting it too early the second time. Which we can fix by adding a dummy space.
Code: [Select]
$ifgreater($strrchr($cut(%title%,12), ),0,
$cut(%title%,$strrchr($cut(%title% ,12), )),
$cut(%title%,12))

Not the best explanation, but it works in my quick testing.

Foo_osd

Reply #161
@Daeron: Thanks for your detailed examples, I will have a look into them.

@everybody:

I tried to use $if(%isplaying%, show info, show nothing)
but it seems it doesn't work correctly. When I stop or pause the playing,
the info are still showed with the last values, even for the playing time.
I can only see the "show nothing" for a second or two when I start
the playing of a track.

The same expression works correctly in a track info panel.

Do I have to use some different syntax than the one I found on the
reference page linked by Daeron? If tes, which one?

Thanks.

edit: typo

Foo_osd

Reply #162
Sorry to quote and reply to myself but it could be useful for somebody else.

I tried to use $if(%isplaying%, show info, show nothing)
but it seems it doesn't work correctly. When I stop or pause the playing,
the info are still showed with the last values, even for the playing time.
I can only see the "show nothing" for a second or two when I start
the playing of a track.

The same expression works correctly in a track info panel.

Do I have to use some different syntax than the one I found on the
reference page linked by Daeron? If yes, which one?

I removed the %isplaying% strings and I set the OSD to
"Automatically pop up at play... and hide at stop"
so I will never have info shown with no tracks playing.
I also set up a couple of vbs files to activate/deactivate
the screensaver so that when nothing is playing the screensaver
kicks in and when the play starts the screensaver is deactivated
leaving space for FB OSD.


This is the full configuration string of my OSD, with smart auto wrapping
of title and performer. If the text is longer than the max amount
of characters I can show in a line (76 in my case) it gets truncated
at a space position and the length of the remaining string is checked again
against 76, and so on. I set up a different number of splittings asI have
different maximum lengths for different genres.

I used variables with $puts() and $get() to simplify a little the calculation
of the beginning and the end of each line of text after the truncation.

Here is a couple of screenshots of a jazz track and a classical one.

     


Hope some snippet can be useful for somebody else.

Thank you.

Code: [Select]
$crlf()
$crlf()
$crlf()


//Start of title
$rgb(255,255,60)

//If title length is greater than 76 than start to cut it in two lines
//otherwise show it on a single line
$ifgreater($len(%title%),76,

//First line of title, truncated at the last space before the 76th character
$puts(tae,$strrchr($substr(%title%,1,76), ))
$substr(%title%,1,$get(tae))
$crlf()

//Second line of title, from the first character after the last of the first line
//to the last space inside the next 76 chars or to the end of title if shorter.
$puts(tbs,$add($get(tae),1))
$ifgreater($sub($len(%title%),$get(tae)),76,
$puts(tbe,$add($get(tbs),$strrchr($substr(%title%,$get(tbs),$add($get(tbs),76)), )))
$rgb(255,255,60)$substr(%title%,$get(tbs),$get(tbe))
,$rgb(255,255,60)$substr(%title%,$get(tbs),$add($get(tbs),76)))

,%title%)
//End of title

$crlf()
$crlf()
$crlf()


//Start of artist or composer
$if($stricmp(%genre%,classica),$rgb(255,204,153)'Composer:  '$rgb(255,255,255)%composer%,
$rgb(255,255,255)%artist%)
//End of artist or composer and date

$crlf()


//Start of conductor, orchestra, performer, artist, album  and date
[$crlf()$rgb(255,255,255)

//Replaces existing groups of three spaces with a single one into performer field
$puts(pf,$replace(%performer%,   , ))

//If genre is classica shows conductor, orchestra and performer
$if($stricmp(%genre%,classica),
[%conductor%][ - %orchestra%]

$crlf()

//Start of performer
//If genre is classica there will be at maximum two lines
[
//First line of performer, truncated at the last space before the 76th character
//or to the end of performer if shorter.
$puts(lae,$strrchr($substr($get(pf),1,76),')'))
$substr($get(pf),1,$get(lae))

$crlf()

//Second line of performer, from the first character after the last of the first line
//to the last space inside the next 76 chars or to the end of performer if shorter.
$puts(lbs,$add($get(lae),2))
$puts(lbe,$add(-1,$get(lbs),$strrchr($substr($get(pf),$get(lbs),$add($get(lbs),76)),')')))
$substr($get(pf),$get(lbs),$get(lbe))

$crlf()

//Third line of performer, from the first character after the last of the second line
//to the last space inside the next 76 chars or to the end of performer if shorter. (disabled)
//$puts(lcs,$add($get(lbe),2))
//$puts(lce,$add(-1,$get(lcs),$strrchr($substr($get(pf),$get(lcs),$add($get(lcs),76)),')')))
//$substr($get(pf),$get(lcs),$get(lce))

$crlf()

//Fourth line of peformer, from the first character after the last of the third line
//to the last space inside the next 76 chars or to the end of performer if shorter. (disabled)
//$puts(lds,$add($get(lce),2))
//$puts(lde,$add(-1,$get(lds),$strrchr($substr($get(pf),$get(lds),$add($get(lds),76)),')')))
//$substr($get(pf),$get(lds),$get(lde))

//$crlf()

//Fifth line of peformer, from the first character after the last of the fourth line
//to the last space inside the next 76 chars or to the end of performer if shorter. (disabled)
//Disabled
//$puts(les,$add($get(lde),2))
//$puts(lee,$add(-1,$get(les),$strrchr($substr($get(pf),$get(les),$add($get(les),76)),')')))
//$substr($get(pf),$get(les),$get(lee))
//$crlf()
]

,$if($stricmp(%genre%,jazz),

//If genre is jazz there will be at maximum six lines

//First line of performer, truncated at the last space before the 76th character
//or to the end of performer if shorter.
$puts(lae,$strrchr($substr($get(pf),1,76),')'))
$substr($get(pf),1,$get(lae))

$crlf()

//Second line of performer, from the first character after the last of the first line
//to the last space inside the next 76 chars or to the end of performer if shorter.
$puts(lbs,$add($get(lae),2))
$puts(lbe,$add(-1,$get(lbs),$strrchr($substr($get(pf),$get(lbs),$add($get(lbs),76)),')')))
$substr($get(pf),$get(lbs),$get(lbe))

$crlf()

//Third line of performer, from the first character after the last of the second line
//to the last space inside the next 76 chars or to the end of performer if shorter.
$puts(lcs,$add($get(lbe),2))
$puts(lce,$add(-1,$get(lcs),$strrchr($substr($get(pf),$get(lcs),$add($get(lcs),76)),')')))
$substr($get(pf),$get(lcs),$get(lce))

$crlf()

//Fourth line of peformer, from the first character after the last of the third line
//to the last space inside the next 76 chars or to the end of performer if shorter.
$puts(lds,$add($get(lce),2))
$puts(lde,$add(-1,$get(lds),$strrchr($substr($get(pf),$get(lds),$add($get(lds),76)),')')))
$substr($get(pf),$get(lds),$get(lde))

$crlf()

//Fifth line of peformer, from the first character after the last of the fourth line
//to the last space inside the next 76 chars or to the end of performer if shorter.
$puts(les,$add($get(lde),2))
$puts(lee,$add(-1,$get(les),$strrchr($substr($get(pf),$get(les),$add($get(les),76)),')')))
$substr($get(pf),$get(les),$get(lee))

$crlf()

//Sixth line of peformer, from the first character after the last of the fifth line
//to the last space inside the next 76 chars or to the end of performer if shorter.
$puts(lfs,$add($get(lee),2))
$puts(lfe,$add(-1,$get(lfs),$strrchr($substr($get(pf),$get(lfs),$add($get(lfs),76)),')')))
$substr($get(pf),$get(lfs),$get(lfe))

//$crlf()
,
//%artist% -
%album%  -  %date%

$crlf()

//If genre is different than classica and jazz there will be at maximum two lines

//First line of performer, truncated at the last space before the 76th character
//or to the end of performer if shorter.
$puts(lae,$strrchr($substr($get(pf),1,76),')'))
$substr($get(pf),1,$get(lae))

$crlf()

//Second line of performer, from the first character after the last of the first line
//to the last space inside the next 76 chars or to the end of performer if shorter.
$puts(lbs,$add($get(lae),2))
$puts(lbe,$add(-1,$get(lbs),$strrchr($substr($get(pf),$get(lbs),$add($get(lbs),76)),')')))
$substr($get(pf),$get(lbs),$get(lbe))

$crlf()
)
)
]




//Line to separate performer from the rest
//'Azzurro'
//$rgb(143,200,231)
//______________________________________________________

$crlf()
$crlf()

//Rating
//$rgb(255,204,153)'Rating:  '
$rgb(0,255,255)%rating%          

//Tempo        
//$rgb(255,204,153)'Tempo:  '
$rgb(255,255,255)%tempo%          

//Genre and subgenre (style)
//$rgb(255,204,153)'Genre:  '
$rgb(255,255,255)%genre%          
//$rgb(255,204,153)'Style:  '
$rgb(255,255,255)%subgenre%

$crlf()

//Line to separate between rating, tempo, genre, style and situation
//'Azzurro'
//$rgb(143,200,231)
//______________________________________________________

$crlf()



//Situation
//$rgb(255,204,153)'Situation:  '
$rgb(255,255,255)%situation%                    

//$crlf()

//Line to separate between situation and playback time
//'Azzurro'
//$rgb(143,200,231)
//______________________________________________________

//$crlf()

//Length + playback time + playback time remaining
$rgb(255,255,255)%length%  '-' %playback_time% '-' %playback_time_remaining%

$crlf()

//Fancy progress bar (taken from the forum)
//$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 130,$rgb(143,58,191,0,0,0)'?',$rgb(108,18,64,0,0,0)'?')
$crlf()
$crlf()

//Line to keep the width of the window fixed
'______________________________________________________________________________'

//Some colours codes
//$rgb(255,255,60)'Giallo titolo'
//$rgb(136,204,150)'Verduzzo'
//$rgb(255,204,153)'Rosa'
//$rgb(143,200,231)'Azzurro'
//$rgb(255,0,255)'Magenta'
//$rgb(0,255,255)'Ciano'
//$rgb(255,0,0)'Rosso'
//$rgb(0,0,255)'Blu'
//$rgb(0,255,0)'Verde'
//$rgb(255,255,255)'Bianco'

Re: Foo_osd

Reply #163
Having two presets, is there a way to be sure of which preset will be shown in front and which one in background?

Thanks.

Re: Foo_osd

Reply #164
I suppose it depends on which is shown first? They don't parent each other, they're all direct children of the desktop window. I never really thought about multiple overlays overlapping and triggering simultaneously.

Re: Foo_osd

Reply #165
I'm trying to create an osd where the title has a bigger font
than the rest of the info, so I created a preset just for the title
and I positioned it at the top of the screen, and a second one for the rest
that I put in the bottom. They have the same background color
(full black) so they blend as just one. But I have to make their
background overlap a bit hence the need ov an overlapping level setting.

A feature that would help a lot to build this kind of "combined"
setups is the possibility to set fixed dimensions (pixels) for width
and height of each preset canvas.
Now the canvas changes dimensions following the width of
the text and the number of lines so it is unpredictable and so
it's a "hit & hope" when you try to combine two or more.
For now, to get a predictable width I put a line of underscores
in the presets, in an area that won't be shown but it's not ideal.
And it's a bit of a mess trying to do the same for the height
so fixed pixel dimensions would be very welcomed to me.

The position should be set in exact pixels too.

The ability to assign a fixed level in the overlapping order
to each preset, would let us (me, at least) build more useful and
interesting things.
Nice if one can assign the same level to more than one overlay.

Another thing would be the ability to change the background color
of each preset at scripting level, as we can do now with the text.

Last one would be the ability to show the system time value
at least in the hh:mm format.

But if it just for me, don't bother and have a nice walk...
(I think you skilled "coders" are always a bit behind with that: aren't you?)

Thanks for your time.

Re: Foo_osd

Reply #166
Is it possible to display cover art in on-screen display?

Re: Foo_osd

Reply #167
At this time, the OSD is text-only. I may look into inserting cover art, but that will require complex changes to the render code, to support insertion of an arbitrary image in place of some placeholder text.

Re: Foo_osd

Reply #168
Is there anyway (or any code) that makes OSD "stick" to the top center of the spectrum visualization?

Re: Foo_osd

Reply #169
Had a little trouble getting the pause to work and to appear correctly after reopening FB2K. It kept saying it was still playing but managed to sort that out.

Here's my formatting and settings.

Code: [Select]
$puts(formatting,
[
 $rgb(255,0,128,0,0,0)"$rgb(0,0,0,0,0,0)%title%$rgb(255,0,128,0,0,0)"
 $rgb(0,0,0,0,0,0)by
 $rgb(255,0,128,0,0,0)%artist%
 $rgb(0,0,0,0,0,0)- %album%]
 $rgb(192,192,192)|
 $rgb(255,0,128,0,0,0)[%playback_time%]
$rgb(0,0,0,0,0,0)[/%length%
$rgb(192,192,192)|
]
)

$if(
$and(
$not(
%ispaused%
),
%isplaying%,%artist%,%title%,%album%
),
$get(formatting) $rgb(255,0,128,0,0,0)PLAYING
,
$get(formatting) $rgb(192,192,192)PAUSED
)

Screenshots and settings attached:


Re: Foo_osd

Reply #170
Guys you need to replace "%isplaying%,%artist%,%title%,%album%" with "%isplaying%" to get the play/pause part of this wonderful osd to work.
Had a little trouble getting the pause to work and to appear correctly after reopening FB2K. It kept saying it was still playing but managed to sort that out.

Here's my formatting and settings.

Code: [Select]
$puts(formatting,
[
 $rgb(255,0,128,0,0,0)"$rgb(0,0,0,0,0,0)%title%$rgb(255,0,128,0,0,0)"
 $rgb(0,0,0,0,0,0)by
 $rgb(255,0,128,0,0,0)%artist%
 $rgb(0,0,0,0,0,0)- %album%]
 $rgb(192,192,192)|
 $rgb(255,0,128,0,0,0)[%playback_time%]
$rgb(0,0,0,0,0,0)[/%length%
$rgb(192,192,192)|
]
)

$if(
$and(
$not(
%ispaused%
),
%isplaying%,%artist%,%title%,%album%
),
$get(formatting) $rgb(255,0,128,0,0,0)PLAYING
,
$get(formatting) $rgb(192,192,192)PAUSED
)

Screenshots and settings attached:



Re: Foo_osd

Reply #171
Guys you need to replace "%isplaying%,%artist%,%title%,%album%" with "%isplaying%" to get the play/pause part of this wonderful osd to work.
It works just fine with that solution I posted. The ,%artist%,%title%,%album% are there to check if they exist with the and fn.
If you just use isplaying it'll give the wrong feedback if you close fb2k and reopen it. Even thought it's paused it'll think it's playing.
That's what the $not(%ispaused%
Is there for.

Re: Foo_osd

Reply #172
Embarrassed, I didn't understand the options. Nothing...

Re: Foo_osd

Reply #173
Any way to get bold text working with this?

Re: Foo_osd

Reply #174
Currently, the only formatting available is for colors. Bold must be set globally for a given overlay, same as italic and underline.

 
SimplePortal 1.0.0 RC1 © 2008-2021