mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-16 04:06:04 +02:00
relocate mute button, audio scope
This commit is contained in:
parent
f06b30e024
commit
7ce380a333
5 changed files with 7 additions and 37 deletions
|
@ -2487,14 +2487,13 @@ void Application::displayOverlay() {
|
|||
}
|
||||
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
|
||||
_audio.renderMuteIcon(1, _glWidget->height() - 50);
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Oscilloscope)) {
|
||||
int oscilloscopeTop = Menu::getInstance()->isOptionChecked(MenuOption::Mirror) ? 130 : 25;
|
||||
int oscilloscopeTop = _glWidget->height() - 135;
|
||||
_audioScope.render(25, oscilloscopeTop);
|
||||
}
|
||||
}
|
||||
|
||||
//noiseTest(_glWidget->width(), _glWidget->height());
|
||||
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::HeadMouse)) {
|
||||
_myAvatar->renderHeadMouse();
|
||||
}
|
||||
|
|
|
@ -40,10 +40,7 @@ static const float AUDIO_CALLBACK_MSECS = (float) NETWORK_BUFFER_LENGTH_SAMPLES_
|
|||
static const int NUMBER_OF_NOISE_SAMPLE_FRAMES = 300;
|
||||
|
||||
// Mute icon configration
|
||||
static const int ICON_SIZE = 24;
|
||||
static const int ICON_LEFT = 0;
|
||||
static const int ICON_TOP = 115;
|
||||
static const int ICON_TOP_MIRROR = 220;
|
||||
static const int MUTE_ICON_SIZE = 24;
|
||||
|
||||
Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples, QObject* parent) :
|
||||
AbstractAudioInterface(parent),
|
||||
|
@ -706,11 +703,9 @@ void Audio::handleAudioByteArray(const QByteArray& audioByteArray) {
|
|||
// or send to the mixer and use delayed loopback
|
||||
}
|
||||
|
||||
void Audio::renderToolIcon(int screenHeight) {
|
||||
void Audio::renderMuteIcon(int x, int y) {
|
||||
|
||||
int iconTop = Menu::getInstance()->isOptionChecked(MenuOption::Mirror) ? ICON_TOP_MIRROR : ICON_TOP;
|
||||
|
||||
_iconBounds = QRect(ICON_LEFT, iconTop, ICON_SIZE, ICON_SIZE);
|
||||
_iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, _micTextureId);
|
||||
|
|
|
@ -68,6 +68,8 @@ public:
|
|||
void init(QGLWidget *parent = 0);
|
||||
bool mousePressEvent(int x, int y);
|
||||
|
||||
void renderMuteIcon(int x, int y);
|
||||
|
||||
public slots:
|
||||
void start();
|
||||
void addReceivedAudioToBuffer(const QByteArray& audioByteArray);
|
||||
|
@ -146,7 +148,6 @@ private:
|
|||
// Add sounds that we want the user to not hear themselves, by adding on top of mic input signal
|
||||
void addProceduralSounds(int16_t* monoInput, int numSamples);
|
||||
|
||||
void renderToolIcon(int screenHeight);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -226,29 +226,6 @@ void drawVector(glm::vec3 * vector) {
|
|||
|
||||
}
|
||||
|
||||
// Render a 2D set of squares using perlin/fractal noise
|
||||
void noiseTest(int w, int h) {
|
||||
const float CELLS = 500;
|
||||
const float NOISE_SCALE = 10.0;
|
||||
float xStep = (float) w / CELLS;
|
||||
float yStep = (float) h / CELLS;
|
||||
glBegin(GL_QUADS);
|
||||
for (float x = 0; x < (float)w; x += xStep) {
|
||||
for (float y = 0; y < (float)h; y += yStep) {
|
||||
// Generate a vector varying between 0-1 corresponding to the screen location
|
||||
glm::vec2 position(NOISE_SCALE * x / (float) w, NOISE_SCALE * y / (float) h);
|
||||
// Set the cell color using the noise value at that location
|
||||
float color = glm::perlin(position);
|
||||
glColor4f(color, color, color, 1.0);
|
||||
glVertex2f(x, y);
|
||||
glVertex2f(x + xStep, y);
|
||||
glVertex2f(x + xStep, y + yStep);
|
||||
glVertex2f(x, y + yStep);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
void renderWorldBox() {
|
||||
// Show edge of world
|
||||
float red[] = {1, 0, 0};
|
||||
|
|
|
@ -35,8 +35,6 @@ void drawtext(int x, int y, float scale, float rotate, float thick, int mono,
|
|||
void drawvec3(int x, int y, float scale, float rotate, float thick, int mono, glm::vec3 vec,
|
||||
float r=1.0, float g=1.0, float b=1.0);
|
||||
|
||||
void noiseTest(int w, int h);
|
||||
|
||||
void drawVector(glm::vec3* vector);
|
||||
|
||||
void printVector(glm::vec3 vec);
|
||||
|
|
Loading…
Reference in a new issue