MediaMonkey Setlist.fm Playlist Creator Script

I’m going to the Forbidden Fruit music festival this weekend and for all gigs I like to do ‘homework’ on the bands and what sets they’re likely to play. That sounds like working to have fun but concerts are always better when you know the songs!

MediaMonkey is my music player of choice; one of the reasons being its powerful scripting functionality. So creating playlists from setlist.fm got boring enough that I decided to hack together a MediaMonkey script, extension, addon, plugin or whatever you want to call it to do it for me. Luckily most of the work was done for me and I just had to adapt the Last.fm Loved Tracks Playlist Creator from psykar so 99% of the code is thanks to him.

Install the MMIP below and go to Tools -> Scripts -> Setlist FM Playlist Creator and enter a setlist URL like this one: http://www.setlist.fm/setlist/cut-copy/2011/the-button-factory-dublin-ireland-13d1b5a1.html. A playlist should be created in this format: [Setlist] ArtistName – CityName (EventDate). A message will pop up if some songs weren’t found. Future upgrades of the script might tell you what album these missing songs are on. Download the MMIP below:

Download MediaMonkey Setlist.fm Playlist Creator 1.0 MMIP

Make sure to have MediaMonkey running in administrator mode or you’ll get a “Product installation error”. For any other errors or feature requests, post as a comment below. If you like this script and it saves you time, please post a comment below telling me you use it. It’s disheartening to bother with something when you think nobody uses it!

Automatically generate Android boilerplate code from Layout XML

Java has a bit of a reputation for being too verbose which is a common stick for haters to beat it with. But as Bjarne Stroustrup says “There are only two kinds of languages: the ones people complain about and the ones nobody uses”.

But it’s a valid criticism so you want your IDE to generate the boring code for you which is where the Lazy Android Eclipse plugin from Ryan Mattison comes in. After you install it you right click on any Android Layout and select Fast Layout -> Generate Activity. It’s then supposed to write code into your class in focus but it only pastes to the clipboard for me where I can easily use in my activites of course.

So here’s my original layout XML:


<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <LinearLayout
         android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        >
    <RadioGroup
      android:layout_width="fill_parent"
      android:id="@+id/radio_type"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:orientation="horizontal"
      android:layout_marginBottom="10dp">
      <RadioButton android:id="@+id/radio_car"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:checked="true"
          android:text="Car" />
      <RadioButton android:id="@+id/radio_motorcycle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Motorcycle" />
      <RadioButton android:id="@+id/radio_truck"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:checked="true"
          android:text="Truck" />
      <RadioButton android:id="@+id/radio_bus"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Bus/Coach" />
    </RadioGroup>
    </LinearLayout>
    </ScrollView>

And here’s the code it generated:

 /**********DECLARES*************/
      private RadioGroup radio_type;
      private RadioButton radio_car;
      private RadioButton radio_motorcycle;
      private RadioButton radio_truck;
      private RadioButton radio_bus;
      /**********INITIALIZES*************/
      radio_type = (RadioGroup) findViewById(R.id.radio_type);
      radio_car = (RadioButton) findViewById(R.id.radio_car);
      radio_motorcycle = (RadioButton) findViewById(R.id.radio_motorcycle);
      radio_truck = (RadioButton) findViewById(R.id.radio_truck);
      radio_bus = (RadioButton) findViewById(R.id.radio_bus);
      /* Please visit http://www.ryangmattison.com for updates */

Very handy. Get the plugin here.