wesrog / last.fm-tagger

A simple RubyCocoa app that writes popular last.fm tags as genres to your iTunes library.

This URL has Read+Write access

last.fm-tagger / PlaylistsController.rb
983cdd7c » wesrog 2008-07-05 first commit 1 #
2 # PlaylistsArray.rb
f8136043 » wesrog 2008-08-20 added new features 3 # last.fm-tagger
983cdd7c » wesrog 2008-07-05 first commit 4 #
5 # Created by Wes Rogers on 7/5/08.
6 # Copyright (c) 2008 633k.net. All rights reserved.
7 #
8
9 class PlaylistsController < NSArrayController
10 ib_outlets :playlistsPopUp
f8136043 » wesrog 2008-08-20 added new features 11 ib_action :reloadPlaylists
983cdd7c » wesrog 2008-07-05 first commit 12
13 def initialize
14 @iTunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")
15 end
16
17 def awakeFromNib
8cdcd413 » wesrog 2008-07-06 added some failsafes for sm... 18 @playlistsPopUp.addItemsWithTitles(@iTunes.sources.first.userPlaylists.reject { |p| p.smart == 1 }.map { |p| p.name })
983cdd7c » wesrog 2008-07-05 first commit 19 end
f8136043 » wesrog 2008-08-20 added new features 20
21 def reloadPlaylists
9e2266dc » wesrog 2008-08-20 UI enhancements 22 @playlistsPopUp.removeAllItems
f8136043 » wesrog 2008-08-20 added new features 23 @playlistsPopUp.addItemsWithTitles(@iTunes.sources.first.userPlaylists.reject { |p| p.smart == 1 }.map { |p| p.name })
24 end
983cdd7c » wesrog 2008-07-05 first commit 25 end