InputMidiDeviceShape.h
gehe zur Dokumentation dieser Datei
00001 // -*- C++ -*-
00059 #ifndef INPUTMIDIDEVICESHAPE_H
00060 #define INPUTMIDIDEVICESHAPE_H
00061 
00062 //#include <map>
00063 
00064 //#include "wx/defs.h"
00065 //#include "wx/icon.h"
00066 //#include "wx/stattext.h"
00067 
00068 #include "InputDeviceShape.h"
00069 //#include "Device.h"
00070 
00071 class MidiInputFilterPanel : public MidiInputFilterPanelBase {
00072 public:
00073         MidiInputFilterPanel(wxWindow * parent):MidiInputFilterPanelBase(parent) {}
00077         void SetFromChannel(int current, int min, int max) {
00078                 from_channel->SetRange(min,max);
00079                 from_channel->SetValue(current);
00080         }
00081         int GetFromChannel() const{ return from_channel->GetValue(); }
00082         
00083         void SetToChannel(int current, int min, int max) {
00084                 to_channel->SetRange(min,max);
00085                 to_channel->SetValue(current);
00086         }
00087         int GetToChannel() const{ return to_channel->GetValue(); }
00088         
00089         void SetFromKey(int current, int min, int max) {
00090                 from_key->SetRange(min,max);
00091                 from_key->SetValue(current);
00092         }
00093         int GetFromKey() const{ return from_key->GetValue(); }
00094         
00095         void SetToKey(int current, int min, int max) {
00096                 to_key->SetRange(min,max);
00097                 to_key->SetValue(current);
00098         }
00099         int GetToKey() const { return to_key->GetValue(); }
00100         
00101         void SetRouteType(RouteType routetype) {
00102                 wxPanel * panel;
00103                 switch (routetype) {
00104                         case RTall: panel = all_panel; break;
00105                         case RTchannel: panel = channel_panel; break;
00106                         case RTstaff: panel = key_panel; break;
00107                         case RTelse: panel = else_panel; break;
00108                         default:
00109                                 UNREACHABLEC;
00110                                 std::cerr << "MidiInputFilterPanel::SetRouteType: invaid route type " 
00111                                 << routetype << std::endl;
00112                                 abort();
00113                 }
00114                 for (size_t i = 0 ; i < type->GetPageCount(); i++) {
00115                         if (type -> GetPage(i) != panel) continue;
00116                         type->SetSelection(i);
00117                 }
00118         }
00119         
00120         RouteType GetRouteType() const {
00121                 wxWindow * window = type->GetCurrentPage();
00122                 if (window == all_panel)
00123                         return RTall;
00124                 else if (window == channel_panel)
00125                         return RTchannel;
00126                 else if (window == key_panel)
00127                         return RTstaff;
00128                 else if (window == else_panel)
00129                                 return RTelse;
00130                 else {
00131                         UNREACHABLEC;
00132                         return RTall;
00133                 }
00134         }
00135 };
00136 
00137 class MutInputMidiDeviceShape:public MutInputDeviceShape
00138 {
00139 public:
00140         MutInputMidiDeviceShape():MutInputDeviceShape() {}
00141         MutInputMidiDeviceShape (wxWindow * parent,
00142                                      wxWindowID id, 
00143                                      InDevice * d):
00144                 MutInputDeviceShape() {
00145                 Create (parent,id,d);
00146         }
00147         bool Create (wxWindow * parent, wxWindowID id, InDevice * d)
00148                 {
00149                         return MutInputDeviceShape::Create(parent,id,d);
00150                 }
00151 
00152         virtual MutIcon & GetMutIcon () 
00153                 {
00154                         DEBUGLOG(other, _T(""));
00155                         return MidiInputDevBitmap;
00156                 }
00157         
00158         virtual wxPanel * GetInputFilterPanel(wxWindow * parent, Route * route) const;
00159         virtual void ReadInputFilterPanel(wxWindow * panel, Route * route);
00160 
00161 
00162 protected: 
00163         virtual void InitializeDialog(InputDevDlg * in) const;
00164         virtual bool readDialog (InputDevDlg * in);
00165         virtual bool CanHandleType (DevType  type) { return type == DTMidiPort; }
00166 
00167 
00168 private:
00169         DECLARE_DYNAMIC_CLASS(MutInputMidiDeviceShape);
00170 
00171 };
00172 
00173 #endif                          /* INPUTMIDIDEVICESHAPE_H */
00174 /*
00175  * \}
00176  */

Erzeugt am Sun Aug 21 2011 10:51:55 für Mutabor von doxygen 1.7.4