App-MediaPi
view release on metacpan or search on metacpan
script/mediapi view on Meta::CPAN
my $pause_btn = $media_control_frame->new_ttk__button(-text => 'â¸', -style => 'Unicode.TButton',
-command => sub { send_cmd('pause') });
$pause_btn->g_grid(-column => 1, -row => 0, -sticky => 'nswe', -padx => 10, -pady => 10);
my $prev_btn = $media_control_frame->new_ttk__button(-text => 'â®', -style => 'Unicode.TButton',
-command => sub { send_cmd('prev') });
$prev_btn->g_grid(-column => 0, -row => 1, -sticky => 'nswe', -padx => 10, -pady => 10);
my $next_btn = $media_control_frame->new_ttk__button(-text => 'â', -style => 'Unicode.TButton',
-command => sub { send_cmd('next') });
$next_btn->g_grid(-column => 1, -row => 1, -sticky => 'nswe', -padx => 10, -pady => 10);
my $status_label = $media_control_frame->new_ttk__label(-textvariable => \$track_status, -anchor => 'center');
$status_label->g_grid(-column => 0, -columnspan => 2, -row => 2, -sticky => 'nswe');
# This remove the focus and "active" decoration of the button when they are selected.
# We might want some kind of feedback that they were selected though.
Tkx::bind('TButton', '<FocusIn>', [sub { $wnd->g_focus(); Tkx::widget->new($_[0])->state('!active'); }, Tkx::Ev('%W')]);
# The commands are documented at https://abyz.me.uk/rpi/pigpio/pigs.html
# For now we donât have a gpio for that as 18 is used by the I2S audio, we need
# to route another one to that pin on the screen.
# syswrite $pigpio, "w 18 1\n"; # Switch on the backlight of the screen.
( run in 0.272 second using v1.01-cache-2.11-cpan-a5abf4f5562 )