Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members  

gui.h

00001 /* MuSE - Multiple Streaming Engine
00002  * Copyright (C) 2000-2002 Denis Roio aka jaromil <jaromil@dyne.org>
00003  *
00004  * This source code is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Public License as published 
00006  * by the Free Software Foundation; either version 2 of the License,
00007  * or (at your option) any later version.
00008  *
00009  * This source code is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00012  * Please refer to the GNU Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Public License along with
00015  * this source code; if not, write to:
00016  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  *
00018  * GUI parent class
00019  *
00020  */
00021 
00022 #ifndef __GUI_H__
00023 #define __GUI_H__
00024 
00025 #include <pthread.h>
00026 #include <generic.h>
00027 
00028 class Stream_mixer;
00029 
00030 class GUI {
00031  public:
00032   GUI(int argc, char **argv, Stream_mixer *mix);
00033 
00034   virtual ~GUI();
00035   
00036   /* pthread stuff */
00037   virtual void run() =0;
00038   void start() { pthread_create(&_thread, NULL, &kickoff, this); };
00039 
00040   void lock() { pthread_mutex_lock(&_mutex); };
00041   void unlock() { pthread_mutex_unlock(&_mutex); };
00042   void wait() { pthread_cond_wait(&_cond,&_mutex); };
00043   void signal() { pthread_cond_signal(&_cond); };
00044   //  void destroy() { _thread_destroy(); };
00045   /* ------------- */
00046 
00047   virtual void set_lcd(unsigned int chan, char *lcd) =0;
00048   virtual void set_pos(unsigned int chan, float pos) =0;
00049 
00050   virtual void set_title(char *txt) =0;
00051   virtual void set_status(char *txt) =0;
00052   virtual void add_playlist(unsigned int ch, char *txt) =0;
00053   virtual void sel_playlist(unsigned int ch, int row) =0;
00054 
00055   virtual void bpsmeter_set(int n) =0;
00056   virtual void vumeter_set(int n) =0;
00057 
00058   virtual bool meter_shown() =0;
00059 
00060   virtual void lameversion(char *str) { };
00061 
00062   bool quit;
00063   Stream_mixer *_mix;
00064 
00065   float ch_pos[MAX_CHANNELS];
00066   char ch_lcd[MAX_CHANNELS][10];
00067 
00068  private:
00069   pthread_t _thread;
00070   pthread_mutex_t _mutex;
00071   pthread_cond_t _cond;
00072 
00073  protected:
00074   static void* kickoff(void *arg) { ((GUI *) arg)->run(); return NULL; };
00075 
00076 };
00077 
00078 #endif

Generated on Thu Dec 16 12:28:21 2004 for MuSE by doxygen1.3