Reading, and displaying the value for [ChannelN],track_samples in skins

Asked by jus

Hi, we can determine if a track is loaded into a deck by checking for [ChannelN],track_samples.
This works for controllers, but is this working in skins too?

I tried to archive the following:

Check if a track is loaded into a deck, and display a widget if [ChannelN],track_samples > 0.
In a first step i just try to display [ChannelN],track_samples in a label using the following code:

<Template>
  <SetVariable name="group">[Channel<Variable name="i"/>]</SetVariable>
  <SetVariable name="control_track_samples"><Variable name="group"/>,track_samples</SetVariable>
  <WidgetGroup>
    <ObjectName>foo</ObjectName>
    <Layout>horizontal</Layout>
    <SizePolicy>me,max</SizePolicy>
    <Children>
      <Label>
        <TooltipId>track_title</TooltipId>
        <Size>me,min</Size>
        <ObjectName>HiddenTrackTitleInfo</ObjectName>
        <Text><Variable name="control_track_samples"/></Text>
      </Label>
    </Children>
  </WidgetGroup>
</Template>

This does only partially work, since all i got was the output of the correct channel number + the track_samples string , i.e. ``[Channel1],track_samples``
The developer tools console reads instead: [Channel1],track_samples=25796736.00

Any clues?

Question information

Language:
English Edit question
Status:
Answered
For:
Mixxx Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Daniel Schürmann (daschuer) said :
#1

You can simply do:

<WidgetGroup>
  <Connection>
    <ConfigKey persist="true">[Channel1],track_samples</ConfigKey>
    <BindProperty>visible</BindProperty>
  </Connection>
</WidgetGroup>

Revision history for this message
Be (be.ing) said :
#2

I have added a track_loaded CO which would make your code more readable.

Can you help with this problem?

Provide an answer of your own, or ask jus for more information if necessary.

To post a message you must log in.