Commit 684dc2ff authored by Adam Honse's avatar Adam Honse

Use DeviceUpdateLEDs for now so that the threading behavior doesn't corrupt packets

parent 650ddc14
......@@ -11,7 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = KeyboardVisualizer
TEMPLATE = app
#LIBS += -lopenal
unix:LIBS += -lopenal
DISTFILES +=
......
......@@ -69,9 +69,8 @@ THREAD netupdthread(void *param)
THREAD ledthread(void *param)
{
ledthread_arg_type* args = static_cast<ledthread_arg_type*>(param);
Visualizer* vis = static_cast<Visualizer*>(args->vis);
vis->LEDUpdateThread(args->controller);
Visualizer* vis = static_cast<Visualizer*>(param);
vis->LEDUpdateThread();
THREADRETURN
}
......@@ -737,14 +736,7 @@ void Visualizer::StartThread()
pthread_create(&threads[0], NULL, &thread, this);
pthread_create(&threads[1], NULL, &netconthread, this);
pthread_create(&threads[2], NULL, &netupdthread, this);
//for(int c = 0; c < rgb_controllers.size(); c++)
//{
ledthread_arg_type arg;
arg.vis = this;
arg.controller = 0;
pthread_create(&threads[3], NULL, &ledthread, &arg);
//}
pthread_create(&threads[3], NULL, &ledthread, this);
#endif
}
......@@ -1423,7 +1415,7 @@ void Visualizer::VisThread()
}
}
void Visualizer::LEDUpdateThread( unsigned int q )
void Visualizer::LEDUpdateThread()
{
while(1)
{
......@@ -1470,7 +1462,7 @@ void Visualizer::LEDUpdateThread( unsigned int q )
break;
}
}
rgb_controllers[c]->UpdateLEDs();
rgb_controllers[c]->DeviceUpdateLEDs();
}
Sleep(delay);
......
......@@ -225,7 +225,7 @@ private:
void DrawSingleColorForeground(float amplitude, vis_pixels *fg_pixels, vis_pixels *out_pixels);
public:
void LEDUpdateThread( unsigned int c );
void LEDUpdateThread();
};
#endif
Subproject commit a755be10ff618d15c61bf30565bb0b842cb775c1
Subproject commit b3482b4230b2819aabd853aa6de08aa4dda7a34d
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment