INTERACT FORUM

Please login or register.

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

Author Topic: Not all notifcation events are fired  (Read 8892 times)

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Not all notifcation events are fired
« on: April 14, 2007, 03:14:45 am »

Hi,

I wrote a little plugin in C#. The plugin uses Mr GriZ's Template to begin with. I've found out how to register the MjEvent Routine in C# but I now see that not all Events are fired (is this related to the Zone Problem I read earlier? (MCC: NOTIFY_TRACK_CHANGE only works for active zone? from Gappie)). When a track changes, notification are fired (see below) but when f.i. the Equalizer is changed I don't get the MCC: NOTIFY_PLAYERSTATE_CHANGED Event. In fact I don't get any other events than the ones printed below which are fired when the player changes tracks. I've downloaded the latest version I could find (12.0.207) but that didn't help.

Paul.


MJEvent type: MCCommand/MCC: NOTIFY_PLAYERSTATE_CHANGE/0
MJEvent type: MCCommand/MCC: NOTIFY_TRACK_CHANGE/0
MJEvent type: MCCommand/MCC: NOTIFY_PLAYERSTATE_CHANGE/0
MJEvent type: MCCommand/MCC: NOTIFY_PLAYERSTATE_CHANGE/0
MJEvent type: MCCommand/MCC: NOTIFY_PLAYERSTATE_CHANGE/0
MJEvent type: MCCommand/MCC: NOTIFY_TRACK_CHANGE/0
MJEvent type: MCCommand/MCC: NOTIFY_PLAYERSTATE_CHANGE/0
MJEvent type: MCCommand/MCC: NOTIFY_PLAYERSTATE_CHANGE/0
Logged

Mr ChriZ

  • Citizen of the Universe
  • *****
  • Posts: 4375
  • :-D
Re: Not all notifcation events are fired
« Reply #1 on: April 14, 2007, 03:18:32 am »

I've passed Paul a link to the latest beta build for Dev purposes only.

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #2 on: April 14, 2007, 03:25:06 am »

Downloaded that one. Problem stays the same.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #3 on: April 14, 2007, 03:29:42 am »

The skin change notification does work:

MJEvent type: MCCommand/MCC: NOTIFY_SKIN_CHANGED/0
Logged

John Gateley

  • Citizen of the Universe
  • *****
  • Posts: 4957
  • Nice haircut
Re: Not all notifcation events are fired
« Reply #4 on: April 14, 2007, 08:27:38 am »

I'll test the other events on monday...

j

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #5 on: April 14, 2007, 08:31:38 am »

John,

There's a problem with the MCC: NOTIFY_SKIN_CHANGED event. It fires a bit too early. When I try and change the colors for the plugin at the time the event is fired, probably not all the colors have been set for the skin correctly yet. When however I set the colors on the Paint event of my MainInterface Panel (UserControl) the color appear correctly (this is how I have implemented it for now).

Paul.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #6 on: April 16, 2007, 08:38:19 am »

Any news yet?
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #7 on: April 16, 2007, 12:24:57 pm »

Bump!
Logged

John Gateley

  • Citizen of the Universe
  • *****
  • Posts: 4957
  • Nice haircut
Re: Not all notifcation events are fired
« Reply #8 on: April 16, 2007, 01:37:34 pm »

Monday's are busy for me...

j

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #9 on: April 16, 2007, 02:17:12 pm »

Promises, Promises.... ;-) Ok, I'll be patient.
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #10 on: April 17, 2007, 12:44:23 am »

John, I can confirm his results.

The Wiki says
Quote
MCC: NOTIFY_PLAYERSTATE_CHANGED
  Fired when a the player state changes
    Change in volume
    Change in mixer
    Change in image being displayed
  string3 is the zone

But I only seem to get them just before a track change (I assume by the image changing ?).  I can't trigger one by adjusting the volume or mixer settings.  I only use one zone.

My logs look like this...
EQdbCtrl::MJEvent(MJEvent type: MCCommand, MCC: NOTIFY_PLAYERSTATE_CHANGE, 0)
EQdbCtrl::MJEvent(MJEvent type: MCCommand, MCC: NOTIFY_PLAYERSTATE_CHANGE, 0)
EQdbCtrl::MJEvent(MJEvent type: MCCommand, MCC: NOTIFY_PLAYERSTATE_CHANGE, 0)
EQdbCtrl::MJEvent(MJEvent type: MCCommand, MCC: NOTIFY_TRACK_CHANGE, 0)


