The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Getting Remote Song Info

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Getting Remote Song Info Posted: Dec 4, 2008 1:16 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Getting Remote Song Info
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

For reasons I don't really understand, my Applescript doesn't work right when I try to grab song info from across my LAN. The technique I posted last night kept trying to connect to my daughter's iTunes instance, even though I was using my own login credentials. This was irritating, so I just went ahead and created a small Opentalk solution. I have a small UI running on the iMac with two buttons - one to start the listener, and one to stop it. I have the same retrieval Applescript as before (for the local case), and this code sets up the listener:


	broker := RequestBroker newStstTcpAtPort: 9501.
	broker start.
	broker export: self oid: #itunes

On the client side, I set up a broker the same way (without the export), and then do this to invoke the remote API (the method that calls the Applescript and creates the formatted string):


	| remote string |
	remote := broker
		remoteObjectToHost: settings machine
		port: 9501
		oid: #itunes.
	string := remote getiTunesInfo.

That's about it - I've added a menu pick to fetch the info - it first looks at my local iTunes, and if that fails, it tries the remote one. There are plenty of failure cases I've ignored, but heck - I'm the only one using this code, and I know whether I'm listening to music before I try to fetch the info :)

Now Listening to: I Know Why by Sheryl Crow from: Wildflower

Technorati Tags: ,

Read: Getting Remote Song Info

Topic: Edge of Chaos and Hyper Productive Software Development Teams Previous Topic   Next Topic Topic: AYE 2008 - The Magic Chemistry of Teams

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use