Sha256: e667049a1627845e7e59d3cf408378a0afde8b9f2641f3044fa96fd870fbbc57

Contents?: true

Size: 769 Bytes

Versions: 1

Compression:

Stored size: 769 Bytes

Contents

require 'green_shoes'

Shoes.app width: 300, height: 100, title: 'Teeny-weeny MP3 player' do
  space = ' '
  background gold..cyan, angle: 30
  song = para 'song.mp3', stroke: firebrick, left: 0, top: 70
  file = 'https://github.com/ashbb/teeny-weeny_mp3_player/raw/master/samples/song.mp3'
  v = video file

  para link('select'){
    unless v.playing?
      f = ask_open_file
      file = f if f
      v = video file
      song.text = fg(file.gsub("\\", '/').split('/').last, firebrick)
    end
  }, space, link('play'){v.play}, space, link('pause'){v.pause}, space, link('stop'){v.stop}
  
  img = image File.join(DIR, '../samples/loogink.png')
  n = 0
  animate 5 do
    img.move (n+=1) % 300 , 40 - rand(10) if file && v.playing?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
green_shoes-1.1.348 samples/sample58.rb