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.
36 // Window class containing a MediaRoutingView for
37 // inspection & manipulation of Media Kit nodes.
40 // 14may99 e.moon Created from routeApp.cpp
41 // 21may00 c.lenz added StatusView to the window
43 #ifndef __ROUTEWINDOW_H__
44 #define __ROUTEWINDOW_H__
49 #include <ScrollBar.h>
52 #include "IStateArchivable.h"
54 #include "cortex_defs.h"
58 __BEGIN_CORTEX_NAMESPACE
60 class MediaRoutingView
;
62 class RouteAppNodeManager
;
63 class DormantNodeWindow
;
64 class TransportWindow
;
68 public IStateArchivable
{
70 typedef BWindow _inherited
;
74 M_TOGGLE_TRANSPORT_WINDOW
=RouteWindow_message_base
,
77 M_SHOW_NODE_INSPECTOR
,
80 M_REFRESH_TRANSPORT_SETTINGS
,
83 M_TOGGLE_PULLING_PALETTES
,
86 M_TOGGLE_DORMANT_NODE_WINDOW
,
89 M_TOGGLE_GROUP_ROLLING
93 virtual ~RouteWindow();
95 RouteAppNodeManager
* manager
);
97 public: // palette-window operations
99 // enable/disable palette position-locking (when the main
100 // window is moved, all palettes follow)
101 bool isPullPalettes() const;
102 void setPullPalettes(
105 // [e.moon 2dec99] force window & palettes on-screen
106 void constrainToScreen();
108 public: // BWindow impl
110 // [e.moon 17nov99] 'palette-pulling' impl
111 virtual void FrameMoved(
114 // [c.lenz 1mar2000] added for better Zoom() support
115 virtual void FrameResized(
119 bool QuitRequested();
121 // [c.lenz 1mar2000] resize to MediaRoutingView's preferred size
127 public: // BHandler impl
128 void MessageReceived(
131 public: // *** IStateArchivable
133 status_t
importState(
134 const BMessage
* archive
);
136 status_t
exportState(
137 BMessage
* archive
) const;
139 private: // implementation
140 friend class RouteApp
;
142 // resizes the window to fit in the current screen rect
143 void _constrainToScreen();
145 void _toggleTransportWindow();
147 void _handleGroupSelected(
151 void _handleShowErrorMessage(
155 void _togglePullPalettes();
157 void _toggleDormantNodeWindow();
159 // refresh the transport window for the given group, if any
160 void _refreshTransportSettings(
163 void _closePalettes();
165 // [e.moon 17nov99] move all palette windows by the
167 void _movePalettesBy(
171 // [e.moon 1dec99] toggle group playback
172 void _toggleGroupRolling();
175 MediaRoutingView
* m_routingView
;
176 BScrollBar
* m_hScrollBar
;
177 BScrollBar
* m_vScrollBar
;
179 StatusView
* m_statusView
;
181 BMenuItem
* m_transportWindowItem
;
182 BRect m_transportWindowFrame
;
183 TransportWindow
* m_transportWindow
;
184 // list<InspectorWindow*> m_nodeInspectorWindows;
186 BMenuItem
* m_dormantNodeWindowItem
;
187 BRect m_dormantNodeWindowFrame
;
188 DormantNodeWindow
* m_dormantNodeWindow
;
190 // BPoint m_nodeInspectorBasePosition;
192 // all items in this menu control the routing view
195 // cached window position [e.moon 17nov99]
196 BMenuItem
* m_pullPalettesItem
;
197 BPoint m_lastFramePosition
;
199 // ID of currently selected group [e.moon 1dec99]
200 uint32 m_selectedGroupID
;
204 // true if window was zoomed to MediaRoutingView's preferred size
208 // true if a resize operation resulted from a call to Zoom()
213 private: // constants
214 static const BRect s_initFrame
;
215 static const char* const s_windowName
;
218 __END_CORTEX_NAMESPACE
219 #endif /* __ROUTEWINDOW_H__ */