Sha256: 707bc8d9945b29bb67433e8eb044797821f6e20a3fc0a04d3544164884cf8e74

Contents?: true

Size: 510 Bytes

Versions: 1

Compression:

Stored size: 510 Bytes

Contents

# frozen_string_literal: true

require 'bundler'
Bundler.setup :default

require 'logger'
require 'mpd_client'

MPD::Client.log = Logger.new($stderr)

client = MPD::Client.new
client.connect('localhost', 6600)

# Get id of the first song in the playllist
song = client.playlistinfo(1).first
pp "#{song['artist']} - #{song['title']}"
song_id = song['id']

# Specifies the portion of the song that shall be played
client.rangeid(song_id, [60, 70])

# Play the playlist at song 1
client.play(1)

pp client.status

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mpd_client-0.3.0 examples/rangeid.rb