gehe zur Dokumentation dieser Datei00001
00002
00059 #ifndef INPUTMIDIFILEDEVICESHAPE_H
00060 #define INPUTMIDIFILEDEVICESHAPE_H
00061
00062
00063
00064
00065
00066
00067
00068 #include "InputDeviceShape.h"
00069
00070
00071 class MidiFileInputFilterPanel : public MidiFileInputFilterPanelBase {
00072 public:
00073 MidiFileInputFilterPanel(wxWindow * parent):MidiFileInputFilterPanelBase(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 SetFromTrack(int current, int min, int max) {
00090 from_track->SetRange(min,max);
00091 from_track->SetValue(current);
00092 }
00093 int GetFromTrack() const
00094 {
00095 return from_track->GetValue();
00096 }
00097
00098 void SetToTrack(int current, int min, int max) {
00099 to_track->SetRange(min,max);
00100 to_track->SetValue(current);
00101 }
00102 int GetToTrack() const
00103 {
00104 return to_track->GetValue();
00105 }
00106
00107 void SetRouteType(RouteType routetype) {
00108 wxPanel * panel;
00109 switch (routetype) {
00110 case RTall: panel = all_panel; break;
00111 case RTchannel: panel = channel_panel; break;
00112 case RTstaff: panel = track_panel; break;
00113 case RTelse: panel = else_panel; break;
00114 default:
00115 std::cerr << "MidiFileInputFilterPanel::SetRouteType: invaid route type "
00116 << routetype << std::endl;
00117 abort();
00118 }
00119 for (size_t i = 0 ; i < type->GetPageCount(); i++) {
00120 if (type -> GetPage(i) != panel) continue;
00121 type->SetSelection(i);
00122 }
00123 }
00124
00125
00126 RouteType GetRouteType() const {
00127 wxWindow * window = type->GetCurrentPage();
00128 if (window == all_panel)
00129 return RTall;
00130 else if (window == channel_panel)
00131 return RTchannel;
00132 else if (window == track_panel)
00133 return RTstaff;
00134 else if (window == else_panel)
00135 return RTelse;
00136 else {
00137 UNREACHABLEC;
00138 return RTall;
00139 }
00140 }
00141 };
00142
00143
00144 class MutInputMidiFileDeviceShape:public MutInputDeviceShape
00145 {
00146 public:
00147 MutInputMidiFileDeviceShape():MutInputDeviceShape() {}
00148 MutInputMidiFileDeviceShape (wxWindow * parent,
00149 wxWindowID id,
00150 InDevice * d):
00151 MutInputDeviceShape() {
00152 Create (parent,id,d);
00153 }
00154 bool Create (wxWindow * parent, wxWindowID id, InDevice * d)
00155 {
00156 DEBUGLOG (other,_T (""));
00157 bool ret = MutInputDeviceShape::Create(parent,id,d);
00158 DEBUGLOG (other,_T (""));
00159 return ret;
00160 }
00161
00162 virtual MutIcon & GetMutIcon ()
00163 {
00164 DEBUGLOG (other, _T(""));
00165 return MidiFileBitmap;
00166 }
00167
00168 void SetLabel(const wxString & st ) {
00169 fileName = st;
00170 fileName.Normalize();
00171 MutInputDeviceShape::SetLabel (fileName.GetFullName());
00172 }
00173
00174 virtual wxPanel * GetInputFilterPanel(wxWindow * parent, Route * route) const;
00175 virtual void ReadInputFilterPanel(wxWindow * panel, Route * route);
00176
00177
00178 protected:
00179 virtual void InitializeDialog(InputDevDlg * in) const;
00180 virtual bool readDialog (InputDevDlg * in);
00181 virtual bool CanHandleType (DevType type) { return type == DTMidiFile; }
00182
00183 wxFileName fileName;
00184
00185 private:
00186 DECLARE_DYNAMIC_CLASS(MutInputMidiFileDeviceShape);
00187
00188 };
00189 #endif
00190
00191
00192