PS.  I'm using 214.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #11 on: April 17, 2007, 12:47:57 am »

My plugin shows all the events in the plugin (for now). Would you like a copy of the installation exe?
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #12 on: April 17, 2007, 03:50:52 pm »

Bump!
Logged

John Gateley

  • Citizen of the Universe
  • *****
  • Posts: 4957
  • Nice haircut
Re: Not all notifcation events are fired
« Reply #13 on: April 17, 2007, 04:44:41 pm »

There's a typo in the docs and shown above. The PLAYERSTATE event is:

NOTIFY_PLAYERSTATE_CHANGE

It is not:

NOTIFY_PLAYERSTATE_CHANGED

Sorry...

j

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #14 on: April 18, 2007, 02:27:48 pm »

Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #15 on: April 18, 2007, 10:48:12 pm »

I indeed had my handler looking at the wrong keyword, but even fixed, I still do not recieve the event as frequently as expected (only at track change).

Now using 216, still unable to trigger this event with volume or mixer changes.  Is just changing the slider enough or is there something else I'm supposed to do?  Or, perhaps I misunderstand it's application?  (Is it only triggered by a function call to the mixer to set the mixer?)
Logged

John Gateley

  • Citizen of the Universe
  • *****
  • Posts: 4957
  • Nice haircut
Re: Not all notifcation events are fired
« Reply #16 on: April 19, 2007, 11:17:57 am »

Sorry - misread the code when doing the docs.
The NOTIFY_PLAYERSTATE_CHANGE is fired on a change in player state, like going to the next track, stop, pause, or start.
I added two events for the volume and the mixer:
MCC: NOTIFY_VOLUME_CHANGED
MCC: NOTIFY_EQ_CHANGED

Available next build...

j

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #17 on: April 20, 2007, 11:02:02 am »

Can I or can I not get this latest build? I'm quite frustrated at the moment and already planning to give it all a big kick into the Trash Can. It's impossible for me to program anything with all the bugs and missing stuff in the version I have (213). Are you going to encourage or dissapoint me?
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: Not all notifcation events are fired
« Reply #18 on: April 20, 2007, 12:33:18 pm »

Can I or can I not get this latest build? I'm quite frustrated at the moment and already planning to give it all a big kick into the Trash Can. It's impossible for me to program anything with all the bugs and missing stuff in the version I have (213). Are you going to encourage or dissapoint me?

Paul

Thank you for your help, fixing document pages for JRiver in Wiki
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #19 on: April 21, 2007, 01:07:42 am »

Thanks King,

I believe everybody else is ignoring me here. What's the matter with you people out there?

I'm an experienced programmer who is trying to build a plugin for a friend for whom I installed (and bought mind you) MC to play music in his Pub in Zürich. He would like to have a plugin that can set certain properties based on song/genre/album (haven't quite found all the possibilities yet). Now is it so hard too get a little help from my friends so I can get along. DO YOU WANT ME TO GET ON MY KNEES AND BEG! Ok I'm on my knees now, PLEASE HELP  :o !

Paul.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #20 on: April 21, 2007, 01:25:41 am »

Just to show you guys I'm not fooling arround. This is what I've programmed so far but now I'm stuck and need your help:

