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.

94 lines
2.2KB

  1. /* SpiralSound
  2. * Copyleft (C) 2001 David Griffiths <dave@pawfal.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #include "SplitterPlugin.h"
  19. #include "SplitterPluginGUI.h"
  20. #include <FL/Fl_Button.h>
  21. #include "SpiralIcon.xpm"
  22. using namespace std;
  23. extern "C" {
  24. SpiralPlugin* SpiralPlugin_CreateInstance()
  25. {
  26. return new SplitterPlugin;
  27. }
  28. char** SpiralPlugin_GetIcon()
  29. {
  30. return SpiralIcon_xpm;
  31. }
  32. int SpiralPlugin_GetID()
  33. {
  34. return 0x0006;
  35. }
  36. string SpiralPlugin_GetGroupName()
  37. {
  38. return "Control";
  39. }
  40. }
  41. ///////////////////////////////////////////////////////
  42. SplitterPlugin::SplitterPlugin()
  43. {
  44. m_PluginInfo.Name="Splitter";
  45. m_PluginInfo.Width=220;
  46. m_PluginInfo.Height=125;
  47. m_PluginInfo.NumInputs=1;
  48. m_PluginInfo.NumOutputs=4;
  49. m_PluginInfo.PortTips.push_back("Input");
  50. m_PluginInfo.PortTips.push_back("Out one");
  51. m_PluginInfo.PortTips.push_back("Out two");
  52. m_PluginInfo.PortTips.push_back("Out three");
  53. m_PluginInfo.PortTips.push_back("Out four");
  54. }
  55. SplitterPlugin::~SplitterPlugin()
  56. {
  57. }
  58. PluginInfo &SplitterPlugin::Initialise(const HostInfo *Host)
  59. {
  60. return SpiralPlugin::Initialise(Host);
  61. }
  62. SpiralGUIType *SplitterPlugin::CreateGUI()
  63. {
  64. return NULL;
  65. }
  66. void SplitterPlugin::Execute()
  67. {
  68. // Just copy the data through.
  69. GetOutputBuf(0)->Zero();
  70. GetOutputBuf(3)->Zero();
  71. GetOutputBuf(2)->Zero();
  72. GetOutputBuf(1)->Zero();
  73. if (InputExists(0))
  74. {
  75. GetOutputBuf(0)->Mix(*GetInput(0),0);
  76. GetOutputBuf(1)->Mix(*GetInput(0),0);
  77. GetOutputBuf(2)->Mix(*GetInput(0),0);
  78. GetOutputBuf(3)->Mix(*GetInput(0),0);
  79. }
  80. }