root/trunk/plagger/lib/Plagger/Plugin/Notify/Audio/iTunesMac.pm
| Revision 1403 (checked in by miyagawa, 2 years ago) |
|---|
| Line | |
|---|---|
| 1 | package Plagger::Plugin::Notify::Audio::iTunesMac; |
| 2 | use strict; |
| 3 | use base qw( Plagger::Plugin::Notify::Audio); |
| 4 | |
| 5 | use Mac::iTunes; |
| 6 | |
| 7 | sub play { |
| 8 | my($self, $filename, $length) = @_; |
| 9 | |
| 10 | my $playlist = ref $self; |
| 11 | my $itunes = Mac::iTunes->controller; |
| 12 | |
| 13 | $itunes->delete_playlist($playlist); |
| 14 | $itunes->add_track($filename, $playlist); |
| 15 | $itunes->play_track(1, $playlist); |
| 16 | sleep $length; |
| 17 | } |
| 18 | |
| 19 | 1; |
Note: See TracBrowser for help on using the browser.
