Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure settings.xml during build to define USB not supported #17

Merged
merged 8 commits into from
Apr 4, 2024

Conversation

AlwinEsch
Copy link

@AlwinEsch AlwinEsch commented Apr 3, 2024

This change it to settings.xml.in and set on add-on compile the settings usable or not. Is done by change the <visible> value and set of default connection type. The settings are still inside to prevent problems if something tries somewhere to read it.

Further can for build the cmake configuration value "-DUSB_DEVICE_SUPPORT=0" used and if wanted to disable USB support.

XML with USB support disabled

        <!-- USB device not suppoted on this add-on, due to this the following setting is not usable and marked as not visible. -->
        <setting id="device_connection" type="integer" label="30100" help="30500">
          <level>0</level>
          <visible>false</visible>
          <default>1</default>
          <constraints>
            <options>
              <option label="30200">0</option>
              <option label="30201">1</option>
            </options>
          </constraints>
          <control type="spinner" format="integer"/>
        </setting>

        <!-- USB device not suppoted on this add-on, due to this the following setting is not usable and marked as not visible. -->
        <setting id="device_connection_usb_index" parent="device_connection" type="integer" label="30101" help="30501">
          <level>0</level>
          <visible>false</visible>
          <default>0</default>
          <constraints>
            <minimum>0</minimum>
            <step>1</step>
            <maximum>8</maximum>
          </constraints>
          <dependencies>
            <dependency type="visible" setting="device_connection" operator="is">0</dependency>
          </dependencies>
          <control type="spinner" format="integer"/>
        </setting>

        <setting id="device_connection_tcp_host" parent="device_connection" type="string" label="30102" help="30502">
          <level>0</level>
          <default/>
          <constraints>
            <allowempty>true</allowempty>
          </constraints>
          <!--
          <dependencies>
            <dependency type="visible" setting="device_connection" operator="is">1</dependency>
          </dependencies>
          -->
          <control type="edit" format="ip">
            <heading>30102</heading>
          </control>
        </setting>

        <setting id="device_connection_tcp_port" parent="device_connection" type="integer" label="30103" help="30503">
          <level>0</level>
          <default>1234</default>
          <constraints>
            <allowempty>false</allowempty>
            <minimum>0</minimum>
            <maximum>65535</maximum>
          </constraints>
          <!--
          <dependencies>
            <dependency type="visible" setting="device_connection" operator="is">1</dependency>
          </dependencies>
          -->
          <control type="edit" format="integer">
            <heading>30103</heading>
          </control>
        </setting>

XML with USB support enabled

        <!-- USB device supported on this add-on. -->
        <setting id="device_connection" type="integer" label="30100" help="30500">
          <level>0</level>
          <visible>true</visible>
          <default>0</default>
          <constraints>
            <options>
              <option label="30200">0</option>
              <option label="30201">1</option>
            </options>
          </constraints>
          <control type="spinner" format="integer"/>
        </setting>

        <!-- USB device supported on this add-on. -->
        <setting id="device_connection_usb_index" parent="device_connection" type="integer" label="30101" help="30501">
          <level>0</level>
          <visible>true</visible>
          <default>0</default>
          <constraints>
            <minimum>0</minimum>
            <step>1</step>
            <maximum>8</maximum>
          </constraints>
          <dependencies>
            <dependency type="visible" setting="device_connection" operator="is">0</dependency>
          </dependencies>
          <control type="spinner" format="integer"/>
        </setting>

@AlwinEsch AlwinEsch requested a review from ksooo April 3, 2024 14:15
@AlwinEsch AlwinEsch force-pushed the settings.xml.in-change branch from 4b174cf to 61b3352 Compare April 3, 2024 14:33
<dependencies>
<dependency type="visible" setting="device_connection" operator="is">1</dependency>
</dependencies>
@SETTINGS_XML_IN_NO_USB_END@
Copy link
Author

Choose a reason for hiding this comment

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

I just added this as an afterthought. Found the case that USB was previously activated during the test and this was no longer displayed.

m_settings.device_connection =
kodi::addon::GetSettingEnum("device_connection", device_connection::usb);
#else
m_settings.device_connection = device_connection::rtltcp;
#endif
Copy link
Author

Choose a reason for hiding this comment

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

Because USB was enabled, it is now forced to use tcp.

@AlwinEsch
Copy link
Author

AlwinEsch commented Apr 3, 2024

Maybe another settings text could be good🤔?
Using “- rtl_sdr” as the start looks kind of weird.
Screenshot 2024-04-03 164704

@AlwinEsch AlwinEsch force-pushed the settings.xml.in-change branch from 21cfa68 to dabc404 Compare April 3, 2024 15:27
@AlwinEsch
Copy link
Author

Have added second commit to add groups and to remove the "- ", further renamed with remove of "rtl_tcp " in text.
Screenshot 2024-04-03 171850
Screenshot 2024-04-03 172054
Screenshot 2024-04-03 172239

This change it to settings.xml.in and set on add-on compile the settings usable or not.
Is done by change the `<visible>` value and set of default connection type.
The settings are still inside to prevent problems if something tries somewhere to read it.

Further can for build the cmake configuration value "-DUSB_DEVICE_SUPPORT=0" used and if wanted to disable USB support.
@AlwinEsch AlwinEsch force-pushed the settings.xml.in-change branch from dca75fa to 4feb58c Compare April 3, 2024 21:38
Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

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

addon.cpp does not compile if USB_DEVICE_SUPPORT is not defined. Look at line 1440, there is an 'else if' without an 'if' then.

@ksooo
Copy link
Member

ksooo commented Apr 4, 2024

Shouldn't Jenkinsfile be adjusted to build all platforms again?

@AlwinEsch AlwinEsch force-pushed the settings.xml.in-change branch from 4feb58c to ca8b133 Compare April 4, 2024 12:56
@AlwinEsch
Copy link
Author

Shouldn't Jenkinsfile be adjusted to build all platforms again?

Yes, now all OS works, have added a commit about.

@AlwinEsch
Copy link
Author

addon.cpp does not compile if USB_DEVICE_SUPPORT is not defined. Look at line 1440, there is an 'else if' without an 'if' then.

Ups, is fixed now. But Jenkins brings now the next and iOS/tvOS become USB device support removed too.
It brings now:

In file included from os/darwin_usb.c:50:

os/darwin_usb.h:28:10: fatal error: 'IOKit/IOTypes.h' file not found

#include <IOKit/IOTypes.h>

Seems something updated in Jenkins on the morning.

@AlwinEsch
Copy link
Author

AlwinEsch commented Apr 4, 2024

On new added commit becomes the USB support on Android removed too and Jenkins now happy again on all OS.
EDIT: Happy on all OS after several additional commits.

@AlwinEsch AlwinEsch force-pushed the settings.xml.in-change branch from 10f18c4 to bd173a6 Compare April 4, 2024 13:23
This to fix build errors on Darwin Embedded system (iOS & tvOS).
This fix new Darwin Embedded error:
```
/Users/Shared/jenkins/workspace/binary-addons/kodi-tvos-aarch64-Omega/tools/depends/target/binary-addons/pvr.rtlradio/src/gui/channelsettings.cpp:38:10: fatal error: 'EGL/egl.h' file not found
         ^~~~~~~~~~~
32 warnings and 1 error generated.
```
Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

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

LGTM

@ksooo ksooo merged commit d71d712 into kodi-pvr:Omega Apr 4, 2024
8 checks passed
@AlwinEsch AlwinEsch deleted the settings.xml.in-change branch April 4, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants