Hydrogen - Linux Drum Machine
Main Page | Class Hierarchy | Compound List | File List | Compound Members

Hydrogen.h

00001 /*
00002  * Hydrogen
00003  * Copyright(c) 2002-2003 by Alex >Comix< Cominu [comix@users.sourceforge.net]
00004  *
00005  * http://hydrogen.sourceforge.net
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY, without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * $Id: Hydrogen.h,v 1.45 2003/06/30 09:07:21 comix Exp $
00022  *
00023  */
00024 #ifndef HYDROGEN_H
00025 #define HYDROGEN_H
00026 
00027 #include "Song.h"
00028 #include "Object.h"
00029 #include "GenericDriver.h"
00030 #include "EngineListener.h"
00031 
00032 // Engine state
00033 #define UNINITIALIZED   1
00034 #define INITIALIZED     2
00035 #define PREPARED        3
00036 #define READY           4
00037 #define PLAYING     5
00038 
00039 // forward
00040 class AlsaMidiDriver;
00041 
00042 //----------------------------------------------------------------------------
00046 class Hydrogen : public Object
00047 {
00048     public:
00049         virtual string getClassName() { return "Hydrogen";  }
00050 
00052         static Hydrogen* getInstance(EngineListener *listener = NULL);
00053 
00055         ~Hydrogen();
00056 
00058         int start();
00059 
00061         void stop();
00062 
00064         void setSong(Song *newSong);
00065 
00067         Song* getSong();
00068         void removeSong();
00069 
00070         void noteOn(Note *note);
00071         void noteOff(Note *note);
00072 
00073         float getMasterPeak_L();
00074         void setMasterPeak_L(float value);
00075 
00076         float getMasterPeak_R();
00077         void setMasterPeak_R(float value);
00078 
00079         float getDelayBufferPeak_L();
00080         void setDelayBufferPeak_L(float value);
00081 
00082         float getDelayBufferPeak_R();
00083         void setDelayBufferPeak_R(float value);
00084 
00085         unsigned long getTickPosition();
00086 
00087         void setNextPattern(int pos);
00088 
00089         Pattern* getCurrentPattern();
00090         void setCurrentPattern(Pattern *newPattern);
00091 
00092         uint getPatternPos();
00093         void setPatternPos( uint pos );
00094 
00095         uint getPlayingNotes();
00096 
00097         void restartDrivers();
00098 
00099         uint exportSong(string filename);
00100 
00101         uint getSongNotesQueue();
00102 
00103         GenericDriver* getAudioDriver();
00104         AlsaMidiDriver* getMidiDriver();
00105 
00106         int getState();
00107 
00108         void addEngineListener(EngineListener *newListener);
00109 
00110         void lockEngine();
00111         void unlockEngine();
00112 
00113         float getProcessTime();
00114         float getMaxProcessTime();
00115 
00116         int loadDrumkit( DrumkitInfo *drumkitInfo );
00117 
00118         void raiseError(string msg);
00119 
00120         void raiseMidiActivityEvent();
00121 
00122         unsigned long getTotalFrames();
00123 
00124     private:
00125         static Hydrogen* instance;
00126 
00128         Hydrogen( EngineListener *mainListener );
00129 
00130 };
00131 
00132 #endif
00133 

 
 
Hydrogen (c) 2002..2003 Comix