get rid of 'using namespace NCurses' directive

This commit is contained in:
Andrzej Rybczak
2012-09-02 15:37:42 +02:00
parent 6f59a175ec
commit d47cad1d50
58 changed files with 607 additions and 613 deletions

View File

@@ -22,8 +22,6 @@
#ifdef ENABLE_VISUALIZER
#include "global.h"
#include <cerrno>
#include <cmath>
#include <cstring>
@@ -33,6 +31,10 @@
#include <sys/time.h>
#include <unistd.h>
#include "global.h"
#include "settings.h"
#include "status.h"
using Global::MainStartY;
using Global::MainHeight;
@@ -42,7 +44,7 @@ const int Visualizer::WindowTimeout = 1000/25; /* 25 fps */
void Visualizer::Init()
{
w = new Window(0, MainStartY, COLS, MainHeight, "", Config.visualizer_color, brNone);
w = new NC::Window(0, MainStartY, COLS, MainHeight, "", Config.visualizer_color, NC::brNone);
ResetFD();
itsSamples = Config.visualizer_in_stereo ? 4096 : 2048;
@@ -173,7 +175,7 @@ void Visualizer::DrawSoundWave(int16_t *buf, ssize_t samples, size_t y_offset, s
point_pos /= samples_per_col;
point_pos /= std::numeric_limits<int16_t>::max();
point_pos *= half_height;
*w << XY(i, y_offset+half_height+point_pos) << Config.visualizer_chars[0];
*w << NC::XY(i, y_offset+half_height+point_pos) << Config.visualizer_chars[0];
if (i && abs(prev_point_pos-point_pos) > 2)
{
// if gap is too big. intermediate values are needed
@@ -181,7 +183,7 @@ void Visualizer::DrawSoundWave(int16_t *buf, ssize_t samples, size_t y_offset, s
const int breakpoint = std::max(prev_point_pos, point_pos);
const int half = (prev_point_pos+point_pos)/2;
for (int k = std::min(prev_point_pos, point_pos)+1; k < breakpoint; k += 2)
*w << XY(i-(k < half), y_offset+half_height+k) << Config.visualizer_chars[0];
*w << NC::XY(i-(k < half), y_offset+half_height+k) << Config.visualizer_chars[0];
}
prev_point_pos = point_pos;
}
@@ -215,7 +217,7 @@ void Visualizer::DrawFrequencySpectrum(int16_t *buf, ssize_t samples, size_t y_o
const size_t start_y = y_offset > 0 ? y_offset : height-bar_height;
const size_t stop_y = std::min(bar_height+start_y, w->GetHeight());
for (size_t j = start_y; j < stop_y; ++j)
*w << XY(i, j) << Config.visualizer_chars[1];
*w << NC::XY(i, j) << Config.visualizer_chars[1];
}
}
#endif // HAVE_FFTW3_H