1
0

shadelinks.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: syncbutton.m
  4. Version: 1.0
  5. Type: maki
  6. Date: 25. Jun. 2007 - 14:04
  7. Author: Martin Poehlmann aka Deimos
  8. E-Mail: [email protected]
  9. Internet: www.skinconsortium.com
  10. www.martin.deimos.de.vu
  11. -----------------------------------------------------
  12. ---------------------------------------------------*/
  13. #include <lib/std.mi>
  14. #include <lib/com/songinfo.m>
  15. //nothing to see here
  16. Function String getArtist ();
  17. /*
  18. Global Button search, nowplaying;
  19. Global boolean isShade;
  20. System.onScriptLoaded ()
  21. {
  22. search = getScriptGroup().getObject("search");
  23. isShade = (search.getParentLayout().getId() == "shade");
  24. nowplaying = getScriptGroup().getObject("nowplaying");
  25. }
  26. search.onLeftClick ()
  27. {
  28. String artist = getArtist();
  29. if (artist == "") return;
  30. getContainer("main").switchToLayout("normal");
  31. group sui = getContainer("main").getLayout("normal").findObject("sui.content");
  32. sui.sendAction ("browser_search", artist, 0, 0, 0, 0);
  33. }
  34. nowplaying.onLeftClick ()
  35. {
  36. String artist = getArtist();
  37. if (artist == "") return;
  38. //getContainer("main").switchToLayout("normal");
  39. String icid = "fileinfoicon";
  40. if (isShade)
  41. {
  42. icid = "winshadeiconbento";
  43. }
  44. System.navigateUrlBrowser("http://client.winamp.com/nowplaying/artist/?icid="+ icid +"&artistName=" + artist);
  45. }
  46. */
  47. String getArtist ()
  48. {
  49. songinfo_reload();
  50. if (songinfo_isStream && songinfo_artist == "")
  51. {
  52. int v = strsearch(songinfo_streamtitle, " - ");
  53. if (v > 0)
  54. {
  55. return strleft(songinfo_streamtitle, v);
  56. }
  57. return songinfo_streamtitle;
  58. }
  59. return songinfo_artist;
  60. }