From Beatunes to external player?

ErikL's Avatar

ErikL

08 May, 2017 09:45 AM

Hi,

At home I'd like to use Beatunes with an external player that can handle my multi-channel setup (Foobar, JRiver MC).

For individual songs there are the following options in the context menu:
--play in JRiver MC (the balloon tip says "default external player" which btw it isn't)

--open in / windows media player.

What I'm looking for is a way to send individual songs and playlists/matchlists/mixes to an external player of choice. Is that possible?

I had a quick look at (automatically) exporting playlists, but that seems a bit clunky for what I want.

  1. Support Staff 1 Posted by hendrik on 08 May, 2017 11:33 AM

    hendrik's Avatar

    --play in JRiver MC (the balloon tip says "default external player" which btw it isn't)

    Hm. For the specific file type, that's not the default player? I.e. not the option that is chosen by Windows when you simply double-click the file?

    What I'm looking for is a way to send individual songs and playlists/matchlists/mixes to an external player of choice. Is that possible?

    Your best bet is currently right-clicking on the playlist, exporting the playlist in one of the offered formats and then open that playlist file in your favorite player. Admittedly, not very smooth.

    You could script something that exports and opens in one action using the API.

  2. 2 Posted by ErikL on 08 May, 2017 12:00 PM

    ErikL's Avatar

    Default windows music player is Foobar (for FLAC and MP3) but Beatunes seems to think it's JRiver MC.

    I'm afraid I don't have the programming skills to write such a script :(

  3. Support Staff 3 Posted by hendrik on 09 May, 2017 07:33 AM

    hendrik's Avatar

    Which playlist format would be most useful for you? m3u?

  4. Support Staff 4 Posted by hendrik on 09 May, 2017 08:01 AM

    hendrik's Avatar

    Please save the file https://raw.githubusercontent.com/beatunes/beaTlet-samples/master/g... under the name OpenPlaylistExternallyAction.groovy in your plugins folders. Make sure the file has the .groovy file extension and not .txt or any such thing. Then restart beaTunes.

    This should create a new menu item under File that allows you to export playlists and open them in an external app. The format used in the sample beaTlet is m3u and the external app is your default app for that file extension.

    Other formats can be used by editing the beaTlet source code.

  5. 5 Posted by ErikL on 09 May, 2017 08:49 AM

    ErikL's Avatar

    Thanks, I figured this applet would be a good place to start. I think I can manage tweaking existing code :-)

  6. Support Staff 6 Posted by hendrik on 09 May, 2017 09:48 AM

    hendrik's Avatar

    Thanks, I figured this applet would be a good place to start. I think I can manage tweaking existing code :-)

    Excellent.

  7. 7 Posted by ErikL on 09 May, 2017 11:56 AM

    ErikL's Avatar

    It works, but a little bit rough.
    I've tested with different output formats and playlists.

    • Always this error msg: Failed to export and play playlist. java.lang.NullPointerException: sdvf

    As I said the action DOES complete (more or less, see next issue)

    • Sometime the first item(s) in the playlist are not exported (independent of output format). Haven't found a pattern yet.

    I assume I have to restart BT in order to commit changes I make in the code?

    Would be really cool if the export would (also) work from the context menu of manually selected files.

    I've uploaded the logs just in case.

  8. Support Staff 8 Posted by hendrik on 09 May, 2017 12:31 PM

    hendrik's Avatar

    That NPE (NullPointerException) was in there for testing. I forgot to remove it.
    It's removed now (from the online version).

    Sometime the first item(s) in the playlist are not exported (independent of output format). Haven't found a pattern yet.

    That seems odd.

    I assume I have to restart BT in order to commit changes I make in the code?

    Yes.

    Should you make any changes that simply don't work, you might see error messages in the log files.

  9. Support Staff 9 Posted by hendrik on 09 May, 2017 02:58 PM

    hendrik's Avatar

    Sometime the first item(s) in the playlist are not exported (independent of output format). Haven't found a pattern yet.

    Perhaps umlauts in the file names? m3u does not handle those too well...

  10. 10 Posted by ErikL on 11 May, 2017 09:18 AM

    ErikL's Avatar

    Thanks for pointing this out, it's indeed the "special" characters in the filenames.
    So in theory m3u8 should work better if I understand correctly, but that's not the case. It seems even more finicky. pls behaves the same as m3u (as far as tested).

    Edit: would writing the playlist in a another encoding make a difference?

  11. Support Staff 11 Posted by hendrik on 12 May, 2017 07:41 AM

    hendrik's Avatar

    So in theory m3u8 should work better if I understand correctly,

    Yes, because it properly supports UTF-8 which deals with all kinds of unicode characters.

    but that's not the case.

    What's exactly the issue with it?
    What you export the playlist manually (via the playlist context menu), you get the actual playlist file, which you can open in your favorite playlist player. Can you reproduce the problem? Looking at the playlist file (e.g. using Windows Notepad), can you spot any issues in the file? The format is trivial...

    Edit: would writing the playlist in a another encoding make a difference?

    It really shouldn't.

    -hendrik

  12. 12 Posted by ErikL on 12 May, 2017 09:53 AM

    ErikL's Avatar

    I've had a closer look and the problem is not in the playlist creation, but in Foobar's handling of the playlist with non-ASCII songnames.
    There's different results for input from (m3u8) playlists, standard database view and drag and drop imported files, so plenty to investigate over the weekend :-)

  13. Support Staff 13 Posted by hendrik on 12 May, 2017 10:01 AM

    hendrik's Avatar

    Hey Erik,

    To figure out whether it’s Foobar’s or beaTunes’ fault, try opening the same playlist with VLC or some other third party program that understands m3u8. If it cannot open it either, it’s beaTunes to blame!

    Cheers,

    -hendrik

  14. 14 Posted by ErikL on 12 May, 2017 11:27 AM

    ErikL's Avatar

    JRiver MC - Foobar 1-0
    So it's Foobar related.
    I found something in a FB forum post from 2012: 'foobar2000 requires a UTF-8 byte order marker (BOM) for .m3u8 files"
    (https://hydrogenaud.io/index.php/topic,93905.0.html)

  15. Support Staff 15 Posted by hendrik on 12 May, 2017 01:13 PM

    hendrik's Avatar

    AFAIK, m3u8 is always UTF-8 encoded.
    So that BOM is idiotic, IMHO.

    What about the other formats? Can Foobar deal with XSPF? It's XML based, to encoding should be no issue.

  16. 16 Posted by ErikL on 12 May, 2017 02:37 PM

    ErikL's Avatar

    I installed a plugin (foo_xspf_1) and with that all the items from a xspf playlist show up in Foobar (not so with m3u8).
    However, there are anomalies: some songs are not playable (it seems the playlist entry doesn't link back to the actual file).
    I'll need some more time to find out what's going on, I'll keep you posted.

  17. 17 Posted by ErikL on 12 May, 2017 02:44 PM

    ErikL's Avatar

    So that BOM is idiotic, IMHO.

    most people in that thread would agree with you, but the conclusion was that BOM is obligatory "If this is missing it [FB] will assume the file is using a different encoding"

  18. Support Staff 18 Posted by hendrik on 13 May, 2017 12:45 PM

    hendrik's Avatar

    most people in that thread would agree with you, but the conclusion was that BOM is obligatory "If this is missing it [FB] will assume the file is using a different encoding"

    If I was a Foobar user, I'd file a bug report.

  19. Support Staff 19 Posted by hendrik on 15 May, 2017 10:04 AM

    hendrik's Avatar

    Please check out beaTunes 4.6.15 (just released).
    In the name of interoperability, I have added a BOM to the m3u8 export.
    (still think it's BS)

  20. 20 Posted by ErikL on 16 May, 2017 08:19 AM

    ErikL's Avatar

    Problem solved.
    This is support far beyond the call of duty ;-) really appreciate it.
    I was looking into scripts to strip folder- and filenames of non-ascii chars, but this saves me tons of time.

  21. Support Staff 21 Posted by hendrik on 16 May, 2017 09:19 AM

    hendrik's Avatar

    This is support far beyond the call of duty ;-) really appreciate it.

    No problem. The change was trivial and VLC was still able to read the playlist file afterwards. So hopefully no other incompatibilities were introduced. Needless to say that interoperability is key when it comes to exporting playlists.

  22. 22 Posted by ErikL on 16 May, 2017 09:29 AM

    ErikL's Avatar

    hopefully no other incompatibilities were introduced

    JRiver MC is OK as well.

  23. Support Staff 23 Posted by hendrik on 16 May, 2017 09:41 AM

    hendrik's Avatar

    hopefully no other incompatibilities were introduced

    JRiver MC is OK as well.

    Good. Thanks for letting me know.

  24. hendrik closed this discussion on 18 May, 2017 02:19 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac