#include "MainDialog.h"
#include "qapplication.h"
#include "qradiobutton.h"
#include "qpushbutton.h"
#include "qprogressbar.h"
#include "qslider.h"
#include "qaccel.h"
#include "Jukebox.h"
#include "Logger.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>
Include dependency graph for MainDialog.cpp:
Go to the source code of this file.
Functions | |
int | get_fifo_priority (bool notMax) |
return fifo priority for streambd. | |
int | set_fifo_priority (bool half) |
Set fifo priority (if user has sufficient privileges). | |
Variables | |
Snd * | theSnd |
|
return fifo priority for streambd.
Definition at line 247 of file MainDialog.cpp. Referenced by set_fifo_priority(). 00248 { 00249 int min, max, priority; 00250 00251 min = sched_get_priority_min (SCHED_FIFO); 00252 max = sched_get_priority_max (SCHED_FIFO); 00253 if (notMax) 00254 priority = min + (max - min) / 2; 00255 else 00256 priority = max; 00257 // priority=min; 00258 return priority; 00259 }
|
|
Set fifo priority (if user has sufficient privileges).
Definition at line 264 of file MainDialog.cpp. References get_fifo_priority(). Referenced by FileWvIn::run(). 00265 { 00266 struct sched_param p; 00267 int priority; 00268 // scheduling priority 00269 00270 00271 if (true) // (!getuid () || !geteuid ()) 00272 { 00273 priority = get_fifo_priority (half); 00274 p.sched_priority = priority; 00275 00276 if (sched_setscheduler (0, SCHED_FIFO, &p) == -1) 00277 { 00278 fprintf (stderr, 00279 "\ncould not activate scheduling with priority %d\n", 00280 priority); 00281 return -1; 00282 } 00283 seteuid (getuid ()); 00284 // fprintf (stderr, 00285 // "\nset scheduling priority to %d (SCHED_FIFO)\n", 00286 // priority); 00287 } 00288 else 00289 { 00290 fprintf (stderr, 00291 "\ninsufficient privileges to set scheduling priority\n"); 00292 priority = 0; 00293 } 00294 return priority; 00295 }
Here is the call graph for this function: |
|
|