# Is it possible to retrieve the current DAW project name?

**URL:** <https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765>\
**Category:** General JUCE discussion\
**Created:** [November 13, 2021, 9:28pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765 "2021-11-13T21:28:37Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wiznat](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/wiznat/32/11103_2.png) [@Wiznat](https://forum.juce.com/u/Wiznat)\
**Post date:** [November 13, 2021, 9:28pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/1 "2021-11-13T21:28:37Z")

</div>

I haven’t seen any easy method to retrieve it, but I’m wondering if some weird workaround could be hypothesized.

---

<div class="post-metadata">

**Author:** ![vallant](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@vallant](https://forum.juce.com/u/vallant)\
**Post date:** [November 15, 2021, 11:58am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/2 "2021-11-15T11:58:32Z")

</div>

Have you had a look at the [Presonus VST3 Extensions](https://presonussoftware.com/media/pages/developer/551638369-1615312999/presonus-plug-in-extensions.pdf)?  
I don’t know about the project name, but it is definitely possible to obtain the bus name (even the bus colour), at least for DAWs that support it.  
On the other hand, i wouldn’t really consider this an _easy_ method of doing so 😉

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [November 15, 2021, 12:06pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/3 "2021-11-15T12:06:56Z")

</div>

Track colour and name is already available directly through the [AudioProcessor::TrackProperties](https://docs.juce.com/master/structAudioProcessor_1_1TrackProperties.html).

But I haven’t seen that for the project name. I haven’t checked the extra API though.

---

<div class="post-metadata">

**Author:** ![Wiznat](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/wiznat/32/11103_2.png) [@Wiznat](https://forum.juce.com/u/Wiznat)\
**Post date:** [November 16, 2021, 2:49am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/4 "2021-11-16T02:49:03Z")

</div>

Actually I think that is the best answer lol, I just glanced over it, but it looks like it provides two global variables that would be perfect.

`const Steinberg::FIDString kDocumentName = "documentName"`  
&  
`const Steinberg::FIDString kDocumentID = "documentID"`

I downloaded the files and it look like its just a couple header files? If that’s all I gotta add I would say it actually is an easy method of doing so lol

---

<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:** [November 16, 2021, 3:16am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/5 "2021-11-16T03:16:39Z")

</div>

Those look like constants that have those strings in them and can’t ever have any other text in them. I am quite sure those are not going to help you in this case.

---

<div class="post-metadata">

**Author:** ![Wiznat](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/wiznat/32/11103_2.png) [@Wiznat](https://forum.juce.com/u/Wiznat)\
**Post date:** [November 16, 2021, 4:18am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/6 "2021-11-16T04:18:01Z")

</div>

You might be right, but what would be the purposes for the global variables listed in 2.8 if they are just constant default names?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [November 16, 2021, 8:00am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/7 "2021-11-16T08:00:07Z")

</div>

They are constant names. They are used as identifiers when you call some API function. But I doubt in juce those functions are exposed. To have the API expandable that function is called using a string identifier.

I searched the JUCE source code, kDocumentName is not found. But maybe I just missed it.  
You will need to use an additional API, and accessing that is not a walk in the park, but doable. Some advances were made recently.

---

<div class="post-metadata">

**Author:** ![Wiznat](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/wiznat/32/11103_2.png) [@Wiznat](https://forum.juce.com/u/Wiznat)\
**Post date:** [November 16, 2021, 9:19am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/8 "2021-11-16T09:19:06Z")

</div>

> [@vallant](#):
>
> [Presonus VST3 Extensions](https://presonussoftware.com/media/pages/developer/551638369-1615312999/presonus-plug-in-extensions.pdf)

Ah I think I misunderstood the usage of the extension. And you’re probably right, for what I’m looking to achieve I think that would be a lofty task.

On another note, I should say, the project name in particular isn’t important, more so I’m trying to uniquely Identify the project from within the plugin and basically determine if the plugin has ever been opened in this project before. Maybe that makes the task simpler lol.

Edit: And I should clarify, just checking for other instances already existing in the project would be insufficient. If the plugin was at any point opened and then deleted, the ‘hasExistedFlag’ will still be true.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [November 16, 2021, 9:34am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/9 "2021-11-16T09:34:21Z")

</div>

For hosts that run the plugin in process you could simply add a static counter, kind of a reference count of how many instances of your plugin are currently loaded:

```auto
class MyProcessor : public juce::AudioProcessor
{
    MyProcessor() : /* ... */
    {
        ++currentInstances;
        ++overallInstances;
    }
    ~MyProcessor() override
    {
        --currentInstances;
    }

private:
    static int currentInstances = 0;
    static int overallInstances = 0;
};

```

just an idea

---

<div class="post-metadata">

**Author:** ![PluginPenguin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pluginpenguin/32/10203_2.png) [@PluginPenguin](https://forum.juce.com/u/PluginPenguin)\
**Post date:** [November 16, 2021, 1:32pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/10 "2021-11-16T13:32:40Z")

</div>

The Presonus extensions are working on the lower level VST/VST3 interface level which JUCE abstracts away from you. We previously integrated them by modifying the JUCE code. In the meantime, JUCE added [VST3ClientExtensions](https://docs.juce.com/develop/structVST3ClientExtensions.html) to make it possible to integrate such third party extensions without modifying the JUCE codebase. Still, you need to be quite familiar with how the VST3 API works and have a basic understanding of the COM interface it uses in order to integrate it, which is not really straightforward if you are new to that.

---

<div class="post-metadata">

**Author:** ![Robertcollins](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@Robertcollins](https://forum.juce.com/u/Robertcollins)\
**Post date:** [November 16, 2021, 1:40pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/11 "2021-11-16T13:40:13Z")

</div>

Yes, it possible, it certainly not easy , possible

---

<div class="post-metadata">

**Author:** ![vallant](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@vallant](https://forum.juce.com/u/vallant)\
**Post date:** [November 16, 2021, 1:47pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/12 "2021-11-16T13:47:08Z")

</div>

Would simply asking the user for the project name in the UI and storing this on disk work?

---

<div class="post-metadata">

**Author:** ![dimbouche](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@dimbouche](https://forum.juce.com/u/dimbouche)\
**Post date:** [November 16, 2021, 4:49pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/13 "2021-11-16T16:49:46Z")

</div>

The project name can change at anytime so I’m afraid that, even if you had access to it, that would not be a reliable way of knowing if your plugin was previously loaded in the session.

The static counter workaround described by @daniel seems to be the way to go. Although as stated it’ll work only for hosts running plugins in-process.

---

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [November 16, 2021, 7:23pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/14 "2021-11-16T19:23:04Z")

</div>

I’m curious so I thought I’d ask: what is your end goal here? Why do you need to know these things? What could you possibly gain by knowing fhe project name or if your plugin had been loaded before or not?

---

<div class="post-metadata">

**Author:** ![Wiznat](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/wiznat/32/11103_2.png) [@Wiznat](https://forum.juce.com/u/Wiznat)\
**Post date:** [November 16, 2021, 11:06pm UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/15 "2021-11-16T23:06:47Z")

</div>

Thank you for the class suggestion I’ll check that out. You are correct I’m not super familiar with the VST3 API, however by looking at how JUCE obtains the track colour and track name, I’m guessing the implementation would be similar but just using the properties the Extension API provides.

@dimbouche You raise a valid point as well. Also this might be a dumb question but what do you and Daniel mean by running plugins in-process? Do most hosts run plugins in process or is it a select few?

@Toddler-Boy Truthfully it’s a really out there idea, but I think it’s pretty unique so I don’t want to quite say lol

---

<div class="post-metadata">

**Author:** ![dimbouche](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@dimbouche](https://forum.juce.com/u/dimbouche)\
**Post date:** [November 17, 2021, 12:31am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/16 "2021-11-17T00:31:46Z")

</div>

Sometimes, DAWs (hosts) can run your plugin in a separate process as the host’s one. This allows to prevent the host from crashing when your plugin crashes.  
I know that Reaper offers that option, and also the latest Logic I think, but maybe others could tell you more precisely which hosts do that.

---

<div class="post-metadata">

**Author:** ![PluginPenguin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pluginpenguin/32/10203_2.png) [@PluginPenguin](https://forum.juce.com/u/PluginPenguin)\
**Post date:** [November 17, 2021, 8:19am UTC](https://forum.juce.com/t/is-it-possible-to-retrieve-the-current-daw-project-name/48765/17 "2021-11-17T08:19:46Z")

</div>

In case you really want to integrate the VST3 extension (and I cannot tell you if it will even solve your problem), maybe this topic where I asked for help with using the Extension interface, along with the juce example code mentioned there might help you [Need help understanding VST3 extensions - #5 by reuk](https://forum.juce.com/t/need-help-understanding-vst3-extensions/47879/5)
