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: %playback_time_seconds% (Read 2483 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

%playback_time_seconds%

I wanted to solve bookmark problem with foo_run = without installing new component:

Code: [Select]
apl_bookmark.bat "%path%" $mul(%samplerate%,%playback_time_seconds%) %length_samples%

apl_bookmark.bat
Code: [Select]
@echo [Monkey's Audio Image Link File] > "%~dp1%~n1_%2-%3.apl"
@echo Image File=%~dp1%~n1%~x1 >> "%~dp1%~n1_%2-%3.apl"
@echo Start Block=%2 >> "%~dp1%~n1_%2-%3.apl"
@echo Finish Block=%3 >> "%~dp1%~n1_%2-%3.apl"

This was initial step as I wanted to go further with APETAGEX, but stopped on this sign

I don't understand what's the problem with this %playback_time% limitation:
Quote
...contexts where playback related data is displayed, such as statusbar.

It may refresh playlist view each second, but I want to pass it to command line once in a while

Is there some other approach for passing current progress to run service (without installing new components)?


%playback_time_seconds%

Reply #1
The only way is to assign a command from the [context / now playing] branch of shortcut actions.

%playback_time_seconds%

Reply #2
Thanks for your reply kode54,

Is this what you are saying:


%playback_time_seconds%

Reply #3
Then I guess you need another component, since this one is obviously not using the right formatting function.


%playback_time_seconds%

Reply #5
OK, I wanted to make this as it makes more sense to me than some other approaches. Just too bad that I can't make it with batch or VBS, without additional components.
I see there are at least 3 scripting solutions to this problem:

1. VBS access to foobar COM server component
2. VBS access to Winamp COM object
3. Python Winamp controller with Win32 module

As I use Shpeck and have Python installed, I went to 3rd option. COM server component is also tempting as option, but maybe in some future

http://codepad.org/yzrWFmHq

It can be used with foo_run as:

Code: [Select]
cmd /c "/path-to/pythonw.exe /path-to/apl_bookmark.py "%path%" %samplerate% [%length_samples%]"

It takes 3 arguments, plus last one can be omitted or zero (that is why it's enclosed in square brackets), in which case it can make "end" bookmark (or APL link referencing from beginning of playing track till current playback time). Usually, with %length_samples% argument, it creates APL bookmark from current playing time till the track end

APL links are created in track's folder, so if tracks are in library, they'll appear in media library viewers as new items, can be processed with autoplaylist etc.

edit: added new link, as pastebin is adware