patch-gtk2_ardour_engine_dialog_cc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. $OpenBSD: patch-gtk2_ardour_engine_dialog_cc,v 1.2 2015/12/17 23:14:52 ajacoutot Exp $
  2. --- gtk2_ardour/engine_dialog.cc.orig Fri Dec 18 00:14:23 2015
  3. +++ gtk2_ardour/engine_dialog.cc Fri Dec 18 00:14:23 2015
  4. @@ -14,7 +14,7 @@
  5. #include <CoreFoundation/CFString.h>
  6. #include <sys/param.h>
  7. #include <mach-o/dyld.h>
  8. -#else
  9. +#elif defined(__linux__)
  10. #include <alsa/asoundlib.h>
  11. #endif
  12. @@ -115,6 +115,8 @@ EngineControl::EngineControl ()
  13. strings.clear ();
  14. #ifdef __APPLE__
  15. strings.push_back (X_("CoreAudio"));
  16. +#elif defined(__OpenBSD__)
  17. + strings.push_back (X_("sndio"));
  18. #else
  19. strings.push_back (X_("ALSA"));
  20. strings.push_back (X_("OSS"));
  21. @@ -130,7 +132,9 @@ EngineControl::EngineControl ()
  22. strings.clear ();
  23. strings.push_back (_("Playback/Recording on 1 Device"));
  24. +#ifndef __OpenBSD__
  25. strings.push_back (_("Playback/Recording on 2 Devices"));
  26. +#endif
  27. strings.push_back (_("Playback only"));
  28. strings.push_back (_("Recording only"));
  29. set_popdown_strings (audio_mode_combo, strings);
  30. @@ -161,7 +165,7 @@ EngineControl::EngineControl ()
  31. basic_packer.attach (period_size_combo, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
  32. row++;
  33. -#ifndef __APPLE__
  34. +#if !defined(__APPLE__) && !defined(__OpenBSD__)
  35. label = manage (new Label (_("Number of buffers")));
  36. basic_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
  37. basic_packer.attach (periods_spinner, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
  38. @@ -182,7 +186,7 @@ EngineControl::EngineControl ()
  39. row++;
  40. /* no audio mode with CoreAudio, its duplex or nuthin' */
  41. -#ifndef __APPLE__
  42. +#if !defined(__APPLE__) && !defined(__OpenBSD__)
  43. label = manage (new Label (_("Audio Mode")));
  44. basic_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
  45. basic_packer.attach (audio_mode_combo, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
  46. @@ -222,7 +226,7 @@ EngineControl::EngineControl ()
  47. realtime_button.signal_toggled().connect (mem_fun (*this, &EngineControl::realtime_changed));
  48. realtime_changed ();
  49. -#ifndef __APPLE__
  50. +#if !defined(__APPLE__) && !defined(__OpenBSD__)
  51. label = manage (new Label (_("Realtime Priority")));
  52. label->set_alignment (1.0, 0.5);
  53. options_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
  54. @@ -272,7 +276,7 @@ EngineControl::EngineControl ()
  55. options_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
  56. ++row;
  57. -#ifndef __APPLE__
  58. +#if !defined(__APPLE__) && !defined(__OpenBSD__)
  59. label = manage (new Label (_("Dither")));
  60. label->set_alignment (1.0, 0.5);
  61. options_packer.attach (dither_mode_combo, 1, 2, row, row + 1, FILL|EXPAND, AttachOptions(0));
  62. @@ -288,7 +292,7 @@ EngineControl::EngineControl ()
  63. device_packer.set_spacings (6);
  64. row = 0;
  65. -#ifndef __APPLE__
  66. +#if !defined(__APPLE__) && !defined(__OpenBSD__)
  67. label = manage (new Label (_("Input device")));
  68. label->set_alignment (1.0, 0.5);
  69. device_packer.attach (*label, 0, 1, row, row+1, FILL|EXPAND, (AttachOptions) 0);
  70. @@ -432,6 +436,8 @@ EngineControl::build_command_line (vector<string>& cmd
  71. } else if (driver == X_("CoreAudio")) {
  72. using_coreaudio = true;
  73. cmd.push_back ("coreaudio");
  74. + } else if (driver == X_("sndio")) {
  75. + cmd.push_back ("sndio");
  76. } else if (driver == X_("NetJACK")) {
  77. using_netjack = true;
  78. cmd.push_back ("netjack");
  79. @@ -612,7 +618,7 @@ EngineControl::setup_engine ()
  80. void
  81. EngineControl::realtime_changed ()
  82. {
  83. -#ifndef __APPLE__
  84. +#if !defined(__APPLE__) && !defined(__OpenBSD__)
  85. priority_spinner.set_sensitive (realtime_button.get_active());
  86. #endif
  87. }
  88. @@ -627,7 +633,12 @@ EngineControl::enumerate_devices (const string& driver
  89. devices[driver] = enumerate_coreaudio_devices ();
  90. #endif
  91. -#ifndef __APPLE__
  92. +#ifdef __OpenBSD__
  93. + } else if (driver == "sndio") {
  94. + devices[driver] = enumerate_sndio_devices ();
  95. +#endif
  96. +
  97. +#ifdef __linux__
  98. } else if (driver == "ALSA") {
  99. devices[driver] = enumerate_alsa_devices ();
  100. } else if (driver == "FFADO") {
  101. @@ -752,6 +763,17 @@ Ardour and choose the relevant device then."
  102. exit (1);
  103. }
  104. +
  105. + return devs;
  106. +}
  107. +#elif defined(__OpenBSD__)
  108. +vector<string>
  109. +EngineControl::enumerate_sndio_devices ()
  110. +{
  111. + vector<string> devs;
  112. +
  113. + backend_devs.clear ();
  114. + devs.push_back ("default");
  115. return devs;
  116. }