Sha256: 7e8619a2e9c6f8b0efa80f283f7c58e672f27a5e3733c3c5e8cd5d332d49f4be

Contents?: true

Size: 974 Bytes

Versions: 19

Compression:

Stored size: 974 Bytes

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2020 Eric Crane.  All rights reserved.
#
# Play an audio file (MP3).
#

module Gloo
  module Objs
    class Play < GlooLang::Core::Obj

      KEYWORD = 'play'.freeze
      KEYWORD_SHORT = 'play'.freeze

      #
      # The name of the object type.
      #
      def self.typename
        return KEYWORD
      end

      #
      # The short name of the object type.
      #
      def self.short_typename
        return KEYWORD_SHORT
      end

      # ---------------------------------------------------------------------
      #    Messages
      # ---------------------------------------------------------------------

      #
      # Get a list of message names that this object receives.
      #
      def self.messages
        return super + [ 'run' ]
      end

      #
      # Play the audio file.
      #
      def msg_run
        system "afplay #{value}"
      end

    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gloo-1.4.2 lib/gloo/objs/snd/play.rb
gloo-1.4.1 lib/gloo/objs/snd/play.rb
gloo-1.4.0 lib/gloo/objs/snd/play.rb
gloo-1.3.3 lib/gloo/objs/snd/play.rb
gloo-1.3.2 lib/gloo/objs/snd/play.rb
gloo-1.3.1 lib/gloo/objs/snd/play.rb
gloo-1.3.0 lib/gloo/objs/snd/play.rb
gloo-1.2.10 lib/gloo/objs/snd/play.rb
gloo-1.2.9 lib/gloo/objs/snd/play.rb
gloo-1.2.8 lib/gloo/objs/snd/play.rb
gloo-1.2.7 lib/gloo/objs/snd/play.rb
gloo-1.2.6 lib/gloo/objs/snd/play.rb
gloo-1.2.5 lib/gloo/objs/snd/play.rb
gloo-1.2.4 lib/gloo/objs/snd/play.rb
gloo-1.2.3 lib/gloo/objs/snd/play.rb
gloo-1.2.2 lib/gloo/objs/snd/play.rb
gloo-1.2.0 lib/gloo/objs/snd/play.rb
gloo-1.1.0 lib/gloo/objs/snd/play.rb
gloo-1.0.0 lib/gloo/objs/snd/play.rb