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.

82 lines
1.9KB

  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 "ScopePlugin.h"
  19. #include "ScopePluginGUI.h"
  20. #include <FL/Fl_Button.h>
  21. #include "SpiralIcon.xpm"
  22. extern "C" {
  23. SpiralPlugin* CreateInstance()
  24. {
  25. return new ScopePlugin;
  26. }
  27. char** GetIcon()
  28. {
  29. return SpiralIcon_xpm;
  30. }
  31. int GetID()
  32. {
  33. return 0x0001;
  34. }
  35. }
  36. ///////////////////////////////////////////////////////
  37. ScopePlugin::ScopePlugin()
  38. {
  39. m_PluginInfo.Name="Scope";
  40. m_PluginInfo.Width=220;
  41. m_PluginInfo.Height=125;
  42. m_PluginInfo.NumInputs=1;
  43. m_PluginInfo.NumOutputs=1;
  44. m_PluginInfo.PortTips.push_back("Input");
  45. m_PluginInfo.PortTips.push_back("Output");
  46. }
  47. ScopePlugin::~ScopePlugin()
  48. {
  49. }
  50. PluginInfo &ScopePlugin::Initialise(const HostInfo *Host)
  51. {
  52. PluginInfo& Info = SpiralPlugin::Initialise(Host);
  53. return Info;
  54. }
  55. SpiralGUIType *ScopePlugin::CreateGUI()
  56. {
  57. m_GUI = new ScopePluginGUI(m_PluginInfo.Width,
  58. m_PluginInfo.Height,
  59. this,m_HostInfo);
  60. m_GUI->hide();
  61. return m_GUI;
  62. }
  63. void ScopePlugin::Execute()
  64. {
  65. // Just copy the data through.
  66. if (GetOutputBuf(0)) GetOutputBuf(0)->Zero();
  67. if (GetInput(0)) GetOutputBuf(0)->Mix(*GetInput(0),0);
  68. m_GUI->redraw();
  69. }