Cross-Platform build scripts for audio plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
4.7KB

  1. diff --git a/src/qjackctlAboutForm.cpp b/src/qjackctlAboutForm.cpp
  2. index 6a28439..521b7c9 100644
  3. --- a/src/qjackctlAboutForm.cpp
  4. +++ b/src/qjackctlAboutForm.cpp
  5. @@ -68,12 +68,12 @@ qjackctlAboutForm::qjackctlAboutForm ( QWidget *pParent )
  6. list << tr("JACK Session support disabled.");
  7. #endif
  8. #ifndef CONFIG_ALSA_SEQ
  9. -#if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32)
  10. +#if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32) && !defined(__APPLE__)
  11. list << tr("ALSA/MIDI sequencer support disabled.");
  12. #endif
  13. #endif
  14. #ifndef CONFIG_DBUS
  15. -#if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32)
  16. +#if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32) && !defined(__APPLE__)
  17. list << tr("D-Bus interface support disabled.");
  18. #endif
  19. #endif
  20. diff --git a/src/qjackctlMainForm.cpp b/src/qjackctlMainForm.cpp
  21. index ee9afa4..f206270 100644
  22. --- a/src/qjackctlMainForm.cpp
  23. +++ b/src/qjackctlMainForm.cpp
  24. @@ -584,6 +584,26 @@ qjackctlMainForm::qjackctlMainForm (
  25. QObject::connect(m_ui.ForwardToolButton,
  26. SIGNAL(clicked()),
  27. SLOT(transportForward()));
  28. +
  29. +#ifdef __APPLE__
  30. + // Setup macOS menu bar
  31. + QMenuBar* const menuBar = new QMenuBar(nullptr);
  32. + menuBar->setNativeMenuBar(true);
  33. +
  34. + QMenu* const menu = menuBar->addMenu("QjackCtl");
  35. +
  36. + QAction* const actQuit = menu->addAction(tr("&Quit"));
  37. + actQuit->setMenuRole(QAction::QuitRole);
  38. + QObject::connect(actQuit, SIGNAL(triggered()), SLOT(quitMainForm()));
  39. +
  40. + QAction* const actPreferences = menu->addAction(tr("Set&up..."));
  41. + actPreferences->setMenuRole(QAction::PreferencesRole);
  42. + QObject::connect(actPreferences, SIGNAL(triggered()), SLOT(showSetupForm()));
  43. +
  44. + QAction* const actAbout = menu->addAction(tr("Ab&out..."));
  45. + actAbout->setMenuRole(QAction::AboutRole);
  46. + QObject::connect(actAbout, SIGNAL(triggered()), SLOT(showAboutForm()));
  47. +#endif
  48. }
  49. @@ -906,6 +926,11 @@ bool qjackctlMainForm::setup ( qjackctlSetup *pSetup )
  50. // Register the first timer slot.
  51. QTimer::singleShot(QJACKCTL_TIMER_MSECS, this, SLOT(timerSlot()));
  52. +#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__APPLE__)
  53. + // increazing height make UI look ugly and it is not really useful
  54. + setFixedHeight(height());
  55. +#endif
  56. +
  57. // We're ready to go...
  58. return true;
  59. }
  60. diff --git a/src/qjackctlSetup.cpp b/src/qjackctlSetup.cpp
  61. index 8294606..487b7de 100644
  62. --- a/src/qjackctlSetup.cpp
  63. +++ b/src/qjackctlSetup.cpp
  64. @@ -88,6 +88,12 @@ void qjackctlSetup::loadSetup (void)
  65. }
  66. m_settings.endGroup();
  67. +#ifdef __APPLE__
  68. + // alternative custom defaults, as the mac theme does not look good with our custom widgets
  69. + sCustomColorTheme = "KXStudio";
  70. + sCustomStyleTheme = "Fusion";
  71. +#endif
  72. +
  73. m_settings.beginGroup("/Options");
  74. bSingleton = m_settings.value("/Singleton", true).toBool();
  75. // sServerName = m_settings.value("/ServerName").toString();
  76. @@ -118,8 +124,8 @@ void qjackctlSetup::loadSetup (void)
  77. sDisplayFont2 = m_settings.value("/DisplayFont2").toString();
  78. bDisplayEffect = m_settings.value("/DisplayEffect", true).toBool();
  79. bDisplayBlink = m_settings.value("/DisplayBlink", true).toBool();
  80. - sCustomColorTheme = m_settings.value("/CustomColorTheme").toString();
  81. - sCustomStyleTheme = m_settings.value("/CustomStyleTheme").toString();
  82. + sCustomColorTheme = m_settings.value("/CustomColorTheme", sCustomColorTheme).toString();
  83. + sCustomStyleTheme = m_settings.value("/CustomStyleTheme", sCustomStyleTheme).toString();
  84. iJackClientPortAlias = m_settings.value("/JackClientPortAlias", 0).toInt();
  85. bJackClientPortMetadata = m_settings.value("/JackClientPortMetadata", false).toBool();
  86. iConnectionsIconSize = m_settings.value("/ConnectionsIconSize", QJACKCTL_ICON_16X16).toInt();
  87. diff --git a/src/qjackctlSetupForm.cpp b/src/qjackctlSetupForm.cpp
  88. index ee64fa3..703ab52 100644
  89. --- a/src/qjackctlSetupForm.cpp
  90. +++ b/src/qjackctlSetupForm.cpp
  91. @@ -126,6 +126,29 @@ qjackctlSetupForm::qjackctlSetupForm ( QWidget *pParent )
  92. m_iDirtySettings = 0;
  93. m_iDirtyOptions = 0;
  94. +#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__APPLE__)
  95. + // Remove useless drivers for some systems
  96. + for (int i = m_ui.DriverComboBox->count(); --i >= 0;)
  97. + {
  98. + const QString itemText = m_ui.DriverComboBox->itemText(i);
  99. + if (itemText == "dummy")
  100. + continue;
  101. +#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
  102. + if (itemText == "portaudio")
  103. + continue;
  104. +#endif
  105. +#ifdef __APPLE__
  106. + if (itemText == "coreaudio")
  107. + continue;
  108. +#endif
  109. + if (itemText == "net")
  110. + continue;
  111. + if (itemText == "netone")
  112. + continue;
  113. + m_ui.DriverComboBox->removeItem(i);
  114. + }
  115. +#endif
  116. +
  117. // Save original hard-coded driver names, only really
  118. // useful when (changing (dis)enabling JACK D-BUS...
  119. m_drivers.clear();