00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <gdk/gdk.h>
00024 #include <gtk/gtk.h>
00025 #include <xmms/configfile.h>
00026 #include <xmms/plugin.h>
00027 #include <xmms/util.h>
00028
00029 #include <Alloc.hh>
00030 #include <Condition.hh>
00031 #include <Mutex.hh>
00032 #include <dsp/DSPOp.hh>
00033 #include <dsp/ReBufferT.hh>
00034
00035 #include "Config.h"
00036 #include "LocalMsg.h"
00037 #include "SockOp.hh"
00038 #include "SockServ.hh"
00039 #include "DynThreads.hh"
00040
00041
00042 #ifndef XMMSOUT_HH
00043 #define XMMSOUT_HH
00044
00045 # define XMMSOUT_DESCRIPTION "HASAS streamdist"
00046
00047
00048 class clXMMSOut
00049 {
00050 volatile bool bRun;
00051 volatile bool bPause;
00052 int iMainThreadH;
00053 int iWriteTime;
00054 int iPlayTime;
00055 volatile int iAudioBufSize;
00056 volatile int iFragmentSize;
00057 unsigned long long uiTotalTickCount;
00058 double dStartTime;
00059 char *cpLocalSocket;
00060 AFormat eAudioFormat;
00061 stRawDataFirst sHdr;
00062 clReBufferT<GDT> ReBuffer;
00063 clAlloc AudioBuf;
00064 clMutex MtxAudio;
00065 clCondition CndAudio;
00066 clDSPOp DSP;
00067 clSockServ SServ;
00068
00069 gchar *cpMessageTxt;
00070 GtkWidget *gwMessageBox;
00071 GtkWidget *gwWinConfig;
00072 GtkWidget *gwVBox;
00073 GtkWidget *gwHBox;
00074 GtkWidget *gwLBufSize;
00075 GtkWidget *gwEBufSize;
00076 GtkWidget *gwLLocalSocket;
00077 GtkWidget *gwELocalSocket;
00078 GtkWidget *gwBOk;
00079 GtkWidget *gwBCancel;
00080
00081 double GetTime ();
00082 void Convert8s8u (void *, int);
00083 void Convert16u16s (void *, int);
00084 void EndianConvert (unsigned short *, int);
00085 void CopyChannel (GDT *, const GDT *, int);
00086 public:
00087 clXMMSOut ();
00088 ~clXMMSOut ();
00089 void Init ();
00090 void About ();
00091 void Configure ();
00092 int OpenAudio (AFormat, int, int);
00093 void WriteAudio (void *, int);
00094 void CloseAudio ();
00095 void Flush (int);
00096 void Pause (short);
00097 int BufferFree ();
00098 int BufferPlaying ();
00099 int OutputTime ();
00100 int WrittenTime ();
00101 void *MainThread (void *);
00102 void *ServeClientThread (void *);
00103 void Stop () { bRun = false; }
00104 void OnAboutButton (GtkButton *, gpointer);
00105 void OnButtonClick (GtkButton *, gpointer);
00106 };
00107
00108 #endif