2 * Copyright (c) 1999-2000, Eric Moon.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // UI component (view) providing access to a selected
35 // NodeGroup's properties & transport controls.
38 // e.moon 18aug99 Begun.
40 #ifndef __TransportView_H__
41 #define __TransportView_H__
46 #include <PopUpMenu.h>
55 #include "cortex_defs.h"
56 __BEGIN_CORTEX_NAMESPACE
61 class NumericValControl
;
64 class TransportWindow
;
68 typedef BView _inherited
;
72 M_SET_NAME
= TransportView_message_base
75 public: // *** ctors/dtor
76 virtual ~TransportView(); //nyi
79 NodeManager
* nodeManager
,
80 const char* name
); //nyi
83 virtual void AttachedToWindow();
84 virtual void AllAttached();
85 virtual void DetachedFromWindow();
86 virtual void FrameResized(
92 virtual void MouseDown(
95 public: // *** BHandler
96 virtual void MessageReceived(
97 BMessage
* message
); //nyi
99 private: // *** BHandler impl.
100 void _handleSelectGroup(
103 protected: // *** internal operations
105 // select the given group; initialize controls
106 // (if 0, gray out all controls)
110 void _observeGroup();
111 void _releaseGroup();
113 void _initTimeSources();
115 protected: // *** controls
117 void _constructControls(); //nyi
119 void _disableControls();
120 void _enableControls();
122 void _updateTransportButtons();
123 void _updateTimeSource();
124 void _updateRunMode();
126 // convert a position control's value to bigtime_t
128 bigtime_t
_scalePosition(
131 void _populateRunModeMenu(
133 void _populateTimeSourceMenu(
136 // add the given invoker to be retargeted to this
137 // view (used for controls whose messages need a bit more
138 // processing before being forwarded to the NodeGroup.)
139 void _addLocalTarget(
142 void _addGroupTarget(
145 void _refreshTransportSettings();
148 void _timeSourceCreated(
149 BMessage
* message
); //nyi
150 void _timeSourceDeleted(
151 BMessage
* message
); //nyi
153 protected: // *** layout
156 void _updateLayout();
159 friend class _GroupInfoView
;
160 friend class TransportWindow
;
163 NodeManager
* m_manager
;
167 _GroupInfoView
* m_infoView
;
168 BMenuField
* m_runModeView
;
169 BMenuField
* m_timeSourceView
;
171 BStringView
* m_fromLabel
;
172 NumericValControl
* m_regionStartView
;
173 BStringView
* m_toLabel
;
174 NumericValControl
* m_regionEndView
;
176 BButton
* m_startButton
;
177 BButton
* m_stopButton
;
178 BButton
* m_prerollButton
;
180 typedef std::list
<BInvoker
*> target_set
;
181 target_set m_localTargets
;
182 target_set m_groupTargets
;
186 _layout_state
* m_layout
;
189 __END_CORTEX_NAMESPACE
190 #endif /*__TransportView_H__*/