Author Topic: Miscellaneous Hotkeys  (Read 3019 times)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
Download it from the add-on link here

Version 1.0
In the future, I will convert this plugin to a generalized hotkey provider, as and when the requests come up.
The crossfade hotkey was requested a while back - I found this link from a recent wishlist request from another separate topic which I haven't linked here.

Maybe I'm missing something, but I couldn't find the Toggle Crossfade hotkey in the list.




Version 1.1

I've looked and searched and can't find a way to access the "Mark as having no lyrics" option outside the Lyrics tab in the Tag Editor.




The entire code for anyone interested in taking a peak.
Code
using System;

namespace MusicBeePlugin
{
    public partial class Plugin
    {
        private MusicBeeApiInterface mbApi;
        private PluginInfo about = new PluginInfo();

        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApi = new MusicBeeApiInterface();
            mbApi.Initialise(apiInterfacePtr);
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name = "Miscellaneous Hotkeys";
            about.Description = "hotkey support for various actions";
            about.Author = "Mayibongwe";
            about.TargetApplication = "";
            about.Type = PluginType.General;
            about.VersionMajor = 1;
            about.VersionMinor = 1;
            about.Revision = 0;
            about.MinInterfaceVersion = MinInterfaceVersion;
            about.MinApiRevision = MinApiRevision;
            about.ReceiveNotifications = ReceiveNotificationFlags.StartupOnly;
            about.ConfigurationPanelHeight = -1;

            return about;
        }

        public void ReceiveNotification(string sourceFileUrl, NotificationType type)
        {
            if (type == NotificationType.PluginStartup)
            {
                mbApi.MB_AddMenuItem(null, "Miscellaneous: Toggle Crossfade On/Off", crossfadeHandler);
                mbApi.MB_AddMenuItem(null, "Miscellaneous: Mark As Having No Lyrics", lyricsHandler);
            }
        }

        public void lyricsHandler(object sender, EventArgs e)
        {
            string[] selection;
            mbApi.Library_QueryFilesEx("domain=SelectedFiles", out selection);

            for (int i=1; i<=selection.Length; i++)
            {
               string track = selection[i-1];
               mbApi.Library_SetFileTag(track, MetaDataType.HasLyrics, "MarkNoLyrics");
               mbApi.Library_CommitTagsToFile(track);
               mbApi.MB_SetBackgroundTaskMessage(i + "/" + selection.Length + " tracks marked as having no lyrics...");
            }

            mbApi.MB_RefreshPanels();
        }

        public void crossfadeHandler(object sender, EventArgs e)
        {
            bool isCrossfadeOn = mbApi.Player_GetCrossfade();
            switch (isCrossfadeOn)
            {
               case true:
               mbApi.Player_SetCrossfade(false);
               break;

               case false:
               mbApiInterface.Player_SetCrossfade(true);
               break;
            }
        }

        public bool Configure(IntPtr panelHandle)
        {
            return false;
        }
    }
}
Last Edit: February 22, 2025, 04:57:42 AM by Mayibongwe
Strength and Honour (2025)

aktor

  • Sr. Member
  • ****
  • Posts: 336
can you make plugin for show/hide hotkey top track panel?

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
can you make plugin for show/hide hotkey top track panel?
That won't be possible, I'm afraid.
The current API does not support any modifications to MusicBee's internal panels.

You will unfortunately just have to hope your wishlist request gets fulfilled some day.
Is there a reason why you have to constantly enable and disable it?

A button or aa hot key option in music explorer to make appear and disappear Top Tracks Panel.
This is an excellent option. What about hotkey for show/hide top track panel?
Strength and Honour (2025)

aktor

  • Sr. Member
  • ****
  • Posts: 336
i like clean look and it takes too much space to be visible all the time,

KangNi

  • Full Member
  • ***
  • Posts: 204

gaiastar

  • Full Member
  • ***
  • Posts: 244
hi @Mayibongwe

beautiful plugin , i have tried and i set a red

might you ask you only about your knowledge if an hotkey could change Eq presets?
for example i have 3 eq presets and a default preset , and have 4 hotkeys to change them?

thank you so much for the plugin CROSSFADE TOGGLE (HOTKEY)
Last Edit: June 30, 2024, 04:14:08 PM by gaiastar
MusicBee is the best audio player ever made, Love it ♫♫

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
might you ask you only about your knowledge if an hotkey could change Eq presets?
for example i have 3 eq presets and a default preset , and have 4 hotkeys to change them?
Not that I can see.
The only Equalizer functions available are to enable & disable it, or to hide & show it in the player panel.
I would have to ask Steven to add support for it.

But before that, I would suggest you create a wishlist request in case he decides to add native support for it.

You can also link this reply in that thread too, in case he decides it's just easier to add as a plugin.
Strength and Honour (2025)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
In the future, I will convert this plugin to a generalized hotkey provider, as and when the requests come up.
Bookmarking this in case the wishlist request goes cold: AB Repeat

Edit: implemented separately on https://getmusicbee.com/forum/index.php?topic=41667.0
Last Edit: February 22, 2025, 05:00:21 AM by Mayibongwe
Strength and Honour (2025)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
In the future, I will convert this plugin to a generalized hotkey provider as and when the requests come up.
I've added in a hotkey to mark the selected track(s) as having no lyrics.
Following this addition, I have now renamed this plugin from "Crossfade Toggle (hotkey)" to something more generalized as initially intended.

I've looked and searched and can't find a way to access the "Mark as having no lyrics" option outside the Lyrics tab in the Tag Editor.
Strength and Honour (2025)