info-beamer

Documentation on creating Scheduled Player Plugins

Hello,

Would you have a link to documentation on how to create Scheduled Player Plugins?

I would like to create a plugin to manage recurring schedules. Lets say you have a dance/music school and you want to show the courses of the day. Every Monday you will have exactly the same courses, so you would just need to create a schedule for 1 week. It´s similar to Fraab but not linked to an event and ideally easier to create the schedule.

Best Regards,
Adrián

You don’t need a plugin for that. Instead, within a “Scheduled Player” setup, create multiple playlists. Each of them has its own schedule. In your case you can create one playlist for each day and add your daily content to each of them.

  1. Click on Add Scheduled Playlist
  2. Maybe name each of them
  3. Click on Schedule
  4. Select “Hour based”
  5. Click on Never and then the row name (for example on Monday), to select all hours within Monday.
  6. Repeat for each day.

Does that help?

Hello,

It´s a nice workaround that I already though about, but it´s complicated to manage I think. You would have many playlists and many pages if you want to show only the next classes (hiding past ones). The idea to have a single schedule to manage Fraab-like is easier. In the old version of info-beamer where all these plugins didn´t exist I did modify an old example in git to do exactly this.

I think it´s something that could be interesting for many businesses (schools of any type) but in any case, if you have some updated documentations on what is expected when writing a plugin I would be more than glad. I would fork the repo modify it and, if I manage to do something nice, share it with you.

Thanks for your help in any case.

Right now there’s no documentation on how everything works, but you can take a look at the existing plugins. Their overall structure is always the same. You’ll need a tile.lua file within your plugin. It gets automatically loaded once the setup is activated on a device:

local api, CHILDS, CONTENTS = ...

local M = {}

function M.updated_config_json(config)
    --[[ 
      Called when the local config.json is updated. This happens if the
      user edits any value within the plugin's editor tab within the setup.
      If you have a configuration option like this in the local node.json
      you can use api.localized to get the correct full path name:
      {
        "title": "Font",
        "name": "font",
        "type": "font",
        "default": "default-font.ttf"
      }
    ]]--
    pp(config)
    font = resource.load_font(api.localized(config.font.asset_name))
end

function M.task(starts, ends, config, x1, y1, x2, y2)
    --[[
      Called when a plugin is added within a page and that page
      is about to get activated. The function is executed as a coroutine
      and you must yield after drawing your content. The helper function
      api.frame_between automatically does that and "loops" while your
      plugin should show content on the screen.
   ]]-- 
    for now in api.frame_between(starts, ends) do
        print("draw something within", x1, y1, x2, y2)
    end
end

return M

Thanks! It´s already nice information to have.

info-beamer - Digital Signage for the Raspberry Pi community forum - Imprint