/[svn]/qsampler/trunk/src/qsamplerChannel.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerChannel.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 299 by capela, Wed Nov 17 15:41:58 2004 UTC revision 467 by capela, Tue Mar 15 23:54:14 2005 UTC
# Line 1  Line 1 
1  // qsamplerChannel.h  // qsamplerChannel.h
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2003-2004, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2003-2005, rncbc aka Rui Nuno Capela. All rights reserved.
5    
6     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
7     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 40  class qsamplerChannel Line 40  class qsamplerChannel
40  {  {
41  public:  public:
42    
43      // Constructor.          // Constructor.
44      qsamplerChannel(qsamplerMainForm *pMainForm, int iChannelID = -1);          qsamplerChannel(qsamplerMainForm *pMainForm, int iChannelID = -1);
45      // Default destructor.          // Default destructor.
46      ~qsamplerChannel();          ~qsamplerChannel();
47    
48      // Main application options accessor.          // Main application options accessor.
49      qsamplerOptions *options();          qsamplerOptions *options();
50    
51      // LSCP client descriptor accessor.          // LSCP client descriptor accessor.
52      lscp_client_t * client();          lscp_client_t * client();
53    
54      // Add/remove sampler channel methods.          // Add/remove sampler channel methods.
55      bool     addChannel();          bool     addChannel();
56      bool     removeChannel();          bool     removeChannel();
57    
58      // Sampler channel ID accessors.          // Sampler channel ID accessors.
59      int      channelID();          int      channelID();
60      void     setChannelID(int iChannelID);          void     setChannelID(int iChannelID);
61        
62      // Readable channel name.          // Readable channel name.
63      QString  channelName();          QString  channelName();
64    
65      // Engine name property.          // Engine name property.
66      QString& engineName();          QString& engineName();
67      bool     loadEngine(const QString& sEngineName);          bool     loadEngine(const QString& sEngineName);
68        
69      // Instrument file and index.          // Instrument file and index.
70      QString& instrumentFile();          QString& instrumentFile();
71      int      instrumentNr();          int      instrumentNr();
72      int      instrumentStatus();          QString& instrumentName();
73      bool     loadInstrument(const QString& sInstrumentFile, int iInstrumentNr);          int      instrumentStatus();
74                bool     loadInstrument(const QString& sInstrumentFile, int iInstrumentNr);
75      // MIDI input driver (DEPRECATED).          // Special instrument file/name/number settler.
76      QString& midiDriver();          bool     setInstrument(const QString& sInstrumentFile, int iInstrumentNr);
77      bool     setMidiDriver(const QString& sMidiDriver);  
78                // MIDI input driver (DEPRECATED).
79      // MIDI input device.          QString& midiDriver();
80      int      midiDevice();          bool     setMidiDriver(const QString& sMidiDriver);
81      bool     setMidiDevice(int iMidiDevice);  
82                // MIDI input device.
83      // MIDI input port.          int      midiDevice();
84      int      midiPort();          bool     setMidiDevice(int iMidiDevice);
85      bool     setMidiPort(int iMidiPort);  
86                // MIDI input port.
87      // MIDI input channel.          int      midiPort();
88      int      midiChannel();          bool     setMidiPort(int iMidiPort);
89      bool     setMidiChannel(int iMidiChannel);  
90                // MIDI input channel.
91      // Audio output driver (DEPRECATED).          int      midiChannel();
92      QString& audioDriver();          bool     setMidiChannel(int iMidiChannel);
93      bool     setAudioDriver(const QString& sAudioDriver);  
94            // Audio output driver (DEPRECATED).
95      // Audio output device.          QString& audioDriver();
96      int      audioDevice();          bool     setAudioDriver(const QString& sAudioDriver);
97      bool     setAudioDevice(int iAudioDevice);  
98                // Audio output device.
99      // Sampler channel volume.          int      audioDevice();
100      float    volume();          bool     setAudioDevice(int iAudioDevice);
101      bool     setVolume(float fVolume);  
102            // Sampler channel volume.
103      // Channel info structure map executive.          float    volume();
104      bool updateChannelInfo();          bool     setVolume(float fVolume);
105    
106      // Reset channel method.          // Istrument name remapper.
107      bool resetChannel();          void     updateInstrumentName();
108    
109      // Message logging methods (brainlessly mapped to main form's).          // Channel info structure map executive.
110      void appendMessages       (const QString & s);          bool     updateChannelInfo();
111      void appendMessagesColor  (const QString & s, const QString & c);  
112      void appendMessagesText   (const QString & s);          // Channel setup dialog form.
113      void appendMessagesError  (const QString & s);          bool     channelSetup(QWidget *pParent);
114      void appendMessagesClient (const QString & s);  
115            // Reset channel method.
116      // Retrieve the available instrument name(s) of an instrument file (.gig).          bool     channelReset();
117      static QString     getInstrumentName (const QString& sInstrumentFile, int iInstrumentNr);  
118      static QStringList getInstrumentList (const QString& sInstrumentFile);          // Message logging methods (brainlessly mapped to main form's).
119            void     appendMessages       (const QString & s);
120            void     appendMessagesColor  (const QString & s, const QString & c);
121            void     appendMessagesText   (const QString & s);
122            void     appendMessagesError  (const QString & s);
123            void     appendMessagesClient (const QString & s);
124    
125            // Context menu event handler.
126            void contextMenuEvent(QContextMenuEvent *pEvent);
127    
128            // Common (invalid) name-helpers.
129            static QString noEngineName();
130            static QString noInstrumentName();
131    
132            // Check whether a given file is an instrument file.
133            static bool isInstrumentFile (const QString& sInstrumentFile);
134    
135            // Retrieve the available instrument name(s) of an instrument file (.gig).
136            static QString getInstrumentName (const QString& sInstrumentFile,
137                                                            int iInstrumentNr, bool bInstrumentNames);
138            static QStringList getInstrumentList (const QString& sInstrumentFile,
139                                                            bool bInstrumentNames);
140    
141  private:  private:
142    
143      // Main application form reference.          // Main application form reference.
144      qsamplerMainForm *m_pMainForm;          qsamplerMainForm *m_pMainForm;
145    
146      // Unique channel identifier.          // Unique channel identifier.
147      int     m_iChannelID;          int     m_iChannelID;
148    
149      // Sampler channel info map.          // Sampler channel info map.
150      QString m_sEngineName;          QString m_sEngineName;
151      QString m_sInstrumentFile;          QString m_sInstrumentName;
152      int     m_iInstrumentNr;          QString m_sInstrumentFile;
153      int     m_iInstrumentStatus;          int     m_iInstrumentNr;
154      QString m_sMidiDriver;          // DEPRECATED.          int     m_iInstrumentStatus;
155      int     m_iMidiDevice;          QString m_sMidiDriver;          // DEPRECATED.
156      int     m_iMidiPort;          int     m_iMidiDevice;
157      int     m_iMidiChannel;          int     m_iMidiPort;
158      QString m_sAudioDriver;         // DEPRECATED.          int     m_iMidiChannel;
159      int     m_iAudioDevice;          QString m_sAudioDriver;         // DEPRECATED.
160      float   m_fVolume;          int     m_iAudioDevice;
161            float   m_fVolume;
162  };  };
163    
164  #endif  // __qsamplerChannel_h  #endif  // __qsamplerChannel_h

Legend:
Removed from v.299  
changed lines
  Added in v.467

  ViewVC Help
Powered by ViewVC