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