simple
来自「用perl和gtk+写的调用mplayer播放电视的软件」· 代码 · 共 61 行
TXT
61 行
#!/usr/bin/perl -wuse strict;use FindBin;use lib "$FindBin::RealBin/../lib";use MPlayer;use LWP::Simple;if (! -e "opensource.ogg") { print "Downloading http://download.linuxtag.org/music/ogg/opensource.ogg (3.6 MB)\n "; my $content = get("http://download.linuxtag.org/music/ogg/opensource.ogg"); print "Finished\n"; open F, ">opensource.ogg" or die "Can't create file opensource.ogg: $!\n"; print F $content; close F;}print "Playing opensource.ogg\n";my $mp = new MPlayer("./opensource.ogg");print "Playing 10 seconds\n";sleep 10;print "Muting\n";$mp->mute();sleep 5;print "Back again\n";$mp->mute();sleep 10;print "Pausing\n";$mp->pause();sleep 5;print "Back again\n";$mp->pause();sleep 10;print "Decreasing volume\n";for (1..30) { $mp->volume("-1"); sleep 1;}print "Increasing volume\n";for (1..30) { $mp->volume("+1"); sleep 1;}sleep 5;print "Exiting\n";$mp->quit();print "Printing errors\n";my @error = $mp->error;print join "\n", @error;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?