comparison framework/MainWindowBase.cpp @ 712:8e9702c0b9c7

Support updated PaneStack options API
author Chris Cannam
date Fri, 04 Oct 2019 13:52:48 +0100
parents 721eb532840d
children fe268c16ae28
comparison
equal deleted inserted replaced
711:aee03ad6d3f6 712:8e9702c0b9c7
135 return 0; 135 return 0;
136 } 136 }
137 #undef Window 137 #undef Window
138 #endif 138 #endif
139 139
140 MainWindowBase::MainWindowBase(SoundOptions options) : 140 MainWindowBase::MainWindowBase(SoundOptions soundOptions,
141 PaneStack::Options paneStackOptions) :
141 m_document(nullptr), 142 m_document(nullptr),
142 m_paneStack(nullptr), 143 m_paneStack(nullptr),
143 m_viewManager(nullptr), 144 m_viewManager(nullptr),
144 m_timeRulerLayer(nullptr), 145 m_timeRulerLayer(nullptr),
145 m_soundOptions(options), 146 m_soundOptions(soundOptions),
146 m_playSource(nullptr), 147 m_playSource(nullptr),
147 m_recordTarget(nullptr), 148 m_recordTarget(nullptr),
148 m_resamplerWrapper(nullptr), 149 m_resamplerWrapper(nullptr),
149 m_playTarget(nullptr), 150 m_playTarget(nullptr),
150 m_audioIO(nullptr), 151 m_audioIO(nullptr),
168 { 169 {
169 Profiler profiler("MainWindowBase::MainWindowBase"); 170 Profiler profiler("MainWindowBase::MainWindowBase");
170 171
171 SVDEBUG << "MainWindowBase::MainWindowBase" << endl; 172 SVDEBUG << "MainWindowBase::MainWindowBase" << endl;
172 173
173 if (options & WithAudioInput) { 174 if (m_soundOptions & WithAudioInput) {
174 if (!(options & WithAudioOutput)) { 175 if (!(m_soundOptions & WithAudioOutput)) {
175 SVCERR << "WARNING: MainWindowBase: WithAudioInput requires WithAudioOutput -- recording will not work" << endl; 176 SVCERR << "WARNING: MainWindowBase: WithAudioInput requires WithAudioOutput -- recording will not work" << endl;
176 } 177 }
177 } 178 }
178 179
179 qRegisterMetaType<sv_frame_t>("sv_frame_t"); 180 qRegisterMetaType<sv_frame_t>("sv_frame_t");
220 m_viewManager->setGlobalDarkBackground 221 m_viewManager->setGlobalDarkBackground
221 (mode == Preferences::DarkBackground); 222 (mode == Preferences::DarkBackground);
222 } 223 }
223 #endif 224 #endif
224 225
225 m_paneStack = new PaneStack(nullptr, m_viewManager); 226 m_paneStack = new PaneStack(nullptr, m_viewManager, paneStackOptions);
226 connect(m_paneStack, SIGNAL(currentPaneChanged(Pane *)), 227 connect(m_paneStack, SIGNAL(currentPaneChanged(Pane *)),
227 this, SLOT(currentPaneChanged(Pane *))); 228 this, SLOT(currentPaneChanged(Pane *)));
228 connect(m_paneStack, SIGNAL(currentLayerChanged(Pane *, Layer *)), 229 connect(m_paneStack, SIGNAL(currentLayerChanged(Pane *, Layer *)),
229 this, SLOT(currentLayerChanged(Pane *, Layer *))); 230 this, SLOT(currentLayerChanged(Pane *, Layer *)));
230 connect(m_paneStack, SIGNAL(rightButtonMenuRequested(Pane *, QPoint)), 231 connect(m_paneStack, SIGNAL(rightButtonMenuRequested(Pane *, QPoint)),
3086 } 3087 }
3087 3088
3088 void 3089 void
3089 MainWindowBase::togglePropertyBoxes() 3090 MainWindowBase::togglePropertyBoxes()
3090 { 3091 {
3091 if (m_paneStack->getLayoutStyle() == PaneStack::NoPropertyStacks) { 3092 if (m_paneStack->getLayoutStyle() == PaneStack::HiddenPropertyStacksLayout) {
3092 if (Preferences::getInstance()->getPropertyBoxLayout() == 3093 if (Preferences::getInstance()->getPropertyBoxLayout() ==
3093 Preferences::VerticallyStacked) { 3094 Preferences::VerticallyStacked) {
3094 m_paneStack->setLayoutStyle(PaneStack::PropertyStackPerPaneLayout); 3095 m_paneStack->setLayoutStyle(PaneStack::PropertyStackPerPaneLayout);
3095 } else { 3096 } else {
3096 m_paneStack->setLayoutStyle(PaneStack::SinglePropertyStackLayout); 3097 m_paneStack->setLayoutStyle(PaneStack::SinglePropertyStackLayout);
3097 } 3098 }
3098 } else { 3099 } else {
3099 m_paneStack->setLayoutStyle(PaneStack::NoPropertyStacks); 3100 m_paneStack->setLayoutStyle(PaneStack::HiddenPropertyStacksLayout);
3100 } 3101 }
3101 } 3102 }
3102 3103
3103 QLabel * 3104 QLabel *
3104 MainWindowBase::getStatusLabel() const 3105 MainWindowBase::getStatusLabel() const
3146 3147
3147 void 3148 void
3148 MainWindowBase::preferenceChanged(PropertyContainer::PropertyName name) 3149 MainWindowBase::preferenceChanged(PropertyContainer::PropertyName name)
3149 { 3150 {
3150 if (name == "Property Box Layout") { 3151 if (name == "Property Box Layout") {
3151 if (m_paneStack->getLayoutStyle() != PaneStack::NoPropertyStacks) { 3152 if (m_paneStack->getLayoutStyle() != PaneStack::HiddenPropertyStacksLayout) {
3152 if (Preferences::getInstance()->getPropertyBoxLayout() == 3153 if (Preferences::getInstance()->getPropertyBoxLayout() ==
3153 Preferences::VerticallyStacked) { 3154 Preferences::VerticallyStacked) {
3154 m_paneStack->setLayoutStyle(PaneStack::PropertyStackPerPaneLayout); 3155 m_paneStack->setLayoutStyle(PaneStack::PropertyStackPerPaneLayout);
3155 } else { 3156 } else {
3156 m_paneStack->setLayoutStyle(PaneStack::SinglePropertyStackLayout); 3157 m_paneStack->setLayoutStyle(PaneStack::SinglePropertyStackLayout);