Thank you very much for your answers !
I have now a more clear vision of what I have to do. I managed to run
the python code generator from xmms-alumni.
I learned that C enums increment values from the first name (which is
defined to 32 in some enums in ipc.xml but not for the methods).
I'm not confident enough to rewrite genipc.py in Elixir, so I will use
it with a custom code_generator.py that just outputs a new data
structure with actual object_id and command_id numbers.
Then, I will write an Elixir module that reads the data structure and
creates the appropriate modules with macros.
Thank you :)
Le 04/07/2017 à 11:21, Frank Terbeck a écrit :
Hi!
niahoo osef wrote:
[...]
With a friend, we are trying to implement the protocol of sending commands to
xmms2 via TCP in Elixir (or Erlang). We feel it's hard to find the appropriate
documentation but I eventually managed to gather some information on the wiki,
hence the title of this email.
When I was implementing a client library in Scheme¹, I was faced with a
similar problem. I have been making a couple of notes² along the way
that may be helpful.
At the moment, we are able to send a hello command to the server. We figured
how to do this by looking at the code of a javascript client.
I would like to know where is the more fiable source that says that a "hello"
command is "32", that an error type is "1", integer is "2" and must be 64bits,
how to properly encode payload and what to expect in return, …
Most of the server's API is actually documented in a machine readable
file³, which you should use to generate most of your library. This is
true for constants (like what command id is correct for HELLO?) as well.
There are only a couple of constants I couldn't find in that spec, and
those are the identifiers for the protocol's types.
I don't mind reading any code but I'm far from good at C. I can't find the
python source code for a module named "xmmsapi" that xmmsclient depends on.
If Scheme makes you happier, feel free to take a look at what I got⁴. I
think the first ability you need is to read data from the server. For
that you need to be able to parse a message's header. Then you need
serialisation and deserialisation of the protocol's data types to deal
with building and reading payload to and from the server. And after that
you can generate the actual API from ipc.xml.
Regards, Frank
¹ https://github.com/ft/xmms2-guile
² https://github.com/ft/xmms2-guile/blob/master/doc/xmms2-protocol.mdwn
If you clone the repository and have pandoc installed, this renders
into a PDF as well — I don't know if github's Markdown rendering
understands all the markup.
³ https://github.com/xmms2/xmms2-devel/blob/master/src/ipc.xml
⁴ https://github.com/ft/xmms2-guile/tree/master/tests
--
_______________________________________________
Xmms2-devel mailing list
Xmms2-devel@lists.xmms2.org
https://lists.xmms2.org/cgi-bin/mailman/listinfo/xmms2-devel