Changeset 855


Ignore:
Timestamp:
Oct 5, 2009, 2:21:40 AM (11 years ago)
Author:
Bruno Cornec
Message:

Also test with CDDB protocol (http being not available today)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • projects/CDDBeditor/bin/CDDBeditor

    r847 r855  
    170170my %ce_config;
    171171$ce_config{"CDDB_HOST"}="freedb.freedb.org";
    172 $ce_config{"CDDB_PORT"}=80;
     172$ce_config{"CDDB_PORT"}=888;
     173#$ce_config{"CDDB_PORT"}=80;
    173174my %ce_cddb_mode;
    174 $ce_cddb_mode{"0"} = "http";
    175 $ce_cddb_mode{"1"} = "cddb";
    176 
    177 $ce_config{"CDDB_MODE"}=$ce_cddb_mode{"0"};
     175$ce_cddb_mode{"0"} = "cddb";
     176$ce_cddb_mode{"1"} = "http";
     177
     178$ce_config{"CDDB_MODE"}=$ce_cddb_mode{"1"};
    178179$ce_config{"CD_DEVICE"}="/dev/sr0";
    179180$ce_config{"HTTP_PROXY"}=$ENV{http_proxy} if $ENV{http_proxy};
     
    193194my $mode_group;
    194195my $proxy_entry = undef;
    195 if ($ce_config{"CDDB_MODE"} eq $ce_cddb_mode{"0"} ) {
    196     $mode_group = Newt::HRadiogroup($ce_cddb_mode{"0"}, $ce_cddb_mode{"1"});
     196$mode_group = Newt::HRadiogroup($ce_cddb_mode{"0"}, $ce_cddb_mode{"1"});
     197if ($ce_config{"CDDB_MODE"} eq "http" ) {
    197198    $proxy_entry = Newt::Entry($width, $flag, $ce_config{"HTTP_PROXY"});
    198 } else {
    199     $mode_group = Newt::HRadiogroup($ce_cddb_mode{"1"}, $ce_cddb_mode{"0"});
    200199}
    201200$width = 40;
     
    214213my $ce_panel = Newt::Panel(2, 20, "CDDBeditor Configuration");
    215214my $flage = NEWT_ANCHOR_RIGHT;
    216 $ce_panel->Add(0, 0, $host_label,$flage);
     215$ce_panel->Add(0, 0, $host_label, $flage);
    217216$flage = NEWT_ANCHOR_LEFT;
    218217$ce_panel->Add(1, 0, $host_entry, $flage);
    219218$flage = NEWT_ANCHOR_RIGHT;
    220 $ce_panel->Add(0, 1, $port_label,$flage);
     219$ce_panel->Add(0, 1, $port_label, $flage);
    221220$flage = NEWT_ANCHOR_LEFT;
    222221$ce_panel->Add(1, 1, $port_entry, $flage);
    223222$flage = NEWT_ANCHOR_RIGHT;
    224 $ce_panel->Add(0, 2, $mode_label,$flage);
     223$ce_panel->Add(0, 2, $mode_label, $flage);
    225224$flage = NEWT_ANCHOR_LEFT;
    226225$ce_panel->Add(1, 2, $mode_group, $flage);
     226if ($ce_config{"CDDB_MODE"} eq "http" ) {
     227    $flage = NEWT_ANCHOR_RIGHT;
     228    $ce_panel->Add(0, 3, $proxy_label, $flage);
     229    $flage = NEWT_ANCHOR_LEFT;
     230    $ce_panel->Add(1, 3, $proxy_entry, $flage);
     231    }
    227232$flage = NEWT_ANCHOR_RIGHT;
    228 $ce_panel->Add(0, 3, $proxy_label,$flage);
    229 $flage = NEWT_ANCHOR_LEFT;
    230 $ce_panel->Add(1, 3, $proxy_entry, $flage);
    231 $flage = NEWT_ANCHOR_RIGHT;
    232 $ce_panel->Add(0, 4, $dev_label,$flage);
     233$ce_panel->Add(0, 4, $dev_label, $flage);
    233234$flage = NEWT_ANCHOR_LEFT;
    234235$ce_panel->Add(1, 4, $dev_entry, $flage);
    235236$flage = NEWT_ANCHOR_RIGHT;
    236 $ce_panel->Add(0, 5, $user_label,$flage);
     237$ce_panel->Add(0, 5, $user_label, $flage);
    237238$flage = NEWT_ANCHOR_LEFT;
    238239$ce_panel->Add(1, 5, $user_group, $flage);
     
    247248exit 0 if ($data->Tag() eq "Quit");
    248249
     250if ($ce_config{"CDDB_MODE"} eq "http" ) {
     251    $ce_config{"HTTP_PROXY"}=$proxy_entry->Get();
     252    }
    249253$ce_config{"CDDB_HOST"}=$host_entry->Get();
    250254$ce_config{"CDDB_PORT"}=$port_entry->Get();
    251255$ce_config{"CDDB_MODE"}=$ce_cddb_mode{$mode_group->Get()};
    252256$ce_config{"CD_DEVICE"}=$dev_entry->Get();
    253 $ce_config{"HTTP_PROXY"}=$proxy_entry->Get();
    254257$ce_config{"input"}=$user_group->Get();
     258$ce_config{"HELLO_ID"} = "bruno musique-ancienne.org fastrip 0.77";
    255259
    256260# Components
     
    288292    my $artist_entry = Newt::Entry($width, $flag, $ce_cd{artist});
    289293    my $title_entry = Newt::Entry($width, $flag, $ce_cd{title});
     294    # http://www.freedb.org/en/faq.3.html
     295    # Category list is data, folk, jazz, misc, rock, country, blues, newage, reggae, classical, and soundtrack
    290296    my $category_entry = Newt::Entry($width, $flag, $ce_cd{cat});
    291297    my $genre_entry = Newt::Entry($width, $flag, $ce_cd{genre});
Note: See TracChangeset for help on using the changeset viewer.