OutputDeviceShape.h
gehe zur Dokumentation dieser Datei
00001 // -*- C++ -*-
00002 /********************************************************************
00003  * Output device shape for route window.
00004  *
00005  * $Header: /cvsroot/mutabor/mutabor/muwx/Routing/OutputDeviceShape.h,v 1.3 2011-02-20 22:35:59 keinstein Exp $
00006  * \author Rüdiger Krauße <krausze@mail.berlios.de>,
00007  * Tobias Schlemmer <keinstein@users.berlios.de>
00008  * \date 2009/11/23
00009  * $Date: 2011-02-20 22:35:59 $
00010  * \version $Revision: 1.3 $
00011  * \license GPL
00012  *
00013  * $Log: OutputDeviceShape.h,v $
00014  * Revision 1.3  2011-02-20 22:35:59  keinstein
00015  * updated license information; some file headers have to be revised, though
00016  *
00017  * Revision 1.2  2010-11-21 13:15:50  keinstein
00018  * merged experimental_tobias
00019  *
00020  * Revision 1.1.2.12  2010-11-14 21:28:38  keinstein
00021  * implement loading and saving old files with new routing system
00022  *
00023  * Revision 1.1.2.11  2010-06-29 08:24:57  keinstein
00024  * searching
00025  *
00026  * Revision 1.1.2.10  2010/06/22 15:05:45  keinstein
00027  * debugging segfault in route check after replacement of MutOutputDevice
00028  *
00029  * Revision 1.1.2.9  2010/06/21 14:28:12  keinstein
00030  * implement deletion of output devices
00031  *
00032  * Revision 1.1.2.8  2010/05/07 11:40:28  keinstein
00033  * actual_settings
00034  *
00035  * Revision 1.1.2.7  2010/04/15 09:28:43  keinstein
00036  * changing routes works, but is not honoured by MIDI, yet
00037  *
00038  * Revision 1.1.2.6  2010/03/30 08:38:27  keinstein
00039  * added rudimentary command line support
00040  * changed debug system to allow selection of messages via command line
00041  * further enhancements to the route dialogs
00042  *
00043  * Revision 1.1.2.5  2010/02/15 12:08:21  keinstein
00044  * intermediate update for backup progress
00045  *
00046  * Revision 1.1.2.4  2010/01/14 18:14:20  keinstein
00047  * fix usage of installation prefix
00048  * MutInputDeviceShape/MutOutputDeviceShape:
00049  *     use GetType for type checking in OnChoiceSelected
00050  *     make InitalizeDialog const
00051  * MutNewOutputDeviceShape: add InitializeDialog and ReplaceSelfBy
00052  *
00053  * Revision 1.1.2.3  2010/01/14 09:34:24  keinstein
00054  * Checkin searching for a bug
00055  *
00056  * Revision 1.1.2.2  2010/01/11 12:51:52  keinstein
00057  * fix some problems due to splitting MutRouteShapes.{cpp,h}
00058  *
00059  * Revision 1.1.2.1  2009/11/30 12:08:57  keinstein
00060  * split MutRouteShapes into several files into directory Routing
00061  *
00062  * MutRouteShapes.h,v
00063  * Revision 1.1.2.2  2009/11/03 12:39:31  keinstein
00064  * input device dialog: Allow to edit input devices
00065  * fix a bug on Mac OS X, that prevented Mutabor from starting if no MIDI device is availlable
00066  *
00067  * Revision 1.1.2.1  2009/08/10 11:23:12  keinstein
00068  * merged from wrong tree
00069  *
00070  * Revision 1.2  2009/08/10 11:15:47  keinstein
00071  * some steps towards new route window
00072  *
00073  * Revision 1.1  2008/11/03 15:31:54  keinstein
00074  * Added to the system
00075  *
00076  *
00077  ********************************************************************
00078  *\addtogroup route
00079  *\{
00080  ********************************************************************/
00081 
00082 #ifndef OUTPUTDEVICESHAPE_H
00083 #define OUTPUTDEVICESHAPE_H
00084 
00085 //#include <map>
00086 
00087 #include "wx/defs.h"
00088 //#include "wx/icon.h"
00089 //#include "wx/stattext.h"
00090 
00091 #include "DeviceShape.h"
00092 #include "OutputDevDlg.h"
00093 #include "BoxChannelShape.h"
00094 
00095 class MutOutputDeviceShape:public MutDeviceShape
00096 {
00097 protected:
00098         static wxSizerFlags sizerFlags;
00099         OutDevice *device;
00100         MutBoxChannelShapeList routes;
00101 
00102 public:
00103         MutOutputDeviceShape():MutDeviceShape(),device(NULL) { }
00104 
00105 
00106         MutOutputDeviceShape (wxWindow * parent, wxWindowID id, 
00107                               const wxString & name) {
00108                 Create (parent, id, name);
00109         }
00110         
00111         MutOutputDeviceShape (wxWindow * parent, wxWindowID id, OutDevice * d):
00112                 MutDeviceShape() {
00113                 Create (parent, id,  d);
00114         }
00115 
00116         virtual ~MutOutputDeviceShape() 
00117                 {
00118                         if (device) {
00119                                 wxASSERT (device -> getUserData() == this);
00120                                 device -> setUserData (NULL);
00121                         }
00122                         DEBUGLOG(other, _T("Deleting."));
00123                 }
00124 
00125 
00126         bool Create (wxWindow * parent, wxWindowID id, 
00127                      const wxString & name)
00128                 {
00129                         device = NULL;
00130                         return MutDeviceShape::Create (parent,id, name);
00131                 }
00132 
00133         bool Create (wxWindow * parent, wxWindowID id, OutDevice * d);
00134 
00135 
00136         
00137         static MutOutputDeviceShape * CreateShape(wxWindow * parent,
00138                                                  wxWindowID id,
00139                                                  OutDevice * d);
00140 
00141         MutOutputDeviceShape * CreateShape (OutDevice * d) 
00142         {
00143                 DEBUGLOG (other,_T (""));
00144                 return CreateShape (m_parent, wxID_ANY,d);
00145         }
00146 
00147         static void SetSizerFlags (wxSizerFlags flags) 
00148         {
00149                 sizerFlags = flags; 
00150         }
00151   static const wxSizerFlags & GetSizerFlags() { return sizerFlags; }
00152 
00153         void SetLabel(const wxString & st );        
00154 
00155         MutIcon & GetMutIcon ()
00156         {
00157                 return MidiOutputDevBitmap;
00158         }
00159         
00160         virtual void AddRoute(Route * route);
00161         virtual void AddRoute(MutBoxChannelShape * route) {
00162                 wxASSERT(route->GetRoute()->getUserData() == route);
00163                 AddRoute(route->GetRoute());
00164         }
00165         virtual void RemoveRoute(Route * route);
00166         virtual void RemoveRoute(MutBoxChannelShape * route) {
00167                 wxASSERT(route->GetRoute()->getUserData() == route);
00168                 RemoveRoute(route->GetRoute());
00169         }
00170         
00171         Route * getRoutes()
00172         {
00173                 UNREACHABLEC;
00174                 abort();
00175         }
00176         const MutBoxChannelShapeList & getRoutesList()
00177         {
00178                 return routes;
00179         }
00180         
00181         OutDevice * GetDevice() 
00182         {
00183                 return device;
00184         }
00185 
00186         virtual void DoLeftDblClick();
00187 
00188         OutputDevDlg * ShowDeviceDialog();
00189 
00190         virtual wxPanel * GetOutputFilterPanel(wxWindow * parent, Route * route) const
00191         { 
00192                 ABSTRACT_FUNCTIONC;
00193                 return NULL; 
00194         }
00195         
00196         virtual void ReadOutputFilterPanel(wxWindow * panel, Route * route)
00197         {
00198                 ABSTRACT_FUNCTIONC;
00199         }       
00200         virtual void ReadPanel(OutputFilterPanel * panel, MutBoxChannelShape * channel);
00201         
00202 protected:
00203         virtual void InitializeDialog(OutputDevDlg * out) const
00204                 {
00205                         DEBUGLOG(other, _T("Initializing only generic OutputDeviceShape"));
00206                 }
00207 
00208         virtual bool readDialog (OutputDevDlg * out) { 
00209                 wxASSERT (false);
00210                 return false; 
00211         }
00212 
00214 
00217         virtual bool DetachDevice ();
00218         virtual bool replaceSelfBy (MutOutputDeviceShape  * newshape);
00219 
00220         virtual bool CanHandleType (DevType  type) = 0;
00221 
00222 private:
00223         DECLARE_ABSTRACT_CLASS(MutDeviceShape);
00224 };
00225 
00226 #endif                          /* OUTPUTDEVICESHAPE_H */
00227 /*
00228  * \}
00229  */

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