[Approved] Add Love/Ban option in Music Now Playing (1 Viewer)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,257
    2,533
    Birmingham
    Home Country
    United Kingdom United Kingdom
    This is a very simple patch to add love/ban options to the context menu in music now playing.

    It is just calling existing audioscrobbler code, is localized and only displays in menu if audioscrobbler plugin is enabled

    ===========================================================================
    Updated a few times. Love/Ban in Now Playing is now possible via
    • actions (mapped to L/K keys)
    • context menu
    • Skin Controls (Buttons with IDs 30/31)

    A dialog pops up to tell you that action has been submitted. This requires a skin change (new file for the new dialog). This has ID 512 (file attached for B3W which is simply a copy of the notify dialog file with the ID changed)

    Binaries attached compiled against 1.2 Alpha. Backup any existing binaries before testing this.

    Changelog
    =======
    v1 - ban/love via context menu
    v2 - added ability to ban/love via action
    v3 - added ability to ban/love via button and added dialog
    v4 - ignore has an error in it
    v5 - moved notification to a brand new dialog
    v6 - removed image from dialog
     

    Attachments

    • music_now_playing_love_ban.patch
      1.5 KB
    • music_now_playing_love_ban_v2.patch
      3.5 KB
    • music_now_playing_love_ban_v3.patch
      5.9 KB
    • music_now_playing_love_ban_v5.patch
      12.6 KB
    • DialogNotifyLastFM.xml
      2.5 KB
    • music_now_playing_love_ban_v5.zip
      1.5 MB
    • music_now_playing_love_ban_v6.patch
      11.5 KB

    Peter2

    MP Donator
  • Premium Supporter
  • September 18, 2006
    847
    53
    Home Country
    Belgium Belgium
    Hi jameson_uk, can you tell me how to apply this patch?
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    41
    Austria
    Home Country
    Austria Austria
    Tested with latest svn and and both functions works fine... As expected only shows when audioscrobbler is enabled...

    Is it possible to assign love/ban functions to a button with this patch? Would be much nicer then always having to invoke the context menu...

    :D
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    41
    Austria
    Home Country
    Austria Austria
    Hi jameson_uk, can you tell me how to apply this patch?

    You have to download the latest sourcecode via svn and apply this patch using a tool like tortoisesvn... If you don't now how to use svn/compile MediaPortal it's probably best to wait for the upcoming alpha release of MediaPortal 1.2.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,257
    2,533
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Is it possible to assign love/ban functions to a button with this patch? Would be much nicer then always having to invoke the context menu...
    I did think that and perhaps we can add that.... just not sure how to do that where as the context menu was a few lines of code....

    If someone can point me towards somewhere else this has been implemented and can add it in.

    This will be in addition to this so I think it should be a separate patch anyway
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    41
    Austria
    Home Country
    Austria Austria
    Well as far as this patch is concerned, the changes look safe to me and I didn't run into any problems using it.

    Nice patch, :D
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Context menu is IMO good place for this.

    Buttons are to be defined with: [SkinControl(buttonID)] protected GUIButtonControl btnLike = null;

    Then if skin has the control, it'll not be null anymore. Therefore anything you do with the button, prefix it with: if (btnLike != null)

    OnAction() will be called when button is clicked, add relevant code there.

    Hope it helps :)
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,257
    2,533
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Context menu is IMO good place for this.

    Buttons are to be defined with: [SkinControl(buttonID)] protected GUIButtonControl btnLike = null;

    Then if skin has the control, it'll not be null anymore. Therefore anything you do with the button, prefix it with: if (btnLike != null)

    OnAction() will be called when button is clicked, add relevant code there.

    Hope it helps :)

    Was not thinking about extra buttons but a global action which a user could map to a remote button or key.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,257
    2,533
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Was not thinking about extra buttons but a global action which a user could map to a remote button or key.
    Is this as simple as adding an entry to the ActionType enum in Action class then adding that to OnAction ??

    That sounds far too simple....
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,257
    2,533
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Is this as simple as adding an entry to the ActionType enum in Action class then adding that to OnAction ??
    Apparently it is...
    New patch attached. Have added new action types and also default keyboard shortcuts to now playing screen
    (L = love / K = Ban) which again only fire if audioscrobbler plugin is enabled

    Did think about adding buttons but not sure there is a demand for this? Context menu and actions should be sufficient?

    Only thing which would be the icing on the cake is if a popup could appear for a couple of seconds saying track loved / banned and then it fades but I don't see any way of doing this in MP?
     

    Attachments

    • music_now_playing_love_ban_v2.patch
      3.5 KB

    Users who are viewing this thread

    Top Bottom