|
Revision 1400
(checked in by miyagawa, 2 years ago)
|
Notify::Audio: Added a dirty hack to get seconds. Will make it a separate plugin later.
|
| Line | |
|---|
| 1 |
package Plagger::Plugin::Notify::Audio::iTunesWin32; |
|---|
| 2 |
use strict; |
|---|
| 3 |
use base qw( Plagger::Plugin::Notify::Audio ); |
|---|
| 4 |
|
|---|
| 5 |
use Win32::OLE; |
|---|
| 6 |
|
|---|
| 7 |
sub play { |
|---|
| 8 |
my($self, $filename, $length) = @_; |
|---|
| 9 |
$filename or return $self->log(error => "filename is not set"); |
|---|
| 10 |
|
|---|
| 11 |
my $itunes = Win32::OLE->new("iTunes.Application"); |
|---|
| 12 |
$itunes->PlayFile($filename); |
|---|
| 13 |
sleep $length; |
|---|
| 14 |
} |
|---|
| 15 |
|
|---|
| 16 |
1; |
|---|