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.

62 lines
1.9KB

  1. /* SpiralSound
  2. * Copyleft (C) 2002 Andy Preston <andy@clublinux.co.uk>
  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 "MeterPlugin.h"
  19. #include "MeterPluginGUI.h"
  20. #include "SpiralIcon.xpm"
  21. extern "C" {
  22. SpiralPlugin* CreateInstance() { return new MeterPlugin; }
  23. char** GetIcon() { return SpiralIcon_xpm; }
  24. int GetID() { return 123; }
  25. }
  26. ///////////////////////////////////////////////////////
  27. MeterPlugin::MeterPlugin() {
  28. m_PluginInfo.Name = "Meter";
  29. m_PluginInfo.Width = 230;
  30. m_PluginInfo.Height = 108;
  31. m_PluginInfo.NumInputs = 1;
  32. m_PluginInfo.NumOutputs = 1;
  33. m_PluginInfo.PortTips.push_back ("Input");
  34. m_PluginInfo.PortTips.push_back ("Output");
  35. }
  36. MeterPlugin::~MeterPlugin() {
  37. }
  38. PluginInfo &MeterPlugin::Initialise (const HostInfo *Host) {
  39. PluginInfo& Info = SpiralPlugin::Initialise (Host);
  40. return Info;
  41. }
  42. SpiralGUIType *MeterPlugin::CreateGUI() {
  43. m_GUI = new MeterPluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_HostInfo);
  44. m_GUI->hide();
  45. return m_GUI;
  46. }
  47. void MeterPlugin::Execute() {
  48. // Just copy the data through.
  49. if (GetOutputBuf (0)) GetOutputBuf (0)->Zero();
  50. if (GetInput (0)) GetOutputBuf (0)->Mix (*GetInput(0), 0);
  51. m_GUI->redraw();
  52. }