Page 1 of 1

External application. Easy way to receive track name?

PostPosted: June 26th, 2008, 8:09 pm
by Barloggg
hi.

Is there easy way to receive from player
1. track name
2. time (played/full)

I want to make my own XION player support for Logitech G15 keyboard, but not founded any documentation how to communicate with player from other programs.

i don't want to dig into SDK placed here (as i saw it's focused on new features of player).
some players can receive windows messages and return pointer or direct number of requested value.

for now i can see only one easy way: to read title of players window and parse then. (but not tried it for now).

is there more easy ways?

Re: External application. Easy way to receive track name?

PostPosted: June 26th, 2008, 11:48 pm
by Cliff Cawley
Barloggg Wrote:hi.

Is there easy way to receive from player
1. track name
2. time (played/full)

I want to make my own XION player support for Logitech G15 keyboard, but not founded any documentation how to communicate with player from other programs.

i don't want to dig into SDK placed here (as i saw it's focused on new features of player).
some players can receive windows messages and return pointer or direct number of requested value.

for now i can see only one easy way: to read title of players window and parse then. (but not tried it for now).

is there more easy ways?


Hi Barloggg,

Currently, no there is no easy way other than making a plugin. Out of interest, why are you making support for G15 keyboard? Does it not work already for you? Xion should have built in G15 support already.

I do hope to make available a system similar to what winamp has with windows messages so that you can retrieve titles, etc, externally.

Cliff :)

PostPosted: June 26th, 2008, 11:57 pm
by SLoB
there is already support for g15 kb, for the keys for deffo but not sure on other content as I don't have one of those kbs

can anyone else confirm what other info is put through to the kb?

G15 is already supported it so you shouldn't need to do anything, unless something is not working or not enough info is being put out?

Cliff perhaps you can bosh a list of features/stuff that is output to the G15?

PostPosted: June 27th, 2008, 5:06 pm
by Barloggg
yes, i know about builtin G15 support.
as for me it's nice.
But, peoples want multifuncional lcd aplets :( my first (and last) applet initially was only just clock a bit more nice than logitech default.
and this is i want from lcd:
Image
ram,cpu and few temperatures.
but peoples need something like things:
Image
focused in network traffic, bandwidth, hard disk perfomance and some other things.
where is the current song is just a one string in corner...

yours G15 support is nice, but it only player window, nothing more.
i want to offer users more info. (my cuurent progress is to add very powerful windows perfomance counters - by request of course). For now my g15 applet support 3 players (autodetect by enumerating windows) and i looking for more. one user make me request to add xion. this is very first time when i heard this name. now i happy about this player. as stand-alone player it can be my choise.

but sdk... it will take me time to teach it. (example was fail to compile)

May be Xoin will make small shared memory file? this is very simple, not very buggy. (keywords in msdn: CreateFileMapping, MapViewOfFile, OpenFileMapping). very useful thing.
my G15aplet create such file not for read only, but usrs can write some info for applet. (but as far as i know no one was tried this)

PS. what frame rate on xion g15 support? specturm looks really nice. but there is rumors about very fast lcd updates can physically damage the keyboard.

PostPosted: June 30th, 2008, 2:45 pm
by Krakken
Cliff, you should add a Winamp style Message/Reply system. Should be quick and easy to implement.

PostPosted: June 30th, 2008, 6:20 pm
by Cliff Cawley
Yup! One of the many things on my Todo list ;)

Cliff :)

PostPosted: June 30th, 2008, 9:36 pm
by Barloggg
my vote is sharememory :)
readonly acces from external programs.
dump in it names, times and spectrum. no problems with strings.

not need to buid message/reply system with dozens of messages avalable.

PostPosted: July 1st, 2008, 6:16 pm
by Cliff Cawley
Barloggg Wrote:my vote is sharememory :)
readonly acces from external programs.
dump in it names, times and spectrum. no problems with strings.

not need to buid message/reply system with dozens of messages avalable.


Sure, I can do this too. I haven't used these API calls before, but looks easy enough. Is there a particular format you'd expect it in? Would it just be a binary stream, similar to a file stored on disk and I give you the details of the 'file format' ?

Or do I just provide a struct that I fill in, and you simply read that struct out?

What have others done in the past?

Cliff :)

PostPosted: July 4th, 2008, 6:37 pm
by Barloggg
there is both way i saw.

