class MultimediaParadise::GUI::FOX::PlayFromRadioStation

Public Class Methods

new(*i) click to toggle source
#

initialize

#
# File lib/multimedia_paradise/gui/fox/play_from_radio_station.rb, line 20
def initialize(*i)
  create_skeleton
end

Public Instance Methods

create_skeleton() click to toggle source
#

create_skeleton

#
# File lib/multimedia_paradise/gui/fox/play_from_radio_station.rb, line 42
def create_skeleton
  @app = Fox::FXApp.new
  main_window = Fox::FXMainWindow.new(@app, 'Radio stations')
  MultimediaParadise.radio_stations?.each {|array|
    name = array.first
    hash = array.last
    url = hash['url']
    # ===================================================================== #
    # Add the button next:
    # ===================================================================== #
    font = Fox::FXFont.new(@app, 'times', 22)
    button = Fox::FXButton.new(main_window, name)
    button.setFont(font)
    button.connect(Fox::SEL_COMMAND) { |sender, selector, data|
      puts url
      esystem 'mpv '+url
    }
    Fox::FXVerticalSeparator.new(
      main_window,
      Fox::LAYOUT_SIDE_RIGHT|Fox::LAYOUT_FILL_Y|Fox::SEPARATOR_RIDGE
    )
    
  }
  main_window.show
  @app.create
  main_window.resize(1240, 1000)
  @app.run # rb $FOX/simple_windows.rb
end
esystem(i) click to toggle source
#

esystem

#
# File lib/multimedia_paradise/gui/fox/play_from_radio_station.rb, line 34
def esystem(i)
  puts i
  system i
end
radio_stations?() click to toggle source
#

radio_stations?

#
# File lib/multimedia_paradise/gui/fox/play_from_radio_station.rb, line 27
def radio_stations?
  MultimediaParadise.radio_stations?
end