From b51c611467177f8d0e23ae8f871ec11e88392424 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 6 Feb 2016 18:01:34 +0000 Subject: [PATCH] Reindent everything --- lib/App/XMMS2/Notifier.pm | 48 +++++++++++++++++++-------------------- t/test.t | 4 ++-- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/App/XMMS2/Notifier.pm b/lib/App/XMMS2/Notifier.pm index 3e3183d..b0a2f44 100644 --- a/lib/App/XMMS2/Notifier.pm +++ b/lib/App/XMMS2/Notifier.pm @@ -18,9 +18,9 @@ my $use_libpurple; my $format = '$artist - $title'; GetOptions ( - "libnotify!" => \$use_libnotify, - "libpurple!" => \$use_libpurple, - "format=s" => \$format, + "libnotify!" => \$use_libnotify, + "libpurple!" => \$use_libpurple, + "format=s" => \$format, ); my $xmms = Audio::XMMSClient->new('xmms2-notifyd'); @@ -31,41 +31,41 @@ $notify->set_timeout(3000); ################################################## sub notify_libnotify{ - $notify->update($_[0]); - $notify->show; + $notify->update($_[0]); + $notify->show; } sub notify{ - my $id=$xmms->playback_current_id->wait->value or return; - my $minfo=$xmms->medialib_get_info($id)->wait->value; + my $id=$xmms->playback_current_id->wait->value or return; + my $minfo=$xmms->medialib_get_info($id)->wait->value; - my %metadata = map { $_ => exists $minfo->{$_} ? (values $minfo->{$_})[0] : undef } CONVERSION_SPECIFIERS; - my $str=$format; - $str =~ s/\$$_/$metadata{$_}/g for keys %metadata; + my %metadata = map { $_ => exists $minfo->{$_} ? (values $minfo->{$_})[0] : undef } CONVERSION_SPECIFIERS; + my $str=$format; + $str =~ s/\$$_/$metadata{$_}/g for keys %metadata; - notify_libnotify $str if $use_libnotify; -# notify_libpurple $str if $use_libpurple; + notify_libnotify $str if $use_libnotify; + # notify_libpurple $str if $use_libpurple; } sub on_playback_current_id { - notify; - $xmms->broadcast_playback_current_id->notifier_set(\&on_playback_current_id); + notify; + $xmms->broadcast_playback_current_id->notifier_set(\&on_playback_current_id); } sub on_playback_status { - notify if $xmms->playback_status->wait->value == 1; # 1 means playing, 2 means paused - $xmms->broadcast_playback_status->notifier_set(\&on_playback_status); + notify if $xmms->playback_status->wait->value == 1; # 1 means playing, 2 means paused + $xmms->broadcast_playback_status->notifier_set(\&on_playback_status); } sub run { - while(1){ - last if ($xmms->connect); - sleep 1 - } - - $xmms->broadcast_playback_current_id->notifier_set(\&on_playback_current_id); - $xmms->broadcast_playback_status->notifier_set(\&on_playback_status); - $xmms->loop + while (1) { + last if ($xmms->connect); + sleep 1 + } + + $xmms->broadcast_playback_current_id->notifier_set(\&on_playback_current_id); + $xmms->broadcast_playback_status->notifier_set(\&on_playback_status); + $xmms->loop } 1 diff --git a/t/test.t b/t/test.t index 1d2c8a5..5f945bc 100644 --- a/t/test.t +++ b/t/test.t @@ -9,6 +9,6 @@ BEGIN { use_ok('App::XMMS2::Notifier') }; can_ok('App::XMMS2::Notifier', qw/run notify_libnotify/); TODO: { - local $TODO = 'libpurple notify not written yet'; - can_ok('App::XMMS2::Notifier', 'notify_libpurple'); + local $TODO = 'libpurple notify not written yet'; + can_ok('App::XMMS2::Notifier', 'notify_libpurple'); } -- 2.39.2