Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

/home/pete/Work/TSE3.svn/tse3/src/tse3/DisplayParams.h

Go to the documentation of this file.
00001 /*
00002  * @(#)DisplayParams.h 3.00 24 June 2000
00003  *
00004  * Copyright (c) 2000 Pete Goodliffe (pete@cthree.org)
00005  *
00006  * This file is part of TSE3 - the Trax Sequencer Engine version 3.00.
00007  *
00008  * This library is modifiable/redistributable under the terms of the GNU
00009  * General Public License.
00010  *
00011  * You should have received a copy of the GNU General Public License along
00012  * with this program; see the file COPYING. If not, write to the Free Software
00013  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00014  *
00015  */
00016 
00017 #ifndef TSE3_DISPLAYPARAMS_H
00018 #define TSE3_DISPLAYPARAMS_H
00019 
00020 #include "tse3/listen/DisplayParams.h"
00021 
00022 #include "tse3/Notifier.h"
00023 #include "tse3/Serializable.h"
00024 
00025 namespace TSE3
00026 {
00066     class DisplayParams : public Notifier<DisplayParamsListener>,
00067                           public Serializable
00068     {
00069         public:
00070 
00076             DisplayParams();
00077             DisplayParams(const DisplayParams &);
00078             virtual ~DisplayParams();
00079             DisplayParams &operator=(const DisplayParams &);
00080 
00102             enum DrawingStyle
00103             {
00104                 Default,
00105                 PresetColour,
00106                 Colour,
00107                 None
00108             };
00109 
00122             enum PresetColours
00123             {
00124                 Intro,
00125                 Verse,
00126                 Chorus,
00127                 Bridge,
00128                 Coda,
00129                 Refrain,
00130                 Melody,
00131                 Solo,
00132                 Backing,
00133 
00134                 Brass,
00135                 Percussion,
00136                 Drums,
00137                 Guitar,
00138                 Bass,
00139                 Flute,
00140                 Strings,
00141                 Keyboard,
00142                 Piano,
00143                 Saxophone,
00144 
00145                 NoPresetColours
00146             };
00147 
00155             static const char *presetColourString(int pc);
00156 
00167             int style() { return _style; }
00168 
00175             void setStyle(int s);
00176 
00191             int presetColour() const { return _preset; }
00192 
00199             void setPresetColour(int pc);
00200 
00216             void colour(int &r, int &g, int &b)
00217             {
00218                 r = _r;
00219                 g = _g;
00220                 b = _b;
00221             }
00222 
00231             void setColour(int r, int g, int b);
00232 
00236             virtual void save(std::ostream &o, int i) const;
00237 
00241             virtual void load(std::istream &in, SerializableLoadInfo &info);
00242 
00243         private:
00244 
00245             int _style;
00246             int _r, _g, _b;
00247             int _preset;
00248     };
00249 
00260     class PresetColours : public Notifier<PresetColoursListener>
00261     {
00262         public:
00263 
00264             PresetColours();
00265 
00280             void colour(int preset, int &r, int &g, int &b)
00281             {
00282                 r = _r[preset];
00283                 g = _g[preset];
00284                 b = _b[preset];
00285             }
00286 
00299             void setColour(int preset, int r, int g, int b);
00300 
00301         private:
00302 
00303             int _r[DisplayParams::NoPresetColours];
00304             int _g[DisplayParams::NoPresetColours];
00305             int _b[DisplayParams::NoPresetColours];
00306     };
00307 }
00308 
00309 #endif

Generated on Wed May 25 14:45:06 2005 for TSE3 by doxygen 1.3.2