changeset 399:7bfed53caacf

- A few changes to get graphics working. In progress.
author tom@acousticscale.org
date Sat, 16 Oct 2010 22:27:03 +0000
parents 3ee03a6b95a0
children dd13c9834ceb
files trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.cc trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.h trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.cc trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h trunk/src/Modules/Output/Graphics/GraphAxisSpec.cc trunk/src/Modules/Output/Graphics/GraphAxisSpec.h trunk/src/Modules/Output/Graphics/GraphicsView.cc trunk/src/Modules/Output/Graphics/GraphicsView.h trunk/src/Modules/Output/Graphics/GraphicsViewTime.cc trunk/src/Modules/Output/Graphics/GraphicsViewTime.h trunk/src/Modules/Output/Graphics/Scale/Scale.cc trunk/src/Modules/Output/Graphics/Scale/Scale.h trunk/src/Support/Common.h
diffstat 13 files changed, 115 insertions(+), 128 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.cc	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.cc	Sat Oct 16 22:27:03 2010 +0000
@@ -18,6 +18,8 @@
 #include "Support/Common.h"
 #include "Modules/Output/Graphics/Devices/GraphicsOutputDevice.h"
 
+namespace aimc {
+
 GraphicsOutputDevice::GraphicsOutputDevice(Parameters *pParam) {
   m_pParam = pParam;
 }
@@ -51,3 +53,4 @@
                                    bool bRotated) {
   gText3f(x, y, 0, sStr, bRotated);
 }
+}  // namespace aimc
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.h	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.h	Sat Oct 16 22:27:03 2010 +0000
@@ -20,6 +20,8 @@
 
 #include "Support/Parameters.h"
 
