Method: MMPlayer::Context#start

Defined in:
lib/mmplayer/context.rb

#start(options = {}) ⇒ Boolean

Start listening for MIDI Note that MPlayer will start when Context#play (aka Instructions::Player#play) is called

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :background (Boolean)

    Whether to run in a background thread

Returns:

  • (Boolean)


33
34
35
36
37
38
# File 'lib/mmplayer/context.rb', line 33

def start(options = {})
  @midi.start
  @playback_thread = playback_loop
  @playback_thread.join unless !!options[:background]
  true
end