00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <stdio.h>
00020 #include <stdlib.h>
00021 #include <string.h>
00022 #include <config.h>
00023 #include <gui.h>
00024 #include <jutils.h>
00025
00026 #ifdef WITH_DMALLOC
00027 #include <dmalloc.h>
00028 #endif
00029
00030 GUI::GUI(int argc, char **argv, Stream_mixer *mix) {
00031
00032
00033
00034
00035
00036 if(pthread_mutex_init (&_mutex,NULL) == -1)
00037 error("error initializing POSIX thread mutex");
00038 if(pthread_cond_init (&_cond, NULL) == -1)
00039 error("error initializing POSIX thread condtition");
00040
00041 _mix = mix;
00042
00043 quit = false;
00044 for(int i=0;i<MAX_CHANNELS;i++) {
00045 ch_pos[i] = 0.0;
00046
00047 memset(ch_lcd[i],0,8);
00048 }
00049
00050 }
00051
00052 GUI::~GUI() {
00053
00054
00055
00056
00057
00058
00059 if(pthread_mutex_destroy(&_mutex) == -1)
00060 error("error destroying POSIX thread mutex");
00061 if(pthread_cond_destroy(&_cond) == -1)
00062 error("error destroying POSIX thread condition");
00063 }