All written in C# with Visual Studio 2005 Professional Edition and SharpLibrary (http://www.sharplibrary.com/) Components.
  • Colors are taken from the skin and automatically set.
  • The Field 'AutoEQ' is automatically added to the Database (need it to set features on a per song/album base).
  • The equalizer already syncs with the MC Eq.



  • In the Search field a profile can be entered and the result is shown in the grid (would have been nice If I could enhance the pop-ups in MC with my functionality and use the Search and select logic already present in MC, but didn't see that posibility yet).
  • Planning to do bulk changes to the AutoEQ Field here.


Logged

Craig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 612
Re: Not all notifcation events are fired
« Reply #21 on: April 21, 2007, 03:07:36 am »

Paul,
You're not being ignored, We've been trying to get developments made to the event SDK since it was introduced and at the moment there is more progress being made than ever before.

I guess the problem is that they're invisible to 99.9% of users.
It'll get there but you can't expect minority changes to be made overnight.

Craig
Logged
MC2Slim - Windows Shell and JRiver Media Center Integration for Squeezebox.

http://www.duff-zapp.co.uk

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #22 on: April 21, 2007, 04:56:24 am »

Craig,

You're missing the point here. I see that changes are made to MC to allow programmers to hook into MC. But the changes made are not available to me because I can's get the overnight builds. I've been waiting for over a week now to get on with my programming but I'm stuck because of missing functionality and bugs (solved in the latest build).

Paul.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #23 on: April 21, 2007, 04:59:06 am »

Made the plugin to look like this now. Wow, sharplibrary is realy cool

Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #24 on: April 21, 2007, 10:45:05 am »

Paul,

I don't think anyone was doubting the sincerity of your requests.  But all the "Bumps" and rapid-fire requests were a little annoying, and as Craig mentioned, keeping up with the developers is not their highest priority.  I'm guessing your enthusiasm just came off as annoying.  Your "Take it or leave it" response probably didn't buy you any points, either  ;D

Don't give up!
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #25 on: April 22, 2007, 04:55:11 am »

Scot,

You're right. I've been a bit impacient but can you really blame me? I'm a professional IT Consultant in my daily business and when I have a problem with something I consult my colleagues to help me. I was hoping for the same attitude from JRiver. Supporting developers should be a top priority. There is no way to get more functionallity into MC FOR FREE than by supporting enthousiastic people like you and me. If I get supported my attitude will be to think of more functionality to be build into MC and I do have some nice ideas at the moment. On the other hand if I get put down all the time my enthousiasm is going to deminish rapidly (my time is precious to me too). At the moment I'll stick with this little project for now but I don't like to spend my energy to get arround bugs and missing functionality in MC. That's why I need all the help I can get. So once again, Please help!

Paul.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #26 on: April 24, 2007, 08:41:16 pm »

Hi,

Moving the Volume slider generated an Event with empty Strings s1, s2 and a '-1' in string s3.

MJEvent type: MCCommand//-1
MJEvent type: MCCommand//-1
MJEvent type: MCCommand//-1
MJEvent type: MCCommand//-1
MJEvent type: MCCommand//-1

Changes to the Equalizer produce the following Events

MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1

Does the -1 have a meaning in this case? It may be usefull to tell which Band is being changed. When a preset is choosen I get 11 Events (I guess 1 for each Band Changing). Causing me to loop over all my bands (11 bands) getting the Values for each band which result in 11 * 11 times getting the Values.

Paul.
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #27 on: April 24, 2007, 11:20:29 pm »

When a preset is choosen I get 11 Events (I guess 1 for each Band Changing). Causing me to loop over all my bands (11 bands) getting the Values for each band which result in 11 * 11 times getting the Values.

That's not happening for me, I just get one.  But I am not implementing my own sliders, I rely on the DSP studio for that.  However, when I set the EQ, that does trigger another event.  Which seems like it should be correct, since I should get an event if something else changes the EQ setting.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #28 on: April 25, 2007, 11:03:15 am »

Oops I see now that my text is not quite right. s1 does contain the correct string. Only s2 is empty. I'll debug the Preset thing tomorrow to see if Scot is right.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #29 on: April 25, 2007, 12:40:12 pm »

John, Scot

Couldn't wait until tomorrow. Here's the result. This is what I get when I select a Preset:

MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1

Exactly 11 Events. So my guess still stands. 1 Event for every Band (which makes sense).

Paul.
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #30 on: April 26, 2007, 12:25:49 am »

Possibly something changed, I'm still using 217.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #31 on: April 26, 2007, 11:03:09 am »

I'm at 220
Logged

John Gateley

  • Citizen of the Universe
  • *****
  • Posts: 4957
  • Nice haircut
Re: Not all notifcation events are fired
« Reply #32 on: April 26, 2007, 04:08:11 pm »

Moving the Volume slider generated an Event with empty Strings s1, s2 and a '-1' in string s3.

MJEvent type: MCCommand//-1
MJEvent type: MCCommand//-1
MJEvent type: MCCommand//-1
MJEvent type: MCCommand//-1
MJEvent type: MCCommand//-1

Fixed in the next build.

Quote
Changes to the Equalizer produce the following Events

MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1
MJEvent type: MCCommand/MCC: NOTIFY_EQ_CHANGED/-1

Does the -1 have a meaning in this case? It may be usefull to tell which Band is being changed. When a preset is choosen I get 11 Events (I guess 1 for each Band Changing). Causing me to loop over all my bands (11 bands) getting the Values for each band which result in 11 * 11 times getting the Values.

No, string3 is not used (and I got it right in the wiki docs too!).

The way events are signaled: a single slider change signals an event that must be sent to a lot of different interested components (such as the 11 slider controls). This also means that the single change generates multiple events for automation. Your plug-in will have to be careful to handle that correctly. Maybe in the future the architecture will be nicer...

j

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #33 on: April 27, 2007, 12:03:31 am »

Paul, does each of your sliders attach to the event interface, or do you have one master routine that attaches just the one process?
Logged

Craig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 612
Re: Not all notifcation events are fired
« Reply #34 on: April 27, 2007, 03:51:50 am »

Fixed in the next build.

Thanks John,

It looks good to me in 12.222
Craig

Logged
MC2Slim - Windows Shell and JRiver Media Center Integration for Squeezebox.

http://www.duff-zapp.co.uk

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #35 on: April 27, 2007, 09:09:57 am »

Paul, does each of your sliders attach to the event interface, or do you have one master routine that attaches just the one process?

I have 1 Routine that handles the Events from MC. On each 'EQ Changes' event from MC a Routine is called that sets all the Sliders (loops over all 11 EQBand(n) and sets my corresponding sliders accordingly.
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #36 on: April 27, 2007, 09:27:12 am »

I have 1 Routine that handles the Events from MC. On each 'EQ Changes' event from MC a Routine is called that sets all the Sliders (loops over all 11 EQBand(n) and sets my corresponding sliders accordingly.

Yeah, I expected that.  But not quite what I asked.  How do you attach to the events interface?  I suspect you are attaching 11 times (once for each slider), that's why you get 11 events instead of just 1.
Logged

John Gateley

  • Citizen of the Universe
  • *****
  • Posts: 4957
  • Nice haircut
Re: Not all notifcation events are fired
« Reply #37 on: April 27, 2007, 09:46:02 am »

When you change a slider or turn the eq on or off, MC starts with a single event. The event processing code says "who is interested in the event" and sends it on to the 11 sliders (11 events). The slider event processing code then sends it on to Automation, so the plug-in gets 11 notifications of the event.

Not the cleanest approach, but it works. I'll improve it later...

j

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #38 on: April 27, 2007, 01:11:42 pm »

Aha, I didn't quite understand Scot here. Now I do. In MC Internaly you can add listeners to the Event. In my plugin I have to wait for MC to fire my MJEvent (11 times). Ok, yeah right, not very OO but it works. But heck, the whole of Windows works like that (at least the older versions).
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #39 on: April 27, 2007, 07:33:32 pm »

When you change a slider or turn the eq on or off, MC starts with a single event. The event processing code says "who is interested in the event" and sends it on to the 11 sliders (11 events). The slider event processing code then sends it on to Automation, so the plug-in gets 11 notifications of the event.

That's what I'm thinking Paul's code is doing (not sure) -- with C++ and the way I attach, I do not have that problem.  I (correctly) only get the one event.
Logged

John Gateley

  • Citizen of the Universe
  • *****
  • Posts: 4957
  • Nice haircut
Re: Not all notifcation events are fired
« Reply #40 on: April 27, 2007, 08:57:03 pm »

That's what I'm thinking Paul's code is doing (not sure) -- with C++ and the way I attach, I do not have that problem.  I (correctly) only get the one event.

My (very brief) testing with C++ gave me multiple events. I'm not sure what's different. I tried two different tests: turning the eq on and off, and moving a slider.

j

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #41 on: April 28, 2007, 02:18:29 am »

Not sure.  I'm up to 223 now and I still only get the one event.  As far as I'm concerned, it works correctly.
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: Not all notifcation events are fired
« Reply #42 on: April 29, 2007, 11:59:47 am »

That's what I'm thinking Paul's code is doing (not sure) -- with C++ and the way I attach, I do not have that problem.  I (correctly) only get the one event.
What remains is the question: "How do you attach?", isn't it?
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621
Re: Not all notifcation events are fired
« Reply #43 on: April 29, 2007, 10:51:57 pm »

Oh, are you asking me? ;D

I'm not 100% sure of why it works right for me.  Couple of potential reasons...

  • I only have to attach once because I'm using a composite control for my dialog.
  • I don't use additional sliders, so I don't have as many SetEQBand calls to make.  Which tend to cause more events to be generated.
  • C++ versus C#
Logged
Pages: [1]   Go Up