📄 mplayertv
字号:
$help = $filter->{help} if defined ($filter->{help}); print "\n*** video filter name: $name\n" if ($verbose_level >= 2); $self->{"vf_page$i"} = new Gtk2::VBox (0, 5); $self->{"vf_page$i"}->set_border_width (5); $self->{vf_notebook}->append_page ($self->{"vf_page$i"}, $desc); $self->{"vf_table$i"} = new Gtk2::Table (2, $#params + 1, 0); $self->{"vf_page" . $i . "top"} = new Gtk2::Table (2, 1, 0); $self->{"vf_page$i"}->pack_start ($self->{"vf_page$i" . "top"}, 0, 1, 0); $self->{"vf_" . $name . "_check"} = new Gtk2::CheckButton ("Activate this filter"); $self->{tooltips}->set_tip ($self->{"vf_" . $name . "_check"}, $filter->{longdesc} . " ($name)"); $self->{"vf_" . $name . "_check"}->set_active ($self->{config}->{"vf_$name"} eq "yes"); $self->{"vf_page" . $i . "top"}->attach ($self->{"vf_" . $name . "_check"}, 0, 1, 0, 1, ['fill', 'expand'], [], 2, 2); if (defined $help) { $self->{"vf_" . $name . "_help_btn"} = Gtk2::Button->new_from_stock ("help"); $self->{tooltips}->set_tip ($self->{"vf_" . $name . "_help_btn"}, "Brief help"); $self->{"vf_page" . $i . "top"}->attach ($self->{"vf_" . $name . "_help_btn"}, 1, 2, 0, 1, ['fill'], [], 2, 2); $self->{"vf_" . $name . "_help_btn"}->signal_connect ("clicked", sub { my ($button, $self) = @_; my $dialog = new Gtk2::MessageDialog ($self->{window}, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "$longdesc\n\n$help" ); $dialog->run; $dialog->destroy; }, $self); } if ($#params + 1 > 0 || $name eq "pp") { $self->{"vf_" . $name . "_label"} = new Gtk2::Label ("Filter options"); $self->{"vf_" . $name . "_label"}->set_alignment (0, 0); $self->{"vf_page$i"}->pack_start ($self->{"vf_" . $name . "_label"}, 0, 0, 0); } $self->{"vf_page$i"}->pack_start ($self->{"vf_table$i"}, 0, 0, 5); if ($name eq "pp") { my $j = 1; foreach $filter (@pp_filters) { my $code = $filter; $code =~ s/^.*\((\w+)\).*$/$1/; $filter =~ /^(.*)\(\w+\)/; $self->{"vf_pp_" . $code . "_check"} = new Gtk2::CheckButton ($1); $self->{"vf_pp_" . $code . "_check"}->set_active ($self->{config}->{"vf_pp_" . $code} eq "yes"); $self->{"vf_pp_" . $code . "_check"}->signal_connect ("button_press_event", \&vf_pp_button_press_event); $self->{tooltips}->set_tip ($self->{"vf_pp_" . $code . "_check"}, "$code filter, right click: pop-up menu"); $self->{"vf_table$i"}->attach ($self->{"vf_pp_" . $code . "_check"}, 0, 2, $j, $j + 1, ['fill'], [], 2, 0); $self->{"vf_pp_" . $code . "_check"}->{auto_off} = ($self->{config}->{"vf_pp_" . $code . "_a"} eq "yes"); $self->{"vf_pp_" . $code . "_check"}->{chroma} = ($self->{config}->{"vf_pp_" . $code . "_c"} eq "yes"); $self->{"vf_pp_" . $code . "_check"}->{code} = $code; $j++; } $self->{vf_pp_autoq_check} = new Gtk2::CheckButton ("Auto quality"); $self->{vf_pp_autoq_check}->set_active ($self->{config}->{vf_pp_autoq} eq "yes"); $self->{"vf_table$i"}->attach ($self->{vf_pp_autoq_check}, 0, 1, $j, $j + 1, ['fill'], [], 2, 0); $self->{vf_pp_autoq_level_ent} = new Gtk2::Entry; $self->{vf_pp_autoq_level_ent}->set_text ($self->{config}->{vf_pp_autoq_level}); $self->{vf_pp_autoq_level_ent}->set_size_request (10, -1); $self->{"vf_table$i"}->attach ($self->{vf_pp_autoq_level_ent}, 1, 2, $j, $j + 1, ['fill'], [], 2, 0); } else { my $j = 1; foreach $param (@params) { print "$param\n" if ($verbose_level >= 2); if ($param =~ /^(\w+)\s+(Integer|Float|Flag)\s+([-+\w\d.]+\.\.[-+\w\d.]+)/) { #if ($param =~ /^(\w+)\s+(Integer)\s+([-+\w\d]+\.\.[-+\w\d]+)/ || # $param =~ /^(\w+)\s+(Float)\s+([-+\w\d.]+\.\.[-+\w\d.]+)/ || # $param =~ /^(\w+)\s+(Flag)\s+([-+\w\d.]+\.\.[-+\w\d.]+)/ # ) { my $param_name = $1; my $param_type = $2; my $param_range = $3; my $param_default = undef; if ($param =~ /^(\w+)\s+(\w+)\s+([-+\w\d.]+\.\.[-+\w\d.]+)\s+([-+\w\d.]+)/) { $param_default = $4; } my $code = "vf_" . $name . "_" . $param_name; my $label = $param_name; $label =~ s/_/ /g; $self->{$code . "_label"} = new Gtk2::Label ($label); $self->{$code . "_label"}->set_size_request (120, -1); $self->{$code . "_label"}->set_alignment (0.95, 0); $self->{"vf_table$i"}->attach ($self->{$code . "_label"}, 0, 1, $j, $j + 1, ['fill'], [], 2, 2); if ($param_type eq "Integer" || $param_type eq "Float") { $self->{$code . "_ent"} = new Gtk2::Entry (); $self->{$code . "_ent"}->set_size_request (80, -1); $self->{$code . "_ent"}->set_text ($self->{config}->{$code}); my $tip = "Type: $param_type\nRange: $param_range"; $tip .= "\nDefault: $param_default" if (defined ($param_default)); $self->{tooltips}->set_tip ($self->{$code . "_ent"}, $tip); $self->{"vf_table$i"}->attach ($self->{$code . "_ent"}, 1, 2, $j, $j + 1, ['fill'], [], 2, 2); } if ($param_type eq "Flag") { $self->{$code . "_option"} = new Gtk2::OptionMenu; $self->{$code . "_menu"} = new Gtk2::Menu; $self->{$code . "_option"}->set_menu ($self->{$code . "_menu"}); $self->{$code . "_option"}->set_size_request (80, -1); $self->{$code . "_option"}->set_history (0); my $k = 0; foreach ("No", "Yes") { my $item = new Gtk2::MenuItem($_); $item->{label} = $_; $self->{$code . "_menu"}->append($item); $self->{$code . "_option"}->set_history ($k) if ($k eq $self->{config}->{$code}); $k++; } $self->{"vf_table$i"}->attach ($self->{$code . "_option"}, 1, 2, $j, $j + 1, ['fill'], [], 2, 2); } } else { print "*** [mplayerTV] Internal error: Invalid parameter: $param\n"; } $j++; } } $i++; } ### PAGE 5: AUDIO $self->{table5} = new Gtk2::Table (8, 3, 0); $self->{page5}->pack_start ($self->{table5}, 1, 1, 0); $self->{ao_drivers_label} = new Gtk2::Label ("Audio output driver:"); $self->{ao_drivers_label}->set_alignment (0, 0); $self->{table5}->attach ($self->{ao_drivers_label}, 0, 1, 0, 1, ['fill'], [], 2, 2); $self->{ao_drivers_option} = new Gtk2::OptionMenu; $self->{ao_drivers_menu} = new Gtk2::Menu; $self->{ao_drivers_option}->set_menu($self->{ao_drivers_menu}); $self->{ao_drivers_option}->set_history(0); $self->update_ao_drivers_list (); $self->{table5}->attach ($self->{ao_drivers_option}, 1, 2, 0, 1, ['fill', 'expand'], [], 2, 2); #$self->{ao_update_btn} = new Gtk2::Button ("_Update"); #$self->{ao_update_btn}->signal_connect ("clicked", sub { update_ao_drivers_list ($self)}); #$self->{tooltips}->set_tip ($self->{ao_update_btn}, "Runs mplayer and fetch audio output drivers list"); #$self->{ao_update_btn}->set_size_request (60, -1); #$self->{table5}->attach ($self->{ao_update_btn}, 2, 3, 0, 1, ['fill'], [], 2, 2); $self->{ao_subdriver_label} = new Gtk2::Label ("Audio output subdriver:"); $self->{ao_subdriver_label}->set_alignment (0, 0); $self->{ao_subdriver_ent} = new Gtk2::Entry (); $self->{ao_subdriver_ent}->set_size_request (100, -1); $self->{ao_subdriver_ent}->set_text ($self->{config}->{subao}); $self->{table5}->attach ($self->{ao_subdriver_label}, 0, 1, 1, 2, ['fill'], [], 2, 2); $self->{table5}->attach ($self->{ao_subdriver_ent}, 1, 2, 1, 2, ['fill'], [], 2, 2); #$self->{captalsa_check} = new Gtk2::CheckButton ("Capture from alsa"); #$self->{captalsa_check}->set_active ($self->{config}->{captalsa} eq "yes"); #$self->{table5}->attach ($self->{captalsa_check}, 0, 1, 2, 3, ['fill'], [], 2, 0); $self->{adevice_label} = new Gtk2::Label ("Audio device:"); $self->{adevice_label}->set_alignment (0, 0); $self->{adevice_ent} = new Gtk2::Entry (); $self->{adevice_ent}->set_size_request (100, -1); $self->{adevice_ent}->set_text ($self->{config}->{adevice}); $self->{table5}->attach ($self->{adevice_label}, 0, 1, 2, 3, ['fill'], [], 2, 2); $self->{table5}->attach ($self->{adevice_ent}, 1, 2, 2, 3, ['fill'], [], 2, 2); $self->{amode_label} = new Gtk2::Label ("Audio mode:"); $self->{amode_label}->set_alignment (0, 0); $self->{table5}->attach ($self->{amode_label}, 0, 1, 3, 4, ['fill'], [], 2, 2); $self->{amode_option} = new Gtk2::OptionMenu; $self->{amode_menu} = new Gtk2::Menu; $self->{amode_option}->set_menu ($self->{amode_menu}); $self->{amode_option}->set_size_request (100, -1); $self->{amode_option}->set_history (0); $i = 0; foreach ("Mono", "Stereo", "Language 1", "Language 2", "Disabled") { my $item = new Gtk2::MenuItem($_); $item->{label} = $_; $self->{amode_menu}->append ($item); $self->{amode_option}->set_history ($i) if ($i == $self->{config}->{amode}); $i++; } $self->{table5}->attach ($self->{amode_option}, 1, 2, 3, 4, ['fill'], [], 2, 2); $self->{amixer_device_label} = new Gtk2::Label ("Audio mixer device:"); $self->{amixer_device_label}->set_alignment (0, 0); $self->{table5}->attach ($self->{amixer_device_label}, 0, 1, 4, 5, ['fill'], [], 2, 2); $self->{amixer_device_ent} = new Gtk2::Entry (); $self->{amixer_device_ent}->set_size_request (100, -1); $self->{amixer_device_ent}->set_text ($self->{config}->{amixer_device}); $self->{table5}->attach ($self->{amixer_device_ent}, 1, 2, 4, 5, ['fill'], [], 2, 2); $self->{amixer_channel_label} = new Gtk2::Label ("Audio mixer channel:"); $self->{amixer_channel_label}->set_alignment (0, 0); $self->{table5}->attach ($self->{amixer_channel_label}, 0, 1, 5, 6, ['fill'], [], 2, 2); $self->{amixer_channel_option} = new Gtk2::OptionMenu; $self->{amixer_channel_menu} = new Gtk2::Menu; $self->{amixer_channel_option}->set_menu ($self->{amixer_channel_menu}); $self->{amixer_channel_option}->set_size_request (100, -1); $self->{amixer_channel_option}->set_history (0); $i = 0; foreach ("vol", "pcm", "pcm2", "line", "line1","line2", "line3", "mic", "igain", "ogain", "video", "radio") { my $item = new Gtk2::MenuItem($_); $item->{label} = $_; $self->{amixer_channel_menu}->append ($item); $self->{amixer_channel_option}->set_history ($i) if ($_ eq $self->{config}->{amixer_channel}); $i++; } $self->{table5}->attach ($self->{amixer_channel_option}, 1, 2, 5, 6, ['fill'], [], 2, 2); $self->{extvolume_check} = new Gtk2::CheckButton ("Enable external volume control program"); $self->{extvolume_check}->set_size_request (100, -1); if ($self->{config}->{extvolume} eq "yes") { $self->{extvolume_check}->set_active (1); } $self->{table5}->attach ($self->{extvolume_check}, 0, 3, 6, 7, ['fill'], [], 2, 2); $self->{extvolume_label} = new Gtk2::Label ("Volume control prog:"); $self->{extvolume_label}->set_alignment (0, 0); $self->{extvolume_ent} = new Gtk2::Entry (); $self->{extvolume_ent}->set_size_request (100, -1); $self->{extvolume_ent}->set_text ($self->{config}->{extvolume_program}); $self->{table5}->attach ($self->{extvolume_label}, 0, 1, 7, 8, ['fill'], [], 2, 2); $self->{table5}->attach ($self->{extvolume_ent}, 1, 2, 7, 8, ['fill'], [], 2, 2); $self->{extvolume_option} = new Gtk2::OptionMenu; $self->{extvolume_menu} = new Gtk2::Menu; $self->{extvolume_option}->set_menu ($self->{extvolume_menu}); $self->{extvolume_option}->set_size_request (60, -1); $self->{extvolume_option}->set_history (0); #$i = 0; foreach ("aumix", "ALSA") { my $item = new Gtk2::MenuItem($_); $item->{label} = $_; $item->signal_connect("activate", sub { $self->{extvolume_ent}->set_text ('aumix -l%s%d') if ($_[1] eq "aumix"); $self->{extvolume_ent}->set_text ('amixer set Line %d%%s') if ($_[1] eq "ALSA"); }, $_); $self->{extvolume_menu}->append ($item); #$self->{extvolume_option}->set_history ($i) if ($i == $self->{config}->{amode}); #$i++; } $self->{table5}->attach ($self->{extvolume_option}, 2, 3, 7, 8, ['fill', 'expand'], [], 2, 2); $self->{usbaudio_check} = new Gtk2::CheckButton ("Enable USB audio capturing"); $self->{usbaudio_check}->set_size_request (100, -1); $self->{tooltips}->set_tip ($self->{usbaudio_check}, "Captures sound of the USB tuner using sox program"); if ($self->{config}->{usbaudio} eq "yes") { $self->{usbaudio_check}->set_active (1); } $self->{table5}->attach ($self->{usbaudio_check}, 0, 3, 8, 9, ['fill'], [], 2, 2); $self->{usbaudio_label} = new Gtk2::Label ("USB audio device:"); $self->{usbaudio_label}->set_alignment (0, 0); $self->{usbaudio_ent} = new Gtk2::Entry (); $self->{usbaudio_ent}->set_size_request (100, -1); $self->{usbaudio_ent}->set_text ($self->{config}->{usbaudio_device}); $self->{table5}->attach ($self->{usbaudio_label}, 0, 1, 9, 10, ['fill'], [], 2, 2); $self->{table5}->attach ($self->{usbaudio_ent}, 1, 2, 9, 10, ['fill'], [], 2, 2); ### PAGE 6: AUDIO FILTERS #$self->{table6} = new Gtk2::Table (3, 3, 0); #$self->{page6}->pack_start ($self->{table6}, 1, 1, 0); # TODO audio filters ### DIALOG BUTTONS ### $self->{save_btn} = Gtk2::Button->new_from_stock ("save"); $self->{cancel_btn} = Gtk2::Button->new_from_stock ("cancel"); $self->{save_btn}->signal_connect ("clicked", \&SaveBtn, $self); $self->{cancel_btn}->signal_connect ("clicked", \&CancelBtn, $self); $self->{dialog}->signal_connect ("delete_event", \&CancelBtn, $self); $self->{dialog}->action_area->pack_start ($self->{save_btn}, TRUE, TRUE, 5); $self->{dialog}->action_area->pack_start ($self->{cancel_btn}, TRUE, TRUE, 5); ### ETC $self->{dialog}->set_border_width (5); $self->{dialog}->set_title ("Configure"); return $self;}sub get_vo_drivers{ my ($self) = @_; my @vo_drivers; my $prg = $mplayer_path; $prg .= " -vo help"; print "*** [mplayerTV] Running: $prg\n" if ($verbose_level >= 1); @output = `$prg`; print "\n", @output, "\n" if ($verbose_level >= 2); foreach $line (@output) { if ($line =~ /^\s+(\w+)\s+/) { push @vo_drivers, $1; } } if ($#vo_drivers <= 1) { push @vo_drivers, "null";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -