source: flacrip/trunk/burnlist @ 1

Last change on this file since 1 was 1, checked in by peter, 12 years ago

initial import of current flacrip files into the trunk

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/usr/bin/perl -w
2use strict;
3
4use Gtk2 -init;
5use Gtk2::Ex::Simple::List;
6use Audio::FLAC::Header;
7use File::Spec::Functions qw{catfile};
8
9my $directory = '/home/peter/cds';
10
11my $window = Gtk2::Window->new;
12$window->signal_connect(destroy => sub { Gtk2->main_quit });
13
14my $vbox = Gtk2::VBox->new;
15
16my $list = Gtk2::Ex::Simple::List->new(
17    'Artist' => 'text',
18    'Album' => 'text',
19    'Filename' => 'text',
20);
21
22my $scrollbox = Gtk2::ScrolledWindow->new();
23$scrollbox->add_with_viewport($list);
24#$vbox->add($list);
25
26
27opendir FLAC_DIR, $directory;
28while (my $file = readdir(FLAC_DIR)) {
29    next unless $file =~ /\.flac$/;
30    my $flac = Audio::FLAC::Header->new(catfile($directory, $file));
31    my $tags = $flac->tags;
32    push @{ $list->{data} }, [
33        $tags->{ARTIST} || '[No Artist]', 
34        $tags->{ALBUM} || '[No Title]',
35        $file
36    ];
37}
38
39$list->signal_connect(row_activated => sub {
40    my ($list, $path, $column) = @_;
41    my $filename = $list->{data}[$path->to_string][2];
42    #TODO: burn flac file
43});
44
45$window->add($scrollbox);
46$window->set_default_size(600, 400);
47$window->show_all;
48Gtk2->main;
Note: See TracBrowser for help on using the repository browser.