#!/usr/bin/perl use strict; use warnings; use lib "/root/vdr-1.3.28/config/plugins/perl/lib"; # TODO+ use VDR::Plugin; use VDR::Interface; use VDR::OsdMenu; use VDR::OsdItem; my $vdr = new VDR::Plugin; $vdr->set_parameter("Version", "0.0.1"); $vdr->set_parameter("Description", "Simple test script"); $vdr->set_parameter("MainMenuEntry", "use VDR;"); $vdr->register_callback("MainMenuAction", \&MainMenuAction); $vdr->run(); sub MainMenuAction { my $int = new VDR::Interface; # Display Message upon OSD $int->message("Are you absolutely sure?"); # Now wait up to 100 Seconds for keypress my $c = $int->readkey(100); if ($c == 3) { # 3 is kOk my @items; push @items, new VDR::OsdItem("Some valuable information here..."); push @items, new VDR::OsdItem("... and here..."); my $menu = new VDR::OsdMenu("use VDR;"); foreach (@items) { $menu->add($_); } return $menu; } # Display thank-you message $int->message("Well, okay then..."); # Wait two seconds (or less, if user presses a key) so the user can read # thank-you $int->readkey(2); }