Sha256: 75f5d1df10bd8415320df3f4ed040227a385f4d1d57201cb511ad12fb5db827f

Contents?: true

Size: 970 Bytes

Versions: 27

Compression:

Stored size: 970 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 < Gloo::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

27 entries across 27 versions & 1 rubygems

Version Path
gloo-3.4.0 lib/gloo/objs/snd/play.rb
gloo-3.3.0 lib/gloo/objs/snd/play.rb
gloo-3.2.0 lib/gloo/objs/snd/play.rb
gloo-3.1.1 lib/gloo/objs/snd/play.rb
gloo-3.1.0 lib/gloo/objs/snd/play.rb
gloo-3.0.1 lib/gloo/objs/snd/play.rb
gloo-3.0.0 lib/gloo/objs/snd/play.rb
gloo-2.5.0 lib/gloo/objs/snd/play.rb
gloo-2.4.3 lib/gloo/objs/snd/play.rb
gloo-2.4.2 lib/gloo/objs/snd/play.rb
gloo-2.4.1 lib/gloo/objs/snd/play.rb
gloo-2.4.0 lib/gloo/objs/snd/play.rb
gloo-2.3.1 lib/gloo/objs/snd/play.rb
gloo-2.2.0 lib/gloo/objs/snd/play.rb
gloo-2.1.0 lib/gloo/objs/snd/play.rb
gloo-2.0.2 lib/gloo/objs/snd/play.rb
gloo-2.0.1 lib/gloo/objs/snd/play.rb
gloo-2.0.0 lib/gloo/objs/snd/play.rb
gloo-0.8.0 lib/gloo/objs/snd/play.rb
gloo-0.7.7 lib/gloo/objs/snd/play.rb