1 // TransportView.h 2 // * PURPOSE 3 // UI component (view) providing access to a selected 4 // NodeGroup's properties & transport controls. 5 // 6 // * HISTORY 7 // e.moon 18aug99 Begun. 8 9 #ifndef __TransportView_H__ 10 #define __TransportView_H__ 11 12 #include <list> 13 14 #include <View.h> 15 #include <PopUpMenu.h> 16 17 class BButton; 18 class BInvoker; 19 class BStringView; 20 class BTextControl; 21 class BMenuField; 22 class BMenu; 23 24 #include "cortex_defs.h" 25 __BEGIN_CORTEX_NAMESPACE 26 27 class NodeManager; 28 class NodeGroup; 29 30 class NumericValControl; 31 32 class _GroupInfoView; 33 class TransportWindow; 34 35 class TransportView : 36 public BView { 37 typedef BView _inherited; 38 39 enum message_t { 40 // _value: string 41 M_SET_NAME = TransportView_message_base 42 }; 43 44 public: // *** ctors/dtor 45 virtual ~TransportView(); //nyi 46 47 TransportView( 48 NodeManager* nodeManager, 49 const char* name); //nyi 50 51 public: // *** BView 52 virtual void AttachedToWindow(); 53 virtual void AllAttached(); 54 virtual void DetachedFromWindow(); 55 virtual void FrameResized( 56 float width, 57 float height); 58 virtual void KeyDown( 59 const char* bytes, 60 int32 count); 61 virtual void MouseDown( 62 BPoint where); 63 64 public: // *** BHandler 65 virtual void MessageReceived( 66 BMessage* message); //nyi 67 68 private: // *** BHandler impl. 69 void _handleSelectGroup( 70 BMessage* message); 71 72 protected: // *** internal operations 73 74 // select the given group; initialize controls 75 // (if 0, gray out all controls) 76 void _selectGroup( 77 uint32 groupID); 78 79 void _observeGroup(); 80 void _releaseGroup(); 81 82 void _initTimeSources(); 83 84 protected: // *** controls 85 86 void _constructControls(); //nyi 87 88 void _disableControls(); 89 void _enableControls(); 90 91 void _updateTransportButtons(); 92 void _updateTimeSource(); 93 void _updateRunMode(); 94 95 // convert a position control's value to bigtime_t 96 // [e.moon 11oct99] 97 bigtime_t _scalePosition( 98 double value); 99 100 void _populateRunModeMenu( 101 BMenu* menu); 102 void _populateTimeSourceMenu( 103 BMenu* menu); 104 105 // add the given invoker to be retargeted to this 106 // view (used for controls whose messages need a bit more 107 // processing before being forwarded to the NodeGroup.) 108 void _addLocalTarget( 109 BInvoker* invoker); 110 111 void _addGroupTarget( 112 BInvoker* invoker); 113 114 void _refreshTransportSettings(); 115 116 // [e.moon 2dec99] 117 void _timeSourceCreated( 118 BMessage* message); //nyi 119 void _timeSourceDeleted( 120 BMessage* message); //nyi 121 122 protected: // *** layout 123 124 void _initLayout(); 125 void _updateLayout(); 126 127 private: 128 friend class _GroupInfoView; 129 friend class TransportWindow; 130 131 // logical 132 NodeManager* m_manager; 133 NodeGroup* m_group; 134 135 // controls 136 _GroupInfoView* m_infoView; 137 BMenuField* m_runModeView; 138 BMenuField* m_timeSourceView; 139 140 BStringView* m_fromLabel; 141 NumericValControl* m_regionStartView; 142 BStringView* m_toLabel; 143 NumericValControl* m_regionEndView; 144 145 BButton* m_startButton; 146 BButton* m_stopButton; 147 BButton* m_prerollButton; 148 149 typedef std::list<BInvoker*> target_set; 150 target_set m_localTargets; 151 target_set m_groupTargets; 152 153 // layout 154 class _layout_state; 155 _layout_state* m_layout; 156 }; 157 158 __END_CORTEX_NAMESPACE 159 #endif /*__TransportView_H__*/ 160