+namespace aimc {
+
 /*!
  * \class GraphicsOutputDevice "Output/GraphicsOutputDevice.h"
  * \brief General output device class
@@ -61,7 +63,7 @@
  */
 class GraphicsOutputDevice {
  public:
-  GraphicsOutputDevice(AimParameters *pParam);
+  GraphicsOutputDevice(Parameters *pParam);
   virtual ~GraphicsOutputDevice() { };
 
   /*! \brief Initialize the module, sets up everything to Start().
@@ -182,10 +184,10 @@
   //! \brief True when animation is running
   bool m_bRunning;
   //! \brief Parameter store
-  AimParameters *m_pParam;
+  Parameters *m_pParam;
 
   //! \brief Pixel Formats
   enum PixelFormat {AIM_PIX_FMT_RGB24_32, AIM_PIX_FMT_RGB24_24};
 };
-
+}  // namespace aimc
 #endif /* __GRAPHICS_OUTPUT_DEVICE__ */
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.cc	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.cc	Sat Oct 16 22:27:03 2010 +0000
@@ -32,11 +32,12 @@
 #include <stdio.h>
 #include <math.h>
 
-#include "Support/util.h"
-#include "Output/GraphicsOutputDeviceCairo.h"
+#include "Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h"
+
+namespace aimc {
 
 GraphicsOutputDeviceCairo::GraphicsOutputDeviceCairo(Parameters *pParam)
-  : GraphicsOutputDevice(pParam) {
+    : GraphicsOutputDevice(pParam) {
   m_bOutputFile = false;
   m_iFileNumber = 0;
   m_iVertexType = VertexTypeNone;
@@ -281,3 +282,4 @@
   // Finished this one, up to the next!
   m_iFileNumber++;
 }
+}  // namespace aimc
--- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h	Sat Oct 16 22:27:03 2010 +0000
@@ -34,6 +34,8 @@
 
 #include "Modules/Output/Graphics/Devices/GraphicsOutputDevice.h"
 
+namespace aimc {
+
 /*!
  * \class GraphicsOutputDeviceCairo "Output/GraphicsOutputDeviceCairo.h"
  * \brief Output class for output to a graphics file using Cairo
@@ -41,10 +43,9 @@
  * This class outputs a graphics operation to file. It only supports 2d though,
  * so the z-component is ignored.
  */
-class GraphicsOutputDeviceCairo : public GraphicsOutputDevice
-{
+class GraphicsOutputDeviceCairo : public GraphicsOutputDevice {
  public:
-  GraphicsOutputDeviceCairo(AimParameters *pParam);
+  GraphicsOutputDeviceCairo(Parameters *pParam);
   virtual ~GraphicsOutputDeviceCairo();
 
   /*! \brief Initializes this output device, prepares plotting tools.
@@ -129,5 +130,5 @@
   unsigned int m_iHeight;
   bool m_bUseMemoryBuffer;
 };
-
+}  // namespace aimc
 #endif /* __GRAPHICS_OUTPUT_DEVICE_CAIRO_H__ */
--- a/trunk/src/Modules/Output/Graphics/GraphAxisSpec.cc	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/GraphAxisSpec.cc	Sat Oct 16 22:27:03 2010 +0000
@@ -21,6 +21,8 @@
 
 #include "Modules/Output/Graphics/GraphAxisSpec.h"
 
+namespace aimc {
+
 GraphAxisSpec::GraphAxisSpec(float fMin, float fMax, Scale::ScaleType iScale) {
   m_pScale = NULL;
   m_sLabel = NULL;
@@ -50,7 +52,7 @@
 void GraphAxisSpec::SetDisplayScale(Scale::ScaleType iScale) {
   DELETE_IF_NONNULL(m_pScale);
   m_pScale = Scale::Create(iScale);
-  aimASSERT(m_pScale);
+  AIM_ASSERT(m_pScale);
   m_pScale->FromLinearScaledExtrema(m_fMin, m_fMax);
 }
 
@@ -59,7 +61,7 @@
                                float fMin,
                                float fMax,
                                Scale::ScaleType iScale) {
-  AIM_ASSERT(pParam);
+  AIM_ASSERT(parameters);
   AIM_ASSERT(sPrefix && sPrefix[0]!='\0');
   char sParamName[Parameters::MaxParamNameLength];
 
@@ -68,7 +70,7 @@
   snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]),
           "%s.min",
           sPrefix);
-  if (pParam->IsSet(sParamName)) {
+  if (parameters->IsSet(sParamName)) {
     if (strcmp(parameters->GetString(sParamName), "auto") == 0)
       m_fMin = fMin;
     else
@@ -79,7 +81,7 @@
   snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]),
           "%s.max",
           sPrefix);
-  if (pParam->IsSet(sParamName)) {
+  if (parameters->IsSet(sParamName)) {
     if (strcmp(parameters->GetString(sParamName), "auto")==0)
       m_fMax = fMax;
     else
@@ -94,7 +96,7 @@
   snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]),
            "%s.scale",
            sPrefix);
-  if (pParam->IsSet(sParamName)) {
+  if (parameters->IsSet(sParamName)) {
     // Scale change, we updated min/max values already so no need to
     Scale::ScaleType iThisScale;
     const char *sVal = parameters->GetString(sParamName);
@@ -107,7 +109,7 @@
     else if (strcmp(sVal, "log")==0)
       iThisScale = Scale::SCALE_LOG;
     else {
-      AIM_ERROR(_T("Unrecognized scale type in parameter '%s': '%s'"),
+      LOG_ERROR(_T("Unrecognized scale type in parameter '%s': '%s'"),
                   sParamName,
                   sVal);
       return false;
@@ -124,3 +126,4 @@
 
   return true;
 }
+}  // namespace aimc
--- a/trunk/src/Modules/Output/Graphics/GraphAxisSpec.h	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/GraphAxisSpec.h	Sat Oct 16 22:27:03 2010 +0000
@@ -21,6 +21,8 @@
 #include "Support/Parameters.h"
 #include "Modules/Output/Graphics/Scale/Scale.h"
 
+namespace aimc {
+
 /*! \class GraphAxisSpec "Output/GraphAxisSpec.h"
  *  \brief Axis specification for a GraphicsView
  */
@@ -85,4 +87,6 @@
   friend class GraphicsViewTime;
 };
 
+}  // namespace aimc
+
 #endif /* __GRAPH_AXIS_SPEC_H__ */
--- a/trunk/src/Modules/Output/Graphics/GraphicsView.cc	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/GraphicsView.cc	Sat Oct 16 22:27:03 2010 +0000
@@ -15,10 +15,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <algorithm>
+
 #include "Support/Common.h"
 
-#include "Output/GraphicsView.h"
-#include "Output/GraphicsOutputDevice.h"
+#include "Modules/Output/Graphics/GraphicsView.h"
+#include "Modules/Output/Graphics/Devices/GraphicsOutputDevice.h"
+
+namespace aimc {
 
 GraphicsView::GraphicsView(Parameters *parameters) : Module(parameters) {
   module_description_ = "";
@@ -34,12 +38,16 @@
   AIM_ASSERT(m_pAxisY);
   m_pAxisFreq = new GraphAxisSpec();
   AIM_ASSERT(m_pAxisFreq);
+  initialized_ = true;
 
-  m_pAxisY->Initialize(m_pParam,
-                       _S("graph.y"),
-                       -1,
-                       1,
-                       Scale::SCALE_LINEAR);
+  if (!m_pAxisY->Initialize(m_pParam,
+                            _S("graph.y"),
+                            -1,
+                            1,
+                            Scale::SCALE_LINEAR)) {
+    LOG_ERROR("Axis initialization failed");
+    initialized_ = false;
+  }
   m_fMarginLeft = m_pParam->GetFloat(_S("graph.margin.left"));
   m_fMarginRight = m_pParam->GetFloat(_S("graph.margin.right"));
   m_fMarginTop = m_pParam->GetFloat(_S("graph.margin.top"));
@@ -54,8 +62,8 @@
   else if (strcmp(sGraphType, _S("none"))==0)
     m_iGraphType = GraphTypeNone;
   else {
-    ret = false;
-    AIM_ERROR(_T("Unrecognized graph type: '%s'"), sGraphType);
+    LOG_ERROR(_T("Unrecognized graph type: '%s'"), sGraphType);
+    initialized_ = false;
   }
 
   if (strcmp(m_pParam->GetString(_S("graph.mindistance")),"auto") == 0)
@@ -63,7 +71,6 @@
     m_fMinPlotDistance = -1;
   else
     m_fMinPlotDistance = m_pParam->GetFloat(_S("graph.mindistance"));
-
 }
 
 GraphicsView::~GraphicsView() {
@@ -72,7 +79,8 @@
   DELETE_IF_NONNULL(m_pAxisFreq);
 }
 
-bool
+void GraphicsView::ResetInternal() {
+}
 
 bool GraphicsView::InitializeInternal(const SignalBank &bank) {
   if (!m_pDev) {
@@ -105,10 +113,11 @@
   /* Inform graphics output of maximum number of vertices between
    * gBegin*() and gEnd(), for any type of plot. Colormap needs most.
    */
-  if (!m_pDev->Initialize(MAX(10, bank.buffer_length() * 2 + 2))) {
+  if (!m_pDev->Initialize(std::max<int>(10, bank.buffer_length() * 2 + 2))) {
     LOG_ERROR("");
     return false;
   }
+  return true;
 }
 
 void GraphicsView::Process(const SignalBank &bank) {
@@ -133,7 +142,7 @@
     // Scale to single channel graphing.
     yOffs = yOffs * (1.0f - height) + height / 2.0;
     yOffs = yOffs * (1.0f - m_fMarginTop - m_fMarginBottom) + m_fMarginBottom;
-    PlotData(bank[i], yOffs, heightMinMargin, xScaling);
+    PlotData(bank[i], bank.sample_rate(), yOffs, heightMinMargin, xScaling);
   }
   m_pDev->gRelease();
 }
@@ -190,7 +199,7 @@
    */
   if (!m_bFirstPoint
       && !isLast
-      && fabs(m_fPrevVal-val) < m_fMinPlotDistance) {
+      && abs(m_fPrevVal-val) < m_fMinPlotDistance) {
     m_iPrevValEqual++;
     // Don't set m_fPrevVal to avoid not catching slow changes
     m_fPrevX = x;
@@ -232,3 +241,4 @@
     AIM_ASSERT(0);
   }
 }
+}  // namespace aimc
--- a/trunk/src/Modules/Output/Graphics/GraphicsView.h	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/GraphicsView.h	Sat Oct 16 22:27:03 2010 +0000
@@ -27,12 +27,15 @@
 #ifndef __GRAPHICS_VIEW_H__
 #define __GRAPHICS_VIEW_H__
 
+#include "Support/Module.h"
 #include "Support/Parameters.h"
 #include "Support/SignalBank.h"
 #include "Modules/Output/Graphics/Scale/Scale.h"
 #include "Modules/Output/Graphics/Devices/GraphicsOutputDevice.h"
 #include "Modules/Output/Graphics/GraphAxisSpec.h"
 
+namespace aimc {
+
 /*!
  * \class GraphicsView "Modules/Output/Graphics/GraphicsView.h"
  * \brief General graphics view module
@@ -69,7 +72,7 @@
    *  using it for plotting.
    */
   virtual bool InitializeInternal(const SignalBank &bank);
-
+  virtual void ResetInternal();
   /*! \brief Set the axes' scale
    *  \param iXScale Scale type of the horizontal axis
    *  \param iYScale Scale type of the vertical axis for signal data
@@ -92,6 +95,7 @@
    *  \param xScale Scaling in x-direction. 1.0 makes it cover the whole length. 0.5 only the left half.
    */
   virtual void PlotData(const vector<float> &signal,
+			float sample_rate,
                         float yOffset,
                         float height,
                         float xScale) = 0;
@@ -177,6 +181,8 @@
   float m_fPrevVal, m_fPrevX, m_fPrevY, m_fPrevHeight;
   //! \brief Number of times m_fValPrev was within range m_fMinPlotDistance
   int m_iPrevValEqual;
+
+  bool initialized_;
 };
-
+}  // namespace aimc
 #endif /* __GRAPHICS_VIEW_H__ */
--- a/trunk/src/Modules/Output/Graphics/GraphicsViewTime.cc	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/GraphicsViewTime.cc	Sat Oct 16 22:27:03 2010 +0000
@@ -32,6 +32,8 @@
 #include "Modules/Output/Graphics/GraphicsView.h"
 #include "Modules/Output/Graphics/GraphicsViewTime.h"
 
+namespace aimc {
+
 GraphicsViewTime::GraphicsViewTime(Parameters *pParam)
   : GraphicsView(pParam) {
 }
@@ -72,25 +74,19 @@
            m_pAxisFreq->m_fMin, m_pAxisFreq->m_fMax,
            m_pAxisFreq->m_pScale->getName());
   m_pDev->gText2f(0.0025f, 0.35f, sTxt, true);
-  if (m_bPlotScaled) {
-    snprintf(sTxt, sizeof(sTxt) / sizeof(sTxt[0]),
-             _S("%s [cycles, %s scale]"),
-             m_pAxisX->m_sLabel ? m_pAxisX->m_sLabel : "",
-             m_pAxisX->m_pScale->getName());
-  } else {
-    snprintf(sTxt, sizeof(sTxt) / sizeof(sTxt[0]),
-             _S("%s [%.2f..%.2f ms, %s scale]"),
-             m_pAxisX->m_sLabel ? m_pAxisX->m_sLabel : "",
-             m_pAxisX->m_fMin,
-             m_pAxisX->m_fMax,
-             m_pAxisX->m_pScale->getName());
-  }
+  snprintf(sTxt, sizeof(sTxt) / sizeof(sTxt[0]),
+	   _S("%s [%.2f..%.2f ms, %s scale]"),
+	   m_pAxisX->m_sLabel ? m_pAxisX->m_sLabel : "",
+	   m_pAxisX->m_fMin,
+	   m_pAxisX->m_fMax,
+	   m_pAxisX->m_pScale->getName());
+ 
   m_pDev->gText2f(m_fMarginLeft, 0.0025f, sTxt, false);
 
   // Frame time
-  snprintf(sTxt, sizeof(sTxt)/sizeof(sTxt[0]), _S("t=%.0f ms"),
-           pBank->getSampleTime(0));
-  m_pDev->gText2f(0.8f, 0.0025f, sTxt, false);
+  //snprintf(sTxt, sizeof(sTxt)/sizeof(sTxt[0]), _S("t=%.0f ms"),
+  //         pBank->getSampleTime(0));
+  //m_pDev->gText2f(0.8f, 0.0025f, sTxt, false);
 }
 
 void GraphicsViewTime::PlotData(const vector<float> &signal,
@@ -98,7 +94,6 @@
                                 float yOffset,
                                 float height,
                                 float xScale) {
-  AIM_ASSERT(pSig);
   AIM_ASSERT(xScale >= 0 && xScale <= 1);
   AIM_ASSERT(height > 0  && height <= 1);
   AIM_ASSERT(yOffset >= 0 && yOffset <= 1);
@@ -113,7 +108,7 @@
   // Draw the signal.
   float x = 0;
   float y = 0;
-  for (int i = 0; i < signal.size(); i++) {
+  for (unsigned int i = 0; i < signal.size(); i++) {
     // Find out where to draw and do so
     x = xScale * i;
     y = signal[i];
@@ -137,3 +132,4 @@
 
   m_pDev->gEnd();
 }
+}  // namespace aimc
--- a/trunk/src/Modules/Output/Graphics/GraphicsViewTime.h	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/GraphicsViewTime.h	Sat Oct 16 22:27:03 2010 +0000
@@ -12,11 +12,11 @@
 #ifndef __GRAPHICS_VIEW_TIME_H__
 #define __GRAPHICS_VIEW_TIME_H__
 
-#include "Support/Signal.h"
 #include "Support/SignalBank.h"
-#include "Output/GraphicsOutputDevice.h"
-#include "Output/GraphicsView.h"
+#include "Modules/Output/Graphics/Devices/GraphicsOutputDevice.h"
+#include "Modules/Output/Graphics/GraphicsView.h"
 
+namespace aimc {
 /*!
  * \class GraphicsViewTime "Output/GraphicsViewTime.h"
  * \brief Time-definition graphics view class
@@ -28,16 +28,19 @@
   /*! \brief Create a new view
    *  \param pParam Main parameter store
    */
-  GraphicsViewTime(AimParameters *pParam);
+  GraphicsViewTime(Parameters *pParam);
   virtual ~GraphicsViewTime() { };
 
   virtual GraphicsViewTime *Clone(GraphicsOutputDevice *pDev);
 
 private:
-  void PlotData(Signal* pSig, float yOffset, float height, float xScale = 1.0);
-  void PlotAxes(Signal* pSig);
-  void PlotAxes(SignalBank* pBank);
-
+  void PlotData(const vector<float> &signal,
+		float sample_rate,
+		float yOffset,
+		float height,
+		float xScale = 1.0);
+  void PlotAxes(const vector<float> &signal);
+  void PlotAxes(const SignalBank &pBank);
 };
-
+}  // namesapce aimc
 #endif /* __GRAPHICS_VIEW_TIME_H__ */
--- a/trunk/src/Modules/Output/Graphics/Scale/Scale.cc	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/Scale/Scale.cc	Sat Oct 16 22:27:03 2010 +0000
@@ -9,16 +9,17 @@
 /* (c) 2006, University of Cambridge, Medical Research Council
  * http://www.pdn.cam.ac.uk/groups/cnbh/aimmanual
  */
-#include "Support/common.h"
-#include "Support/util.h"
-#include "Modules/Scale/Scale.h"
-#include "Modules/Scale/ScaleLinear.h"
-#include "Modules/Scale/ScaleERB.h"
-#include "Modules/Scale/ScaleLog.h"
-#include "Modules/Scale/ScaleLogScaled.h"
+#include "Support/Common.h"
+#include "Modules/Output/Graphics/Scale/Scale.h"
+#include "Modules/Output/Graphics/Scale/ScaleLinear.h"
+#include "Modules/Output/Graphics/Scale/ScaleERB.h"
+#include "Modules/Output/Graphics/Scale/ScaleLog.h"
+#include "Modules/Output/Graphics/Scale/ScaleLogScaled.h"
 
-Scale *Scale::Create(ScaleType iType, unsigned int min, unsigned int max, float density)
-{
+Scale *Scale::Create(ScaleType iType,
+		     unsigned int min,
+		     unsigned int max,
+		     float density) {
   switch(iType) {
   case SCALE_LINEAR:
     return static_cast<Scale*>(new ScaleLinear(min, max, density));
@@ -37,30 +38,27 @@
   return NULL;
 }
 
-Scale *Scale::Create(ScaleType iType)
-{
+Scale *Scale::Create(ScaleType iType) {
   return Create(iType, 0, 0, 0);
 }
 
-Scale *Scale::Clone()
-{
+Scale *Scale::Clone() {
   Scale *pScale = Create(m_iType, m_iMin, m_iMax, m_fDensity);
-  aimASSERT(pScale);
+  AIM_ASSERT(pScale);
   pScale->m_fScaledCurHalfSum = m_fScaledCurHalfSum;
   pScale->m_fScaledCurDiff = m_fScaledCurDiff;
   return pScale;
 }
 
-float Scale::FromLinearScaled(float fVal)
-{
+float Scale::FromLinearScaled(float fVal) {
   /*! This function returns
    *    ( FromLinear(fVal) - (fMinScaled+fMaxScaled)/2 ) / (fMaxScaled-fMinScaled)
    */
   float fValScaled = FromLinear(fVal);
   return (fValScaled - m_fScaledCurHalfSum) / m_fScaledCurDiff;
 }
-void Scale::FromLinearScaledExtrema(float fMin, float fMax)
-{
+
+void Scale::FromLinearScaledExtrema(float fMin, float fMax) {
   float fMinScaled = FromLinear(fMin);
   float fMaxScaled = FromLinear(fMax);
   m_fScaledCurHalfSum = (fMinScaled+fMaxScaled)/2;
@@ -68,39 +66,8 @@
   m_fMin = fMin;
   m_fMax = fMax;
 }
-void Scale::FromLinearScaledExtrema(Scale *pScale)
-{
+
+void Scale::FromLinearScaledExtrema(Scale *pScale) {
   aimASSERT(pScale);
   FromLinearScaledExtrema(pScale->m_fMin, pScale->m_fMax);
 }
-
-SignalBank* Scale::CreateSignalBank(unsigned int iChannels, unsigned int iBufferlength, unsigned int iSamplerate)
-{
-  SignalBank *pBank;
-  double intpart, fracpart;
-  fracpart = modf((m_iMax-m_iMin)*m_fDensity, &intpart);
-  unsigned int nBankChan = (unsigned int) intpart;
-  if (fracpart >= 0.5f)
-        nBankChan++;
-
-  pBank = new SignalBank(iChannels, iBufferlength, iSamplerate, nBankChan);
-  aimASSERT(pBank);
-
-  float scaleDelta = ( FromLinear(m_iMax) - FromLinear(m_iMin) ) / (nBankChan-1);
-  float scaleCur = FromLinear(m_iMin);
-
-  for (unsigned int i=0; i<nBankChan; i++) {
-    pBank->setCentreFrequency(i, ToLinear(scaleCur));
-    scaleCur+=scaleDelta;
-  }
-
-  return pBank;
-}
-
-
-
-SignalBank* Scale::CreateSignalBank(Signal* pSig) {
-  aimASSERT(pSig);
-  return CreateSignalBank(pSig->getAudioChannels(), pSig->getBufferlength(), pSig->getSamplerate());
-}
-
--- a/trunk/src/Modules/Output/Graphics/Scale/Scale.h	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Modules/Output/Graphics/Scale/Scale.h	Sat Oct 16 22:27:03 2010 +0000
@@ -114,24 +114,6 @@
    */
   void FromLinearScaledExtrema(Scale *pScale);
 
-  /*! \brief Create a new signal bank
-   *  \param iChannels Number of audio channels
-   *  \param iBufferlength Length of the buffer in frames
-   *  \param iSamplerate Samplerate in Hz
-   *  Note that the caller must free the signal bank again.
-   */
-  virtual SignalBank* CreateSignalBank(unsigned int iChannels, unsigned int iBufferlength, unsigned int iSamplerate);
-
-  /*! \overload
-   *  \brief Create a signal bank based on a Signal's parameters
-   *  \param pSig Signal to get parameters from
-   *  pSig is only used to look at parameters like samplerate, nothing is done
-   *  with its contents.
-   *  Note that the caller must free the signal bank again.
-   */
-  virtual SignalBank* CreateSignalBank(/*! \todo const*/ Signal* pSig);
-
-
 protected:
   //! \brief Bottom frequency
   unsigned int m_iMin;
--- a/trunk/src/Support/Common.h	Fri Oct 15 05:46:53 2010 +0000
+++ b/trunk/src/Support/Common.h	Sat Oct 16 22:27:03 2010 +0000
@@ -46,6 +46,14 @@
 #  endif
 #endif
 
+#if !defined(_S)
+#  ifdef _UNICODE
+#    define _S(x) L ## x
+#  else
+#    define _S(x) x
+#  endif
+#endif
+
 /*! \brief C++ delete if != NULL
  *
  *  This was used so often, that is was moved to a macro.