Hi,
I want to thank the author for this amazing app.
I've bought the donated version and it worked OK for me. But I wanted to use my remote (for Globo Opticum 4060cx SAT decoder). So I've done some research based on author's hints and managed to get the codes
This has encouraged me to dig deeper
I've reworked some classes in such way that:
- I've now got 16-button remote
- buttons are showing on my son's Asus TF300T running JB (with original version there was only black rectangle)
Here is a screenshot form the TF:
I've dropped voulume buttons because volume control is already on android device. I've added digits (to avoid using up/down buttons many times), EPG, EXIT and P/N buttons. P/N button is rather less universal - it switches my decoder from PAL to NTSC (in Poland we have PAL system but I've got NTSC LF version)
Here is the actual buttons png image:
and the coresponding LFXGLPlayer class code change (onTouchEvent method):
Code:
float xf = motionevent.getX() / (float)getWidth();
float yf = motionevent.getY() / (float)getHeight();
if(motionevent.getAction() == 1)
if((double)xf > 0.5D && (double)xf < 0.5D+0.12D && (double)yf < 0.22D && (double)yf > 0.02D)
lfclient.sendButton("d1");
else
if((double)xf > 0.5D+0.132D && (double)xf < 0.5D+0.24D && (double)yf < 0.22D && (double)yf > 0.02D)
lfclient.sendButton("d2");
else
if((double)xf > 0.5D+0.26D && (double)xf < 0.5D+0.366D && (double)yf < 0.22D && (double)yf > 0.02D)
lfclient.sendButton("d3");
else
if((double)xf > 0.5D+0.38D && (double)xf < 0.5D+0.49D && (double)yf < 0.22D && (double)yf > 0.02D)
lfclient.sendButton("power");
else
if((double)xf > 0.5D && (double)xf < 0.5D+0.12D && (double)yf < 0.48D && (double)yf > 0.26D)
lfclient.sendButton("d4");
else
if((double)xf > 0.5D+0.132D && (double)xf < 0.5D+0.24D && (double)yf < 0.48D && (double)yf > 0.26D)
lfclient.sendButton("d5");
else
if((double)xf > 0.5D+0.26D && (double)xf < 0.5D+0.366D && (double)yf < 0.48D && (double)yf > 0.26D)
lfclient.sendButton("d6");
else
if((double)xf > 0.5D+0.38D && (double)xf < 0.5D+0.49D && (double)yf < 0.48D && (double)yf > 0.26D)
lfclient.sendButton("pn");
else
if((double)xf > 0.5D && (double)xf < 0.5D+0.12D && (double)yf < 0.72D && (double)yf > 0.52D)
lfclient.sendButton("d7");
else
if((double)xf > 0.5D+0.132D && (double)xf < 0.5D+0.24D && (double)yf < 0.72D && (double)yf > 0.52D)
lfclient.sendButton("d8");
else
if((double)xf > 0.5D+0.26D && (double)xf < 0.5D+0.366D && (double)yf < 0.72D && (double)yf > 0.52D)
lfclient.sendButton("d9");
else
if((double)xf > 0.5D+0.38D && (double)xf < 0.5D+0.49D && (double)yf < 0.72D && (double)yf > 0.25D)
lfclient.sendButton("epg");
else
if((double)xf > 0.5D && (double)xf < 0.5D+0.12D && (double)yf < 0.98D && (double)yf > 0.77D)
lfclient.sendButton("channeldown");
else
if((double)xf > 0.5D+0.132D && (double)xf < 0.5D+0.24D && (double)yf < 0.98D && (double)yf > 0.77D)
lfclient.sendButton("d0");
else
if((double)xf > 0.5D+0.26D && (double)xf < 0.5D+0.366D && (double)yf < 0.98D && (double)yf > 0.77D)
lfclient.sendButton("channelup");
else
if((double)xf > 0.5D+0.38D && (double)xf < 0.5D+0.49D && (double)yf < 0.98D && (double)yf > 0.77D)
lfclient.sendButton("exit");
else
{
renderer.showUI(false);
requestRender();
}
and the arrays.xml change:
Code:
<string-array name="remotes">
...
<item>SV 360 elite</item>
<item>Globo Opticum 4060cx</item>
</string-array>
<string-array name="remotenames">
...
<item>SV 360 elite</item>
<item>4060cx</item>
</string-array>
and finally remotecodes.xml changes:
Code:
<set name="4060cx">
<power>
<on>AQAJCgEBBQAIQEAKAJk=</on>
<off>AQABAgIC</off>
</power>
<channelup>
<on>AQAJCgEBBQAIQEALAJo=</on>
<off>AQABAgIC</off>
</channelup>
<channeldown>
<on>AQAJCgEBBQAIQEAOAJ0=</on>
<off>AQABAgIC</off>
</channeldown>
<volumedown>
<on>AQAJCgEBBQAIQEAQAJ8=</on>
<off>AQABAgIC</off>
</volumedown>
<volumeup>
<on>AQAJCgEBBQAIQEARAKA=</on>
<off>AQABAgIC</off>
</volumeup>
<d1>
<on>AQAJCgEBBQAIQEABAJA=</on>
<off>AQABAgIC</off>
</d1>
<d2>
<on>AQAJCgEBBQAIQEACAJE=</on>
<off>AQABAgIC</off>
</d2>
<d3>
<on>AQAJCgEBBQAIQEADAJI=</on>
<off>AQABAgIC</off>
</d3>
<d4>
<on>AQAJCgEBBQAIQEAEAJM=</on>
<off>AQABAgIC</off>
</d4>
<d5>
<on>AQAJCgEBBQAIQEAFAJQ=</on>
<off>AQABAgIC</off>
</d5>
<d6>
<on>AQAJCgEBBQAIQEAGAJU=</on>
<off>AQABAgIC</off>
</d6>
<d7>
<on>AQAJCgEBBQAIQEAHAJY=</on>
<off>AQABAgIC</off>
</d7>
<d8>
<on>AQAJCgEBBQAIQEAIAJc=</on>
<off>AQABAgIC</off>
</d8>
<d9>
<on>AQAJCgEBBQAIQEAJAJg=</on>
<off>AQABAgIC</off>
</d9>
<d0>
<on>AQAJCgEBBQAIQEAAAI8=</on>
<off>AQABAgIC</off>
</d0>
<pn>
<on>AQAJCgEBBQAIQEAYAKc=</on>
<off>AQABAgIC</off>
</pn>
<epg>
<on>AQAJCgEBBQAIQEBCANE=</on>
<off>AQABAgIC</off>
</epg>
<exit>
<on>AQAJCgEBBQAIQEBBANA=</on>
<off>AQABAgIC</off>
</exit>
</set>
These changes allow us to have 16 buttons instead of 5.
The last change fixes (at least on the Asus tablet) black rectangle problem. It's done in OverlayImage class (loadTexture method):
Code:
// Bitmap localBitmap = BitmapFactory.decodeResource(paramContext.getResources(), this.resourceID);
Bitmap localBitmap = null;
InputStream is = paramContext.getResources().openRawResource(this.resourceID);
try {
localBitmap = BitmapFactory.decodeStream(is);
} finally {
try {
is.close();
is = null;
} catch(IOException e) {
}
}
I hope that the author won't blame me for this post and maybe will be so kind to use my findings in next versions
Sorry for my poor english
Regards
Kuba