# How to call the updateTrackProperties function to display the name on my plugin's GUI

**URL:** <https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185>\
**Category:** Audio Plugins\
**Created:** [October 5, 2023, 4:07pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185 "2023-10-05T16:07:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![EmmanWorld](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@EmmanWorld](https://forum.juce.com/u/EmmanWorld)\
**Post date:** [October 5, 2023, 4:07pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/1 "2023-10-05T16:07:43Z")

</div>

Hello everyone

I am new in Juce and still learning c++, I understand that in order to get the track name that your plugin is loaded to in your DAW you need to use the updateTrackProperties function but I have been searching for examples on how to call this function to display the track name on my plugin’s GUI but haven’t found anything. Can someone please kindly show me how this can been done. Forgive me if this is basic but I’m still a beginner learning my way around Juce.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [October 5, 2023, 4:53pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/2 "2023-10-05T16:53:10Z")

</div>

You are not supposed to call updateTrackProperties yourself. It’s a virtual method you can override and if the feature happens to be supported in the host and plugin format you are using, the method will be called by Juce with the updated track properties, but that is not guaranteed to happen at all.

---

<div class="post-metadata">

**Author:** ![EmmanWorld](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@EmmanWorld](https://forum.juce.com/u/EmmanWorld)\
**Post date:** [October 5, 2023, 5:08pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/3 "2023-10-05T17:08:58Z")

</div>

Oh I see, so would you go about creating a label on your GUI that gets the track name. I thought that is what updateTrackProperties does. Thanks for your response @xenakios

---

<div class="post-metadata">

**Author:** ![bwall](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bwall/32/618_2.png) [@bwall](https://forum.juce.com/u/bwall)\
**Post date:** [October 5, 2023, 6:23pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/4 "2023-10-05T18:23:28Z")

</div>

Yes, it does give you the track name, but, as Xenakios say’s, only if the host supports this----some do, some don’t.

The VST plugin format does not support it at all, by the way. VST3, AU, AAX do support the feature. But, DAWs can choose to use the feature or not.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [October 5, 2023, 9:40pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/5 "2023-10-05T21:40:23Z")

</div>

It’s a bit involved to attempt to get that to work. You need to override the updateTrackProperties method in your AudioProcessor and store the track name into a member variable of your processor. And then you need to make your editor class query that track name variable periodically with a timer and update your GUI label. And even if you do all that, it might not work, because this isn’t a required functionality in the plugin formats/hosts. Why do you need the track name to be displayed in the plugin GUI, anyway?

---

<div class="post-metadata">

**Author:** ![bwall](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bwall/32/618_2.png) [@bwall](https://forum.juce.com/u/bwall)\
**Post date:** [October 5, 2023, 10:21pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/6 "2023-10-05T22:21:31Z")

</div>

In my case, I use the feature so that I know which plugin belongs to which track. Say, I have the same plugin assigned on multiple tracks. And I have the editors showing for them all. Having the track name (and track color) helps to differentiate between the plugins.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [October 5, 2023, 10:23pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/7 "2023-10-05T22:23:30Z")

</div>

Sure, but with all the uncertainties involved with the plugin formats and hosts, that probably shouldn’t be any kind of “core” feature in the plugin.

---

<div class="post-metadata">

**Author:** ![bwall](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bwall/32/618_2.png) [@bwall](https://forum.juce.com/u/bwall)\
**Post date:** [October 5, 2023, 10:34pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/8 "2023-10-05T22:34:47Z")

</div>

Very true, but I wrote my own DAW (TracktionEngine based) and it does support the feature. So, it does work in my case.

In the plugins I publicly distribute, the feature is there if the user’s DAW supports it. And if the DAW does not support it, the GUI location is simply blank background on the plugin, and it is not obvious that the information is “missing”.

---

<div class="post-metadata">

**Author:** ![AdamVenn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamvenn/32/17023_2.png) [@AdamVenn](https://forum.juce.com/u/AdamVenn)\
**Post date:** [October 5, 2023, 11:34pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/9 "2023-10-05T23:34:13Z")

</div>

Sorry if this is off topic… is there a collective wiki/repo/forum thread/juce module somewhere with information about which DAWs support which features of the various formats? For example, playhead information, response curves, etc.?

---

<div class="post-metadata">

**Author:** ![FX23](https://avatars.discourse-cdn.com/v4/letter/f/898d66/32.png) [@FX23](https://forum.juce.com/u/FX23)\
**Post date:** [October 6, 2023, 12:03am UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/10 "2023-10-06T00:03:58Z")

</div>

sidenote: be aware not all daw handle argb the same way  
so might have to “rewire” for some R and B will be swaped for ex, orfor some other A will go to red ect…  
so you’ll need converters specific to daws

---

<div class="post-metadata">

**Author:** ![EmmanWorld](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@EmmanWorld](https://forum.juce.com/u/EmmanWorld)\
**Post date:** [October 6, 2023, 7:59am UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/11 "2023-10-06T07:59:16Z")

</div>

It is just a personal preference thing, I like how ssl channel strip 2 displays the track name on the plugin that’s what I’m trying to achieve

 ![Screenshot_20231006-095312](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/e/1/e188753974fd154c1dbafa5000afee98447bdaf4.jpeg)

---

<div class="post-metadata">

**Author:** ![EmmanWorld](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@EmmanWorld](https://forum.juce.com/u/EmmanWorld)\
**Post date:** [October 6, 2023, 8:04am UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/12 "2023-10-06T08:04:21Z")

</div>

@bwall can you please share an example code of how you achieved this if you don’t mind It would be very helpful

---

<div class="post-metadata">

**Author:** ![bwall](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bwall/32/618_2.png) [@bwall](https://forum.juce.com/u/bwall)\
**Post date:** [October 6, 2023, 2:42pm UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/13 "2023-10-06T14:42:02Z")

</div>

Here is what I do.

In my PluginProcessor.h declare a `TrackProperties` variable and `upDateTrackProperties()`;

```auto
// upDateTrackProperties may be called by the host if it feels like it
// this method calls a similar one in the editor class that updates the editor
void updateTrackProperties(const TrackProperties& properties) override;

TrackProperties trackProperties;

```

Then, in PluginProcessor.cpp;

```auto
void PluginProcessor::updateTrackProperties(const TrackProperties& properties)
{
	trackProperties = properties;

	// call the verison in the editor to update there
	if (auto* editor = dynamic_cast<PluginProcessorEditor*> (getActiveEditor()))
		editor->updateTrackProperties();
}

```

And now we go to PluginEditor.h where we have;

```auto
public:
void updateTrackProperties();

private:
	Colour hostTrackColour = Colour();
	String hostTrackName = String();

```

And in PluginEditor.cpp;

```auto
// called from the processor version of same name
void PluginProcessorEditor::updateTrackProperties()
{
	hostTrackColour = processor.trackProperties.colour;
	hostTrackName = processor.trackProperties.name;

	repaint();
}

```

That should allow it to update the `hostTrackColour` and `hostTrackName` variables if the host supports this feature.

---

<div class="post-metadata">

**Author:** ![EmmanWorld](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@EmmanWorld](https://forum.juce.com/u/EmmanWorld)\
**Post date:** [October 8, 2023, 11:22am UTC](https://forum.juce.com/t/how-to-call-the-updatetrackproperties-function-to-display-the-name-on-my-plugins-gui/58185/14 "2023-10-08T11:22:33Z")

</div>

Thanks a lot @bwall will try it out when I get home.
