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

Exported Restricted Instances show Panel Tabs even if singleInstance #46

Closed
damiensellier opened this issue Dec 22, 2024 · 13 comments
Closed

Comments

@damiensellier
Copy link
Owner

Exported Restricted Instances show Panel Tabs even if singleInstance :

Capture d’écran, le 2024-12-22 à 12 04 34

@dobo365
Copy link
Collaborator

dobo365 commented Dec 22, 2024

Hmmm... Strange. I don't have this issue. Restricted standalone export with or without menu.
5.6.30.1G built on PC.
Maybe a Mac issue?

image

@damiensellier
Copy link
Owner Author

@dobo365 it's coming from the mods we did recently for 5.6.31 to get the close button on tabs back.

I'll fix that, it's an easy one ;)

@damiensellier
Copy link
Owner Author

LOOK FOR :

InstanceSingleRestriced

@damiensellier
Copy link
Owner Author

It comes from the fact previous Ctrlr versions was not reseting the ctrlrTabBarDepth for exported instances and was left blank. Which meant :

setProperty (Ids::ctrlrTabBarDepth, 0);

This was causing the propertyPane not having tabs on export (top-right side)

To fix the problem I added in CtrlrManagerInstance.cpp L36 :
setProperty (Ids::ctrlrTabBarDepth, 24);

Now I have to set a condition if InstanceSingleRestriced then hide tabs / or setTabBarDepth = 0 in CtrlrDocumentPanel.cpp :

void CtrlrDocumentPanel::activeDocumentChanged()
{
    CtrlrEditor *ed = dynamic_cast <CtrlrEditor*> (getParentComponent());
    if (ed)
    {
        ed->activeCtrlrChanged();
    }
    
    if (getCurrentTabbedComponent()) {
        
        getCurrentTabbedComponent()->setTabBarDepth(owner.getProperty(Ids::ctrlrTabBarDepth)); // Tab height for horizontal bar
        getCurrentTabbedComponent()->getTabbedButtonBar().setMinimumTabScaleFactor(1.0); // Min tab width ratio
        
        TabbedButtonBar &bar = getCurrentTabbedComponent()->getTabbedButtonBar();
        
        for (int i=0; i<bar.getNumTabs(); i++)
        {
            TabBarButton *button = bar.getTabButton (i); // Gets the panel tab button(i)
            
            if (button)
            {
                CtrlrDocumentPanelCloseButton *closeTabButton = new CtrlrDocumentPanelCloseButton("x"); // Added v5.6.30. Brings back the close button for panel tabs
                closeTabButton->addListener (this);
                closeTabButton->setSize(20, 20);
                closeTabButton->getProperties().set ("index", bar.indexOfTabButton(button));
                closeTabButton->setMouseCursor (MouseCursor::PointingHandCursor);
                button->setExtraComponent (closeTabButton, TabBarButton::afterText);
            }
        }
        
    }
}

@dobo365
Copy link
Collaborator

dobo365 commented Dec 22, 2024

Hmmm...Strange as I also have the Tabs Close buttons...
Will look tomorrow to confirm.

@damiensellier
Copy link
Owner Author

damiensellier commented Dec 22, 2024

FIXED on 22.12.2024 for v5.6.31

Unrestricted Instance :
Capture d’écran, le 2024-12-22 à 14 50 56

Restricted Instance
Capture d’écran, le 2024-12-22 à 14 50 43

CtrlrDocumentPanel.cpp L48

void CtrlrDocumentPanel::activeDocumentChanged()
{
    CtrlrEditor *ed = dynamic_cast <CtrlrEditor*> (getParentComponent());
    if (ed)
    {
        ed->activeCtrlrChanged();
    }
    
    if (getCurrentTabbedComponent()) {
        
        if (owner.getInstanceMode() == InstanceSingleRestriced) // Added v5.6.31. Hides tabs on exported restricted instances
        {
            getCurrentTabbedComponent()->setTabBarDepth(0); // Tab height for horizontal bar
            getCurrentTabbedComponent()->getTabbedButtonBar().setMinimumTabScaleFactor(0); // Min tab width ratio
        }
        else
        {
            getCurrentTabbedComponent()->setTabBarDepth(owner.getProperty(Ids::ctrlrTabBarDepth)); // Tab height for horizontal bar
            getCurrentTabbedComponent()->getTabbedButtonBar().setMinimumTabScaleFactor(1.0); // Min tab width ratio
        }
        
        TabbedButtonBar &bar = getCurrentTabbedComponent()->getTabbedButtonBar();
        
        for (int i=0; i<bar.getNumTabs(); i++)
        {
            TabBarButton *button = bar.getTabButton (i); // Gets the panel tab button(i)
            
            if (button)
            {
                CtrlrDocumentPanelCloseButton *closeTabButton = new CtrlrDocumentPanelCloseButton("x"); // Added v5.6.30. Brings back the close button for panel tabs
                closeTabButton->addListener (this);
                closeTabButton->setSize(20, 20);
                closeTabButton->getProperties().set ("index", bar.indexOfTabButton(button));
                closeTabButton->setMouseCursor (MouseCursor::PointingHandCursor);
                button->setExtraComponent (closeTabButton, TabBarButton::afterText);
            }
        }
        
    }
}

@synthmania67
Copy link

this ist the error message of the validation when exporting an instance with version 5.6.31.03a:
TESTING OPEN TIMES:
COLD:
FATAL ERROR: OpenAComponent: result: -3000,0xFFFFF448

@damiensellier
Copy link
Owner Author

Strange, it's working on my setup with AU :
Capture d’écran, le 2024-12-22 à 16 19 54

@synthmania67
Copy link

You have an intel mac, right? I think it´s a problem with Sonoma and these SILICON CPU only, because all older instances don´t work anymore unless you start in Rosetta mode. But this is not the solution. Developing a working CTRLR instance needs a Silicon Mac.

@damiensellier
Copy link
Owner Author

Sorry mate, this is where I have to close the helpdesk :) I already spent 5 hours of my Sunday to fix issues.

For this one, unfortunately I don't have a M4 and Sonoma yet so I can't help.

The only thing I can tell is from now on, AU will validate on mac intel or apple silicon prior Sonoma.

Since on your side you have all the setup, you can try run the AU on debug mode and see where it catches errors with breakpoints.

Good luck

Damien

@synthmania67
Copy link

Sonoma changes everything. Most users always make the same mistake: as soon as Apple releases a new operating system, everyone rushes to install it without thinking.
Then, when nothing works, the developers of the software are berated.
That's the only reason I installed Sonoma in the first place. With Ventura, everything still worked perfectly...I don't want to know what doesn't work with Sequoia.
I'm slowly getting fed up with Apple...

Thank you very much for your help. Wish you a Merry Christmas.

@damiensellier
Copy link
Owner Author

Yep, most plugin dev have big trouble moving to the next macOS because of that. Apple is never on point with new releases; I'm always 2 versions late to be sure it's 100% working.

I posted about your problem on the JUCE forum. People are relly up to date and knowledgeable there since many top tier plugin dev studios use JUCE. Someone asked a Stack Trace log of your plugin/app crashing. If you could provide it could help.
https://forum.juce.com/t/plugin-and-standalone-apps-crashing-on-sonoma-when-closing/64713/2

Merry Xmas and enjoy your holidays mate.
Take care
Damien

@synthmania67
Copy link

Hi Damien, this is the crash report of the standalone app with SONOMA:
Bildschirmfoto 2024-12-24 um 09 51 20

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

No branches or pull requests

3 participants