A few type fixes.
[ardour.git] / libs / ardour / ardour / click.h
index 71214978a56a7779ccaeb18d5a39b1eb547457ed..5ee1d5019410ef2e6c99dce77e5d7f71a91a7742 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2004 Paul Davis 
+    Copyright (C) 2009 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #ifndef __ardour_click_h__
 #define __ardour_click_h__
 
-#include <ardour/io.h>
+#include <list>
+
+#include "pbd/pool.h"
+#include "ardour/types.h"
+#include "ardour/io.h"
 
 namespace ARDOUR {
 
-class ClickIO : public IO
-{
-  public:
-       ClickIO (Session& s, const string& name, 
+struct Click {
+    nframes_t start;
+    nframes_t duration;
+    nframes_t offset;
+    const Sample *data;
 
-              int input_min = -1, int input_max = -1, 
+    Click (nframes_t s, nframes_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {}
+    
+    void *operator new (size_t) {
+           return pool.alloc ();
+    };
+    
+    void operator delete(void *ptr, size_t /*size*/) {
+           pool.release (ptr);
+    }
+    
+private:
+    static Pool pool;
+};
 
-              int output_min = -1, int output_max = -1)
-       : IO (s, name, input_min, input_max, output_min, output_max) {}
+typedef std::list<Click*> Clicks;
 
+class ClickIO : public IO
+{
+  public:
+       ClickIO (Session& s, const std::string& name) : IO (s, name, IO::Output) {}
        ~ClickIO() {}
-
+       
   protected:
        uint32_t pans_required () const { return 1; }
 };