Skip to content

Commit

Permalink
Docs: add note about generating OSC profile with ruby.
Browse files Browse the repository at this point in the history
  • Loading branch information
janosvitok committed Mar 10, 2017
1 parent 2a70ac5 commit 138fdcc
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion resources/docs/oscplugin.html
Expand Up @@ -70,5 +70,38 @@ <H1>Controllers</H1>
</ul>
</P>

<HR />

<H1>Advanced: Generating profile programmatically</H1>

<P><B>WARNING: Consider this part as "unofficial". There is no guarantee that it will work. It may stop working at any time!!!</B></P>

<P>It is possible to generate channels for profile programmatically. It may prove useful e.g. when generating profile with
lots of similar channels. For start, manually (using QLC+ wizard) create some channels, and then open the profile in a text editor,
and add the rest of the channels.</P>

<P>Sample code in ruby: Install <a href="https://rubygems.org/gems/digest-crc">digest-crc</a> gem by running:

<pre>
gem install digest-crc
</pre>

Script:

<pre>
require 'digest/crc16_qt'
dig = Digest::CRC16QT.new
dig &lt;&lt; ARGV[0]
crc = dig.checksum
puts %[ &lt;Channel Number="#{crc}"&gt;]
puts %[ &lt;Name>#{ARGV[0]}&lt;/Name&gt;]
puts %[ &lt;Type>Button&lt;/Type&gt;]
puts " &lt;/Channel&gt;"
</pre>

Use:
<pre>ruby ./crc.rb /myoscmessage</pre>

<P>(Hint contributed by padide.)</P>
</BODY>
</HTML>
</HTML>

3 comments on commit 138fdcc

@mcallegari
Copy link
Owner

@mcallegari mcallegari commented on 138fdcc Mar 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janosvitok please see 0f550ed

Instead of complicating people's lives even more, we should dedicate our efforts to provide easy and cross platform solutions. Can you imagine a Windows user setting up Ruby ? 😨
Took me 10 minutes to make the change.

@janosvitok
Copy link
Contributor Author

@janosvitok janosvitok commented on 138fdcc Mar 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a note for those who know ruby. I don't want to teach everyone ruby. Nevertheless, I myself didn't know about that gem and its function. Those who are not interested may ignore the note.

The difference between GUI and program script becomes apparent when you have 300 channels.

Maybe the real problem here is that we have too many places for documentation: here, wiki, forum. I believe the online docs should be the main place to look first.

@mcallegari
Copy link
Owner

@mcallegari mcallegari commented on 138fdcc Mar 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it quite hard to automate the creation of 300 at once.
I believe in any case a manual intervention is necessary.
And by the way, an input profile is something you create once, not every day.

As for the right place to write that Ruby trick, online documentation == packages bundled documentation == PDF manual.
I think the "community tutorials" in GitHub wiki is the best one. It's clearly something for developers (or at least "scripters") so I'd say that's the place

Please sign in to comment.