Re: foo_skip: skip tracks that match a specified search query
Reply #608 – 2020-08-31 11:27:52
@mikehawk1999 I've solved it for myself with some additional foobar components and an AutoHotKey script, and it works for me, but as it has some serious limitations it might be not what you are looking for. Limitations: shortcut to save a bookmark works only when main foobar window is active and the file playing is selected (I use the option Playback -> Playback follows cursor); the window where the time for the bookmark is saved briefly appears on pressing shortcut; no bookmarking automatically, I press Num0 to save a bookmark, Ctrl+Num0 to erase the bookmark (and foo_skip starts playback from the time saved in the bookmark). I describe my setting as they work for me, but I can't really help if something goes wrong with them for you.foo_skip (starts playback from the bookmarked time, no special settings needed)foo_customdb (stores time for bookmarks in the SKIP field of this component's database). Settings: (If the component crushes foobar, delete everything that was set by default in Preferences -> Tools -> Custom Database -> Actions and maybe in Custom Database -> Fields too, not sure, I installed this component a long time ago) 1. Preferences -> Tools -> Custom Database -> Fields. Add (edit) the Skip field: Display: Skip Name: SKIP Key: Custom: $if($stricmp($left(%path%,4),'http'),%path%,%artist%-%album%-%title%) (The key determines for what the bookmark will be saved. I set it up this way: if the path to the file starts with "http" the bookmark would be saved for that path, otherwise (= local file) the bookmark will be saved for Artist-Album-Title. You can change it however you want using Title Formatting Reference (i.e just leave %artist%-%title%) but keep in mind, if you change it in the future, the bookmarks saved before the change won't work). 2. Preferences -> Tools -> Custom Database -> Actions. Add an action for setting up a bookmark: Display: DB Skip - Bookmark time (or whatever name you want for it) Field: SKIP Update: contextmenu -> Dialog Set Value: 3. Preferences -> Tools -> Custom Database -> Actions. Add (edit) action to delete the bookmark: Display: Set Skip Off (or whatever name you want for it) Field: SKIP Update: contextmenu -> Erase 4. Restart foobar after changing setting for the foo_customdb.foo_texttools (copies the current playback time as foo_customdb doesn't recognize %playback_time%). Settings: Preferences -> Tools -> Text Tools -> Add new: Name: playback time (or whatever name you want) Pattern: %playback_time%Preference -> Keyboard Shortcuts: Key: Ctrl+Num0; Action: Set Skip Off (delete the bookmark on Ctrl+Num0) Key: Ctrl+T; Action: Utilities / Text Tools / Copy: playback time Key: Ctrl+Shift+B; Action: DB Skip - Bookmark time At this point you can test it. Play an youtube link, press Ctrl+T, press Ctrl+Shift+B, type - and press Ctrl+V (in the window there should be the current playback time after the minus symbol), click on OK. Play another file and return to the previous youtube link. The playback should start from the bookmarked time. If it all worked, the final thing is an AutoHotKey script that just does everything from the previous paragraph to save a bookmark. AHK script (save it as a text file with .ahk extention and launch it with autohotkey):#IfWinActive ahk_exe foobar2000.exe { ; the hotkey on which the script will be executed = Numpad0 to save a bookmark Numpad0:: ; Ctrl+T = shortcut to copy %playback_time% Send ^t ; Ctrl+Shift+B = shortcut for DB Skip - Bookmark time Send ^+b ; typing - and then pasting (Ctrl+V) the copied playback time, TAB to move to the OK button and ENTER to save the bookmark Send - Send ^v Send {Tab} Send {Enter} return } #IfWinActive edit: Changed quoted username