[vlc-devel] [PATCH 1/2] Fnordlicht support added. Fnordlicht-Class is based on the MoMo-Class. The Fnordlicht-Class implements oly parts of the fnordlicht-protocol: sync, stop and fade_rgb Have a look at http://github.com/fd0/fnordlicht/raw/master/doc/

Andre Weber WeberAndre at gmx.de
Fri May 14 15:57:57 CEST 2010


> While this code will not be compiled, it really makes no sense. Those 21
> lines could be replaced with just two:
>
>    char *ret;
>    return (asprintf(&ret, "Number [%d], ch) != -1) ? ret : NULL;

thats right, if there are no special names for the channels of this device type.
- the names are only used if the source for fnordlicht will be used inside
AtmoWin on Win32 platform, for the VideoLAN module it is not used,
thats the case why it is defined out.

I'am interested to include the support for this device, also in my
AtmoWin software. (Kai would this be OK for you? - do you
know this software -> http://www.vdr-wiki.de/wiki/index.php/AtmoWin
- thats the original source for atmolight module in VideoLAN the
source wrote for this is used for the VideoLAN module - thats why
are there such defines like "_ATMO_VLC_PLUGIN_" to share
the code between these two projects.

Kai - would you write me a short mail with your source attached,
and the changes - so that I can see how it could fit into AtmoWin.

so far your changes to atmo.cpp, AtmoDefs.h, AtmoConfig.cpp, AtmoTools.cpp
seems to be ok for me - if I can get your code - I will test it on win32 and
make it working for both worlds - if there are still some changes needed.
(if you mostly used the momolight sources it should allready work.)

with best regards

atmo
--
André Weber

----- Original Message ----- 
From: "Rémi Denis-Courmont" <remi at remlab.net>
To: "Mailing list for VLC media player developers" <vlc-devel at videolan.org>
Sent: Friday, May 14, 2010 11:55 AM
Subject: Re: [vlc-devel] [PATCH 1/2] Fnordlicht support added. Fnordlicht-Class is based on the MoMo-Class. The
Fnordlicht-Class implements oly parts of the fnordlicht-protocol: sync, stop and fade_rgb Have a look at
http://github.com/fd0/fnordlicht/raw/master/doc/PROTOCOL for more details.


>
> On Thu, 13 May 2010 19:43:51 +0200, Kai Lauterbach <lauterbach.kai at web.de>
> wrote:
> > +   int amount = getAmountFnordlichter();
> > +   DWORD bufSize = 15;
> > +   unsigned char *buffer = new unsigned char[ bufSize ];
>
> A stack buffer would be simpler and faster here.
>
> > + DWORD bufSize = 16; // the sync package length is 16 bytes
> > + unsigned char *buffer = new unsigned char[ bufSize ];
>
> Same comment.
>
> > + DWORD bufSize = 15; // command package length is 15 bytes
> > + unsigned char *buffer = new unsigned char[ bufSize ];
>
> Again.
>
> > + DWORD iBytesWritten;
> > +
> > + Lock();
> > +
> > + buffer[0] = addr; // fnordlicht address (255 = broadcast)
> > + buffer[1] = 0x08; // stop command
> > + buffer[2] = 1;    // fading
> > +
> > + for ( int i = 3; i < bufSize; i++ )
> > + buffer[i] = 0x00; // fill with zero Bytes...
>
> Use memset().
>
>
> > +#if !defined(_ATMO_VLC_PLUGIN_)
> > +
> > +char *CFnordlichtConnection::getChannelName(int ch)
> > +{
> > +  if(ch < 0) return NULL;
> > +  char buf[30];
> > +
> > +  switch(ch) {
> > +      case 0:
> > +          sprintf(buf,"Number [%d]",ch);
> > +          break;
> > +      case 1:
> > +          sprintf(buf,"Number [%d]",ch);
> > +          break;
> > +      case 2:
> > +          sprintf(buf,"Number [%d]",ch);
> > +          break;
> > +      case 3:
> > +          sprintf(buf,"Number [%d]",ch);
> > +          break;
> > +      default:
> > +          sprintf(buf,"Number [%d]",ch);
> > +          break;
> > +  }
> > +
> > +  return strdup(buf);
> > +}
>
> While this code will not be compiled, it really makes no sense. Those 21
> lines could be replaced with just two:
>
>    char *ret;
>    return (asprintf(&ret, "Number [%d], ch) != -1) ? ret : NULL;
>
>
> -- 
> Rémi Denis-Courmont
> http://www.remlab.net
> http://fi.linkedin.com/in/remidenis
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>




More information about the vlc-devel mailing list