INTERACT FORUM

Windows => Plug-in Development => Topic started by: petrossa on February 16, 2011, 05:18:10 am

Title: Programming question
Post by: petrossa on February 16, 2011, 05:18:10 am
I have written an our-of-proc connection. I get all the interfaces loaded, pointers are good. I receive events when i connect to a running instance, all info correct.

I request the playbackautomation interface, i get it.
(http://dl.dropbox.com/u/1828618/debug1.JPG)

I run this

 switch (code)
  {
   case NextTrack:
    playback->Next();
    break;
   case PrevTrack:
    playback->Previous();
    break;
   case StopTrack:
    playback->Stop();
    break;
   case PlayTrack:
    playback->Play();
    break;
  default:
     break;
  }

the calls return without error but MC doesn't react.

What do i do wrong?  :'(
Title: Re: Utterly, totally and completely confused
Post by: cncb on February 16, 2011, 08:19:05 am
Maybe you are controlling a different zone in MC than you think (not the one shown in the application)?
Title: Re: Programming question
Post by: petrossa on February 16, 2011, 11:59:40 am
Found it out. 

I have a separate thread running to decode a mask on an usb line, which in turn translates into commands and calls the MC interface. (i've have hardwired the bathroom with a pushbuttonpanel to the computer because i can't get wireless to work for more then 3 meters, NATO sucks) The main interface is loaded in the main thread.  >:(

Although i call back to the mainthread to execute the command something goes missing. Guess i have to poll the the other thread from the main thread to work.

FacePalm

Tnx for the answer just the same.
Title: Re: Programming question
Post by: petrossa on February 16, 2011, 12:29:49 pm
Yep, polling the thread work fine.

Maybe this will help someone else:

If you have COM interfaces opened for services other than MC and you run it multithreaded, you can't refer back to the main thread to use the MC interface without weird side effects.

One needs to open the MC interface in the main thread, and poll the other the threads from the main thread to execute Set commands. Weirdly enough Get commands work fine.

Go figure ?
Title: Re: Programming question
Post by: JimH on February 16, 2011, 12:40:02 pm
(i've have hardwired the bathroom with a pushbuttonpanel to the computer because i can't get wireless to work for more then 3 meters, NATO sucks)
Powerline networking works well.
Title: Re: Programming question
Post by: petrossa on February 17, 2011, 04:33:57 am
True, but then i'd have to put a computer in my bathroom. And then i might as well put an ethernet cable. Would be nicer to use the JRiver ID. In any case, i did try to convince my wife to put a computer in there but that fell on seriously deaf ears.  :'(

This way i can just make a panel with pushbuttons and by connecting 5 wires to ground in various combo's i can generate 120 commands, convert the signals to a bitmap, copy that to an integer and control MC that way.

I was thinking to include a mechanical selector switch, so to set the function of the pushbuttons. Grounding one wire, leaves me !4 commands per selection.

So wire 1: playback, wire 2: playlist, wire 3: etc. Feedback by leds.

I laid a HDMI cable, it has ample wires and well shielded. I even feed the music through it to a 300 w car PowerAmplifier in the bathroom.

With the humidity most other electronics fail.