LoginSignup
0
0

More than 1 year has passed since last update.

foo_comserver2をrubyから操作するメモ

Last updated at Posted at 2022-05-11

foobar2000をfoo_comserver2(COM Automation Server)経由で操作するときに詰まったところのメモ

require 'win32ole'
ole = WIN32OLE.new 'Foobar2000.Application.0.7'

# index番目のプレイリストに移動。右辺はオブジェクト
ole.Playlists.ActivePlaylist = ole.Playlists[index]

# 名前で指定する場合
ole.Playlists.ActivePlaylist = ole.Playlists.each.find { _1.name == 'playlistname' }

# 現在のプレイリストのindex番目の曲を再生
# Playback.Stopは使えたが、Startは思ったように使えなかった。こちらを使う。
# メソッド名からすると、foobarの設定によっては再生以外のアクションになるのかもしれない
ole.Playlists.ActivePlaylist.DoDefaultAction index
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0