App-Pimpd

 view release on metacpan or  search on metacpan

lib/App/Pimpd/Playlist.pm  view on Meta::CPAN


      printf("%19s %51.51s |@{[fg('bold', 'x')]}| %-47.47s\n",
        bg($c[4], $i), fg($c[5], fg('bold',  $artist)), $title);

    }
    else {
      printf("%4d %25.25s | | %-47.47s\n",
        $i, $artist, $title);
    }
    $i++;
  }
  return;
}

sub list_all_playlists {
  return wantarray()
    ? sort($mpd->collection->all_playlists)
    : scalar($mpd->collection->all_playlists)
    ;
}


1;

__END__


=pod

=head1 NAME

App::Pimpd::Playlist - Functions dealing with the current playlist

=head1 SYNOPSIS

    use App::Pimpd;
    use App::Pimpd::Playlist;

    add_playlist(@playlists);
    play_pos_from_playlist(42);

    queue(4, 12, 9, 18);

=head1 DESCRIPTION

App::Pimpd::Playlist provides functions playing with the current playlist

=head1 EXPORTS

=over

=item add_playlist()

  add_playlist('rock');

Parameters: @playlists

Tries hard to find valid, existing playlists based on input.
If a playlist doesn't exist, tries to match the strings against the existing
ones (using B<get_valid_lists()> from B<App::Pimpd::Validate>), presenting
the user with a prompt.

get_valid_lists() returns a list of valid playlists which we add to the current
playlist.

=item play_pos_from_playlist()

  play_pos_from_playlist(42);

Parameters: $playlist_pos

Play $playlist_pos in the current playlist.

=item queue()

  queue(42, 3, 9, 18, 12);

Parameters: @playlist_positions

Simulates a queue by turning random mode off and moving the supplied playlist
position IDs up in order.

=item show_playlist()

Show the current playlist.

=item songs_in_playlist()

Parameters: @playlists

Takes a list of existing playlists and prints the content.

=item list_all_playlists()

In list context, returns a list with known playlists.

In scalar context, returns the number of knows playlists.

=item add_to_playlist()

Parameters: @paths | \@paths

Adds the list of songs (paths) to the current playlist.

=item remove_album_from_playlist()

Parameters: $regex

Tries to remove all albums matching $regex from the current playlist.

=back

=head1 SEE ALSO

App::Pimpd

=head1 AUTHOR

  Magnus Woldrich
  CPAN ID: WOLDRICH
  magnus@trapd00r.se



( run in 0.520 second using v1.01-cache-2.11-cpan-6aa56a78535 )