{"id":3466,"date":"2015-11-27T16:15:00","date_gmt":"2015-11-27T23:15:00","guid":{"rendered":"http:\/\/www.nathalielawhead.com\/candybox\/?p=3466"},"modified":"2015-11-27T16:19:23","modified_gmt":"2015-11-27T23:19:23","slug":"electric-love-potato-playlist-player","status":"publish","type":"post","link":"https:\/\/www.nathalielawhead.com\/candybox\/electric-love-potato-playlist-player","title":{"rendered":"Electric Love Potato Playlist Player"},"content":{"rendered":"<p>So I&#8217;m here to make mention of my latest release: Electric Love Potato Playlist Player. You can download it from <a href=\"http:\/\/alienmelon.itch.io\/potato-playlist-player\" target=\"_blank\">itch.io<\/a> or <a href=\"http:\/\/gamejolt.com\/games\/electric-love-potato-playlist-player\/110084\" target=\"_blank\">Gamejolt<\/a>:<\/p>\n<p><a href=\"http:\/\/gamejolt.com\/games\/electric-love-potato-playlist-player\/110084\" target=\"_blank\">http:\/\/gamejolt.com\/games\/electric-love-potato-playlist-player\/110084<\/a><br \/>\n<a href=\"http:\/\/alienmelon.itch.io\/potato-playlist-player\" target=\"_blank\">http:\/\/alienmelon.itch.io\/potato-playlist-player<\/a><\/p>\n<p>It&#8217;s available for MAC and Windows.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/nathalielawhead.com\/noodles\/GJ_THUMB.gif\" alt=\"\" \/><\/p>\n<p>It&#8217;s a small &#8220;take a break&#8221; project that I did (hoping to combat my current burnout and resulting depression). These things help. Just finish something TOTALLY different. <a href=\"http:\/\/generators.alienmelon.com\/\" target=\"_blank\">My generators<\/a> used to be that, but I&#8217;ve since graduated to potatoware. I loved this. It&#8217;s been really interesting because it&#8217;s a music player, and I&#8217;ve never *really* done that before.<br \/>\nLike your typical <a href=\"http:\/\/gamejolt.com\/games\/electric-love-potato\/75231\" target=\"_blank\">Electric Love Potato<\/a> this is a potato that provides companionship while you listen to music. Meaning that it will comment on everything you do, and probably talk you to death with uncontainable enthusiasm, so a &#8220;shh!&#8221; button is provided to minimize this. It&#8217;s cute. Exactly what I need! &#8230;Sometimes iTunes gets boring.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/nathalielawhead.com\/noodles\/1.png\" alt=\"\" \/><\/p>\n<p>The interesting part of this project has been finding a way to get all the common audio formats to work.<br \/>\nIt&#8217;s an AIR project, so you can imagine there are no &#8220;out of the box&#8221; solutions for things other than .mp3, mp4, and m4a (working with mp4 and m4a are nearly identical &#8212; <a href=\"http:\/\/www.adobe.com\/devnet\/flashplayer\/articles\/hd_video_flash_player.html\" target=\"_blank\">here&#8217;s an article on those<\/a>). My own requirements where to support .mp3, .wav, .m4a, .mp4, and .ogg.<\/p>\n<p>This uses no ANE&#8217;s. By all accounts this same thing could run in the browser, although there is no reason for that. Downloadable is funner in this case.<\/p>\n<p>There are a few <em>very<\/em> dated (old) resources from others that have gotten wav and ogg working. These where great starting points for me. You can check them out too and get a sense of what is required.<\/p>\n<p>For Wav:<br \/>\n<a href=\"https:\/\/code.google.com\/p\/as3wavsound\/\" target=\"_blank\">https:\/\/code.google.com\/p\/as3wavsound\/<\/a><\/p>\n<p>For Ogg:<br \/>\n<a href=\"http:\/\/labs.byhook.com\/2011\/02\/22\/ogg-vorbis-encoder-decoder-for-flash\/\" target=\"_blank\">http:\/\/labs.byhook.com\/2011\/02\/22\/ogg-vorbis-encoder-decoder-for-flash\/<\/a><br \/>\n<a href=\"http:\/\/stackoverflow.com\/questions\/24398307\/how-to-play-ogg-files-in-adobe-air-app\/24408472#24408472\" target=\"_blank\">http:\/\/stackoverflow.com\/questions\/24398307\/how-to-play-ogg-files-in-adobe-air-app\/24408472#24408472<\/a><\/p>\n<p>I have a nagging feeling that I really over complicated this and I&#8217;m missing some critical feature that does exist and would have made this easier, but hey&#8230; The above examples are interesting, and you can still prod around in them for educational purposes, which is always fun.<\/p>\n<p>There are other basic features in the UI. It&#8217;s more of a joke. You can play, stop, skip, and potato will extensively comment on everything. Potato never shuts up, so if you stop, it starts talking to itself. Of course looping a song, and moving it up\/down in the playlist is also provided.<br \/>\nThere&#8217;s a tiny little hidden feature (bottom right text icon) that will generate a random potato recipe for you, and save it to your desktop. This is the same thing as the <a href=\"http:\/\/gamejolt.com\/games\/electric-love-potato\/75231\" target=\"_blank\">original Electric Love Potato<\/a> but actually works in Windows (joke aside now). So this also involves food, not just music.<\/p>\n<p>To add a song you just drag whatever song (NativeDragEvent), from whatever folder, or location on your desktop, and drop it into the player. The player saves a reference to the File object (song) as a Shared Object. Unless you moved the audio files, it will keep playing them whenever you return.<br \/>\nIt has been ages since I really worked with SO&#8217;s. SO seemed the easiest\/quickest way of doing this. Unfortunately you can&#8217;t save multidimensional arrays, but you can save references to the original File object (sorry if I&#8217;m confusing words &#8212; speech dyslexia). It&#8217;s a lot more simple than I originally thoughts, so here. I am sharing the simple-ness with you:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">if<\/span><span style=\"color: #333333\">(<\/span>so_potatoplayer<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">data<\/span><span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">array<\/span> <span style=\"color: #333333\">!=<\/span> <span style=\"color: #008800; font-weight: bold\">undefined<\/span><span style=\"color: #333333\">){<\/span>\r\n\t<span style=\"color: #888888\">\/\/so_potatoplayer.data.array is the saved array of [object File]&#39;s from your last potato &quot;session&quot;<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold\">for<\/span><span style=\"color: #333333\">(<\/span><span style=\"color: #008800; font-weight: bold\">var<\/span> i:<span style=\"color: #333399; font-weight: bold\">Number<\/span> <span style=\"color: #333333\">=<\/span> <span style=\"color: #0000DD; font-weight: bold\">0<\/span><span style=\"color: #333333\">;<\/span> i<span style=\"color: #333333\">&lt;<\/span>so_potatoplayer<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">data<\/span><span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">array<\/span><span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">length<\/span><span style=\"color: #333333\">;<\/span> <span style=\"color: #333333\">++<\/span>i<span style=\"color: #333333\">){<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold\">var<\/span> urlStr:<span style=\"color: #333399; font-weight: bold\">String<\/span> <span style=\"color: #333333\">=<\/span> so_potatoplayer<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">data<\/span><span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">array<\/span><span style=\"color: #333333\">[<\/span>i<span style=\"color: #333333\">];<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold\">var<\/span> file:<span style=\"color: #333399; font-weight: bold\">File<\/span> <span style=\"color: #333333\">=<\/span> <span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #333399; font-weight: bold\">File<\/span><span style=\"color: #333333\">(<\/span>urlStr<span style=\"color: #333333\">);<\/span>\r\n\t\tarr_songs<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">push<\/span><span style=\"color: #333333\">(<\/span>file<span style=\"color: #333333\">);\/\/<\/span>re<span style=\"color: #333333\">-<\/span>populate song array <span style=\"color: #008800; font-weight: bold\">with<\/span> last values\r\n\t<span style=\"color: #333333\">}<\/span>\r\n\t<span style=\"color: #0066BB; font-weight: bold\">trace<\/span><span style=\"color: #333333\">(<\/span>arr_songs<span style=\"color: #333333\">);\/\/<\/span>that<span style=\"color: #FF0000; background-color: #FFAAAA\">&#39;<\/span>s it\r\n<span style=\"color: #333333\">};<\/span>\r\n<\/pre>\n<\/div>\n<p>Overall this was a really cute and refreshing break project. I think it&#8217;s also cool to have a super simple music player now. You know, I question software lately with how liberally your preferences, behavior, likes and dislikes are shared. I don&#8217;t know&#8230; The topic has been on my mind.<\/p>\n<p>At any rate&#8230; I know I&#8217;ll be using it, and enjoying the company of my potato friend. :)<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/nathalielawhead.com\/noodles\/LOADINGPLAYER.gif\" alt=\"\" \/><\/p>\n<p>Oh! P.S&#8230; Speaking of potatoware&#8230;<br \/>\nFor those interested, and on a MAC, you can also check out <a href=\"http:\/\/alienmelon.itch.io\/potatoware-cursor\" target=\"_blank\">Electric Love Potato: Potatoware Cursor<\/a>. It changes your desktops cursor to a potato, or some loading icon. It was created for practical joke purposes (or for those that want a potato cursor). It has successfully caused some amount of chaos. So that worked.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/nathalielawhead.com\/noodles\/potatowarecursor.png\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I&#8217;m here to make mention of my latest release: Electric Love Potato Playlist Player. You can download it from itch.io or Gamejolt: http:\/\/gamejolt.com\/games\/electric-love-potato-playlist-player\/110084 http:\/\/alienmelon.itch.io\/potato-playlist-player It&#8217;s available for MAC and Windows. It&#8217;s a small &#8220;take a break&#8221; project that I did (hoping to combat my current burnout and resulting depression). These things help. Just finish something TOTALLY different. My generators used to be that, but I&#8217;ve since graduated to potatoware. I loved this. It&#8217;s been really interesting because it&#8217;s a music player, and I&#8217;ve never *really* done that before. Like your typical Electric Love Potato this is a potato that&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":4522,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[4],"tags":[],"class_list":["post-3466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-werks"],"_links":{"self":[{"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/posts\/3466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/comments?post=3466"}],"version-history":[{"count":2,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/posts\/3466\/revisions"}],"predecessor-version":[{"id":3468,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/posts\/3466\/revisions\/3468"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/media\/4522"}],"wp:attachment":[{"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/media?parent=3466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/categories?post=3466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/tags?post=3466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}