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: Time left / Total time in copy? (Read 2585 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Time left / Total time in copy?

I read the manual for creating syntaxes that came with foobar, and with my little programming experience I decided that I wanted something extra to my copy.

After numerous tries however I gave up; I can't get it to work properly.

Code: [Select]
$if(%artist%,%artist%,)$if(%album%, :: %album%,)
$if(%title%, :: %title%, :: %_filename_ext%)
$if(%artist%, :: %_time_remaining% 'of' %_time_total%, ':: Song has ended')


As you see, I lastly tried using the %artist% var since using for example %_time_total% resulted in:
Do As Infinity - Hi No Ataru Sakamichi :: Hi No Ataru Sakamichi -Single- :: 01-Hi No Ataru Sakamichi :: Song has ended

When I use the above code, it displays:
Do As Infinity - Hi No Ataru Sakamichi :: Hi No Ataru Sakamichi -Single- :: 01-Hi No Ataru Sakamichi :: ? of ?

Which I figured was atleast a *little* closer to the solution I was looking for.


Now, I've rtfm, tried making it out myself; so I guess this is my last shot: Can someone help me with this?  The titleformat helpfile (foobar 0.7.0) states that %_time_remaining% and %_time_total% should be usable in the copy part. :/

Also, for next foobar release, could this be implemented to the tray aswell? Would be awesome to see how much one has left on the current song.


PS. I didn't post this in the wrong forum did I?  I was choosing between general and support.  DS.

EDIT: "Corrected" code a little

Time left / Total time in copy?

Reply #1
Hmh, I am not exactly sure what you are trying to achieve here.

The only thing I know for sure is that this line of code:
Code: [Select]
$if(%artist%, :: %_time_remaining% 'of' %_time_total%, ':: Song has ended')

will return "time remaining of time total" (obviously with the preoper values) for every file that contains an artist tag.  It will do so under all circumstances.  That means since most of your files contain an artist tag it will do so for every file that you are using the copy command on.

For every file withought an artist tag it will display "Song has ended"

EDIT: It's late and I answered slight nonsence the first time 

Time left / Total time in copy?

Reply #2
Quote
The titleformat helpfile (foobar 0.7.0) states that %_time_remaining% and %_time_total% should be usable in the copy part. :/

If by copy part, you mean the 'copy command' tab of the title formatting section, %_time_remaining% and %_time_total% is usable only if the track is currently playing. If not, they will return 'false' (when used with the $if() statement) and display '?' (when used for display).

Time left / Total time in copy?

Reply #3
Add in a $if(%_isplaying%, to check if the file is currently being played, then do the rest of the string.  $if(%artist%,%artist%,) is the same as [%artist%]

Time left / Total time in copy?

Reply #4
Quote
Hmh, I am not exactly sure what you are trying to achieve here.

The only thing I know for sure is that this line of code:
Code: [Select]
$if(%artist%, :: %_time_remaining% 'of' %_time_total%, ':: Song has ended')

will return "time remaining of time total" (obviously with the preoper values) for every file that contains an artist tag.  It will do so under all circumstances.  That means since most of your files contain an artist tag it will do so for every file that you are using the copy command on.

You are exactly right about what I want - I want the copy command to include the position in the song I am currently playing. However, inspite to what you say, that piece of code just returns "? of ?" instead of "2:32 of 3:46"

Try it yourself - I'll scream if it works for you

Time left / Total time in copy?

Reply #5
Quote
Add in a $if(%_isplaying%, to check if the file is currently being played, then do the rest of the string.  $if(%artist%,%artist%,) is the same as [%artist%]

%_isplaying% is playlist only.  Or am I missing something here?

Time left / Total time in copy?

Reply #6
Quote
%_isplaying% is playlist only.  Or am I missing something here?

Ugh, yes it is, nevermind.