/** * ----------------------------------------------------------------------------- * @package smartVISU * @author Martin Gleiß * @copyright 2012 - 2015 * @license GPL [http://www.gnu.de] * ----------------------------------------------------------------------------- */ /** * Displays a image witch is been reloaded after a given time * * @param unique id for this widget * @param the path/url to the image * @param the mode: 'none', 'corner', 'corner-bottom' (optional, default 'none') * @param the reload-time in duration-format (optional, default '10i') * * @see misc/fundamentals#Duration-Format */ {% macro image(id, src, mode, time) %} {% endmacro %} /** * Standard Multimedia Player * * @param unique id for this widget * @param the item for play/pause * @param the item for stopping the music (optional) * @param the item for fast forward and rewind (optional) * @param the item for next an previous playlist title * @param the item for the position (optional) * @param the item for the volume (optional) * @param the item to mute the music (optional) * @param the item for the song title (optional) * @param the item for the song artist (optional) * @param the item for repeat (optional) * @param the item to load the default playlist (optional) * * @author Axel Otterstätter */ {% macro music(id, item_play, item_stop, item_ff, item_next, item_pos, item_vol, item_mute, item_title, item_artist, item_repeat, item_playlist) %} {% import "basic.html" as basic %} {% set uid = uid(page, id) %}
{% if item_vol %}
{{ basic.slider(id~'vol', item_vol, 0, 100, 5, 'bottomup') }}
{% endif %}
{% if item_mute %} {{ basic.button(id~'mute', item_mute, 'Mute', 'audio_volume_mute.svg', 1) }} {% endif %} {% if item_repeat %} {{ basic.dual(id~'repeat', item_repeat, 'audio_repeat.svg', 'audio_repeat.svg') }} {% endif %} {% if item_playlist %} {{ basic.button(id~'playlist', item_playlist, 'Default Playlist', 'audio_playlist.svg', 1) }} {% endif %}
{% if item_artist %}{{ basic.value(id~'artist', item_artist) }}   {% endif %} {% if item_title %}{{ basic.value(id~'title', item_title) }}{% endif %}
{% if item_pos %}
 
{{ basic.slider(id~'pos', item_pos, 0, 100, 1) }}
{% endif %}
{{ basic.button(id~'prev', item_next, 'back', 'control_arrow_left.svg', 0) }} {% if item_ff %} {{ basic.button(id~'rew', item_ff, 'rev', 'audio_rew.svg', 0) }} {% endif %} {{ basic.dual(id~'play', item_play, 'audio_pause.svg', 'audio_play.svg') }} {% if item_stop %} {{ basic.button(id~'stop', item_stop, 'stop', 'audio_stop.svg', 1) }} {% endif %} {% if item_ff %} {{ basic.button(id~'ff', item_ff, 'fwd', 'audio_ff.svg', 1) }} {% endif %} {{ basic.button(id~'next', item_next, 'next', 'control_arrow_right.svg', 1) }}
{% endmacro %} /** * A widget to display a slideshow, controlled by items/items * * @param unique id for this widget * @param a directory where the pictures are located * @param delay between the slides in sec (optional, default: 2 sec) * @param item to switch to the next slide * @param item to switch to the previous slide * @param item to stop the animation * @param item to start the animation * * @author Alex * * @info based on cycle2 jquery-plugin: (c) 2012 M. Alsup; Dual licensed: MIT/GPL * @link http://jquery.malsup.com/cycle2 */ {% macro slideshow(id, dir, delay, item_next, item_prev, item_stop, item_start) %} {% set uid = uid(page, id) %}
{% for file in dir(dir, '(.+?).(jpg|png|svg)') %} {% endfor %}
{% endmacro %} /** * Displays a tv- or radio- station button * * @param unique id for this widget * @param a item * @param a icon (e. g. located in pics/station) * @param value send if the button is pressed (optional, default 1) * @param type: 'mini', 'midi' (optional, default: mini) */ {% macro station(id, item, pic, val, type) %} {% import "basic.html" as basic %} {% set uid = uid(page, id) %}
{{ basic.button(id, item, '', pic, val, type|default('mini')) }}
{% endmacro %}