INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Music Checkout Plug-in  (Read 1766 times)

kiwi

  • Citizen of the Universe
  • *****
  • Posts: 817
  • Don't worry, be happy...
Music Checkout Plug-in
« on: August 26, 2004, 10:28:29 am »

Hello,

Is it possible to create a plug-in that can communicate between two (or more) running MC's (on different machines) and make sure that they aren't playing the same track at the same time?

kiwi
Logged

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re:Music Checkout Plug-in
« Reply #1 on: August 26, 2004, 01:05:57 pm »

The simplest way is to create a plugin that grabs the playing track and writes it to an INI file in a shared directory but before writing check the current contents ... if any of the other clients are playing the same track then skip to the next one (which is what I assume you want to do).

INI format:

[PlayingNow]
<MachineName>=<Artist>,<Album>,<Track>



For example:

[PlayingNow]
MACHINE1=Mike Oldfield,Ommadawn,Part One
MACHINE2=Genesis,Abacab,Me And Sarah Jane
MACHINE3=Yes,90125,Changes



INI files are good as Windows does the parsing and searching for you.



However without more info on your requirements this may not be a suitable solution.   There are plenty more but it all depends on what your restrictions are.
Logged

kiwi

  • Citizen of the Universe
  • *****
  • Posts: 817
  • Don't worry, be happy...
Re:Music Checkout Plug-in
« Reply #2 on: August 26, 2004, 01:30:45 pm »

I hadn't thought of that.  That's a good idea.

I actually haven't really thought through the idea very much at this point.  Basically, I started to think about it because I'd like to mirror my system at my dad's house.   This would give me off site backup (and testing of the HDs, RAID 5 at each location.)  The only issue I see is that we would then be sharing our CDs.  At least on the ethical side, it would seem that if one were to make sure that no track were being played at each location, that you wouldn't be violating the copyrights.   (Sure, I could just figure that nobody will say anything since it's all within the family and I'm not sharing with the world, but if I can do it correctly, I'd feel better about it.)

My initial thoughts would be to have the computer perform a query over the network (for now, I'm going to assume that the computers can speak over the network, ports can be tunneled using ssh from one location to the next.) Then you'd simply let the program know the addresses of the other machines and presto, it goes to the next song, checks to see whether or not it's playing on the other machine and if not, plays it.  If it is, it skips to the next song.

kiwi
Logged

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re:Music Checkout Plug-in
« Reply #3 on: August 27, 2004, 06:55:43 am »

If you didn't want to write files you could be really clever and use UDP broadcasting or even multicasting if your hardware supported it.   Then the PC's wouldn't have to know about everyone else.

The plugin would do three things probably in 3 separate threads to make it simpler:

  1)  Monitor and announce "playing x"
  2)  Listen for announcements and if matches your current track announce "already playing x".
  3)  Listen for "already playing x" and if x matches your current track (and not sent from your computer) skip to the next track.


Each thread is a self-contained entity and would know nothing about the other two.


To be honest if I was you I'd just setup a vpn and mirror without worrying.
Logged

kiwi

  • Citizen of the Universe
  • *****
  • Posts: 817
  • Don't worry, be happy...
Re: Music Checkout Plug-in
« Reply #4 on: May 06, 2005, 01:12:50 am »

Hi RhinoBanga,

Sorry it took me so long to get back.  I've been away from the forum for a while.... relocating from New Zealand back to San Francisco.

I think that I'd probably write the plugin such that it would have to "know" the location of the other PCs since the PCs would probably not be sitting on my local network.  I'm thinking that they might be in a variety of different locations.  But it would be easy, the device would say "hello" to the other computers periodically, and when it went to play a track, it would ask the other computer if it was playing the same track at the same time... and if so, it would jump to the next track in the playlist.  I'll have to flesh this out some to see whether I want to bother with it.

Thanks again for the input.

Kiwi
Logged
Pages: [1]   Go Up