Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - simshaun

Pages: 1
1
Plugins / Re: Remember Last Position of each track
« on: January 12, 2019, 06:11:00 PM »
I've got it working on Audiobooks only now. Woo!


@boroda74 Clicking any point in the progress bar is working. All I'm doing is saving the position when this occurs. Actually I should probably take that out to avoid potentially a lot of HDD writes if I'm dragging the scrobbler. It isn't really necessary anyway since I'm saving the position every second.

2
Plugins / Re: Remember Last Position of each track
« on: January 12, 2019, 05:17:58 PM »
@boroda74

Are you talking about when I drag the scrobble to another spot in the track? It's working for me. All I'm doing is saving the position when the scrobble is moved.

Thanks for the advice on the query syntax. I'll take a look.

Edit: Bingo! <Source Type="32"></Source>

3
Plugins / Re: Remember Last Position of each track
« on: January 12, 2019, 06:33:48 AM »
Thanks, but I don't think that helps. It looks like the API uses that for Library_AddFileToLibrary and Library_GetSyncDelta and that's it.

Maybe I can use Library_QueryFilesEx, but I'm not sure of the proper query. Seems like it accepts a string like domain=Library or an XML-like syntax (which I found in Tag Tools source), but all my guesses have come up short.

4
MusicBee Wishlist / Re: Remember playback position' flag default
« on: January 11, 2019, 08:11:47 PM »
Hi. Sorry if it's bad form to resurrect an old thread like this, but this is what came up in Google when I was searching for this functionality.

I've written (an admittedly simple) plugin that handles this.

https://getmusicbee.com/forum/index.php?topic=27654.0

5
Plugins / Remember Last Position of each track
« on: January 11, 2019, 08:09:23 PM »
Hi,

I'm using MusicBee solely for listening to Audiobooks, and I wanted it to remember where I left off on each book (I listen to multiple books at a time), so I wrote this plugin.

https://github.com/simshaun/musicbee-audiobook-position-tracker

7
Thanks! I think I've got it all working now after a lot of trial and error.

By the way, is there a better development workflow than doing this after every change? 1) Rebuild Solution in VS, 2) Close MusicBee, 3) Copy/paste DLL to MusicBee folder, 4) Reopen MusicBee?

8
Apologies if this is a dumb question, but I'm rather new to C# and trying to cobble together a plugin.

My goal is to store Player_GetPosition() at an interval. When the user changes to another track, load the stored position of that track. In other words, "remember where I left off" on a per-file basis.

I've nearly got it all working, except when I change to a new track in my now-playing list, I'm getting an infinite loop because Player_SetPosition() appears to be triggering `NotificationType.TrackChanged`.

Is there a different event I need to be using? Thanks in advance.

(shortened code:)
Code
        public void LoadSavedPosition()
        {
            try
            {
                var text = File.ReadAllText(GetPositionFilename());
                _mbApiInterface.Player_SetPosition(int.Parse(text));
            }
            catch (Exception)
            {
                // ignored
            }
        }

        public void ReceiveNotification(string sourceFileUrl, NotificationType type)
        {
            switch (type)
            {
                case NotificationType.TrackChanged:
                    LoadSavedPosition();
                    break;
            }
        }

Pages: 1