1. stream is pretty easily and (!) flexible.
i like flexible structures.
format this:
1. block id: 4 byte
2. block size 4 byte;
3. blockdata. (exactly blocksize)

so if you read this file and encounter unknown block just read size and jump on next block.
in my sharemem files i made first block-header where is stored filesize and blockscount (for users who like for...next structure :) )

but fixed structure is also can be done. with some advantages. and this also can be flexible :)
just open sharefile as version 1, then check version and then reopen as version 2. all is easilly.
take a look this example for RivaTuner:
// v1.0 header
Code: Select All Code
type PRTHM_SHARED_MEMORY_HEADER_V_1_0=^TRTHM_SHARED_MEMORY_HEADER_V_1_0;
   TRTHM_SHARED_MEMORY_HEADER_V_1_0=record
   Signature:TSignature;//array [0..3] of char   ; //dword
      //signature allows applications to verify status of shared memory
      //The signature can be set to:
      //'RTHM'   - hardware monitoring memory is initialized and contains
      //         valid data
      //0xDEAD   - hardware monitoring memory is marked for deallocation and
      //         no longer contain valid data
      //otherwise the memory is not initialized
   Version:DWORD   ;
      //header version ((major<<16) + minor)
      //must be set to 0x00010000 for v1.0 header
   ItemsCount:DWORD   ;
      //number of subsequent RTHM_SHARED_MEMORY_ENTRY_V_1_0 entries
   time:dword;//time_t   ;
      //last polling time
end;
type PRTHM_SHARED_MEMORY_HEADER=^TRTHM_SHARED_MEMORY_HEADER;
  TRTHM_SHARED_MEMORY_HEADER= record
   Signature:TSignature;//array [0..3] of char   ; //dword
      //signature allows applications to verify status of shared memory

      //The signature can be set to:
      //'RTHM'   - hardware monitoring memory is initialized and contains
      //         valid data
      //0xDEAD   - hardware monitoring memory is marked for deallocation and
      //         no longer contain valid data
      //otherwise the memory is not initialized
   Version:DWORD   ;
      //header version ((major<<16) + minor)
      //must be set to 0x00010001 or greater to use this structure
   ItemsCount:DWORD   ;
      //number of subsequent RTHM_SHARED_MEMORY_ENTRY entries
   time:dword;//time_t   ;
      //last polling time
  ItemSize:dword;
      //size of entries in subsequent RTHM_SHARED_MEMORY_ENTRY entries array
end;

in this sharemem file all data except header placed in block of same size. just read Itemsie and parse whole file by for-next. (for first version it was 40 bytes fixed)

----------------

i used both way at one time. :)
block structure with blockID and blockSize. but some blocks just raw data which must be read byte to byte, and some others blocks is fixed structure. :)
this is causing dificulties when some block make longer than it was before. so only one application can write block of variable size. well... or place flag in header "now writing" :)
in my sharemem when my applet writing this block of unknown size if make its header as "end of file block" and after write completed change it ID to right and continue writing next block.


very easy way for you is this:
1. sighature: 4 byte = XION
2. version of sharedata: 4 byte = 1; (00 00 00 01)
3. full time of cur song: 4 byte (milliseconds)
4. played time of cur song: 4 byte (milliseconds)
5. zeroterminated ansi string
no ending block needed, just #0.

when you decide to change sharemem structure just change block 2 to "2" (00 00 00 02)
this will mean that following data is placed in other order.

i know, after first implementation there will be request for more and more features, so changing inner structure is possible. may i will request by muself to place into this file spectrum to visualization. ;)
as far as i tested there is no bugs issued with very fast sharemem acces. (but i use only reading from)

my applet create sharemem file for read-write. so you player can take direct acces to my applet and draw visualization on background without any my attention. :)

PostPosted: July 8th, 2008, 4:11 pm
by Barloggg
Cliff, what is name ot window of player?

what i must write nere to find it:
in this api call:
findwindow(???, ???);

PostPosted: July 8th, 2008, 6:30 pm
by SLoB
you could always spy++ the window ;)

PostPosted: September 8th, 2008, 3:39 pm
by Barloggg
xm. window text is "xion".
may be it's the way to change it to "xion: trackname"
in findwindow we may use classname to search. i see xionmmkbwnd as class name.