/************************************************************************* * SEQ-STUDIO-WINDOW *************************************************************************/ SeqStudioWindow::SeqStudioWindow( BRect frame, const BMessage* config = NULL) : inherited(frame, "Studio", B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_ASYNCHRONOUS_CONTROLS), mBg(NULL), mPortMenu(NULL), mLabelCtrl(NULL), mDeviceCtrl(NULL) { BRect b(Bounds() ); BRect r(b); r.bottom = Prefs().Size(MAINMENU_Y); AddMainMenu(r); r.top = r.bottom + 1; /* This accounts for the document window tab. That tab does * not play nicely with a background that goes completely behind * it -- it leaves trails -- so we have to chunk the background * into two parts. */ r.bottom = b.bottom - B_H_SCROLL_BAR_HEIGHT; AddViews(r); r.top = r.bottom + 1; r.bottom = b.bottom; r.right = b.right - B_V_SCROLL_BAR_WIDTH; BView* v = new BView(r, "filler", B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, 0); if (v) { v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) ); AddChild(v); } if (config) SetConfiguration(config); }
/*************************************************************************** * AM-CONTROL-CHANGE-PREF-VIEW ***************************************************************************/ AmControlChangePrefView::AmControlChangePrefView( BRect f, BMessage* prefs, const BString& facSig, const BString& facKey) : inherited(f, prefs, facSig, facKey), mRunReport(0) { AddViews(); }
AmTimeView::AmTimeView(AmSongRef songRef) : inherited(BRect(0, 0, 0, 0), "midi_time", B_FOLLOW_TOP | B_FOLLOW_LEFT, B_WILL_DRAW), AmSongObserver(songRef), mSignature(new AmSignature), mTime(0), mMeasureCtrl(0), mBeatCtrl(0), mClockCtrl(0) { AddViews(); }
/************************************************************************* * SEQ-PREF-WIN *************************************************************************/ SeqPrefWin::SeqPrefWin(BRect frame, const BMessage* config) : inherited(frame, "Preferences", B_TITLED_WINDOW, B_NOT_ZOOMABLE), mOwqTable(0), mFilePanel(0), mUndoLevelCtrl(NULL), mTrackWinFollowCtrl(NULL), mTrackWinPlayToEndCtrl(NULL), mTrackHeightCtrl(NULL), mLabelHeightCtrl(NULL), mRefreshWindows(0), mFactoryView(0), mFactoryList(0), mFactoryInspector(0) { seq_app->GetPreferences(&mPreferences); if (config) SetConfiguration(config); AddViews(mPreferences); }
/************************************************************************* * AM-TIME-VIEW *************************************************************************/ AmTimeView::AmTimeView(const AmSignature& signature) : inherited(BRect(0, 0, 0, 0), "midi_time", B_FOLLOW_TOP | B_FOLLOW_LEFT, B_WILL_DRAW), AmSongObserver( AmSongRef() ), mSignature(new AmSignature), mTime(0), mMeasureCtrl(0), mBeatCtrl(0), mClockCtrl(0) { AmSignature* sig = new AmSignature( signature ); if( sig ) mSignatures.Add( sig ); AddViews(); }
_RhythmiCcFilterSettings::_RhythmiCcFilterSettings( AmFilterHolderI* target, const BMessage& initSettings) : AmFilterConfigLayout(target, initSettings), mRhythmField(NULL) { float labelW = -1, intW = -1; const BFont* font = be_plain_font; if( font ) { labelW = font->StringWidth( "Proximity to beat:"); intW = font->StringWidth("Furthest") + 5; } try { ArpBaseLayout* topVBar = (new ArpRunningBar("TopVBar")) ->SetParams(ArpMessage() .SetInt32(ArpRunningBar::OrientationP, B_VERTICAL) .SetFloat(ArpRunningBar::IntraSpaceP, .5) ); AddLayoutChild( topVBar ); topVBar->AddLayoutChild((new ArpTextControl( SZ_FILTER_LABEL, "Label:","", mImpl.AttachTextControl(SZ_FILTER_LABEL))) ->SetParams(ArpMessage() .SetString(ArpTextControl::MinTextStringP, "8") .SetString(ArpTextControl::PrefTextStringP, "8888888888") ) ->SetConstraints(ArpMessage() .SetFloat(ArpRunningBar::WeightC,3) .SetInt32(ArpRunningBar::FillC,ArpEastWest) ) ); ArpBaseLayout* colHBar = (new ArpRunningBar("ColHBar")) ->SetParams(ArpMessage() .SetInt32(ArpRunningBar::OrientationP, B_HORIZONTAL) .SetFloat(ArpRunningBar::IntraSpaceP, .5) ); topVBar->AddLayoutChild( colHBar ); AddViews(colHBar, mImpl, labelW, intW, initSettings); } catch(...) { throw; } Implementation().RefreshControls(mSettings); }
/************************************************************************* * SEQ-PHRASE-PROPERTY-WINDOW *************************************************************************/ SeqPhrasePropertyWindow::SeqPhrasePropertyWindow( AmSongRef songRef, AmPhraseEvent* event, const BMessage* config) : inherited(BRect(0, 0, 0, 0), "Phrase Properties", B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS), mSongRef(songRef), mEvent(NULL), mBg(NULL), mNameCtrl(NULL), mTimeLabel(NULL), mTimeCtrl(NULL), mColorField(NULL), mColorCtrl(NULL) { AddViews(BRect(0, 0, 50, 50)); float w = 0, h = 0; /* Set my dimensions. */ if (mBg) { for (BView* view = mBg->ChildAt(0); view; view = view->NextSibling() ) { BRect f = view->Frame(); if (f.right > w) w = f.right; if (f.bottom > h) h = f.bottom; } ResizeTo(w + Prefs().Size(BORDER_X), h + Prefs().Size(BORDER_Y)); } /* Set my location. */ BScreen s(this); if (s.IsValid() ) { BRect sf = s.Frame(); float newX = 10, newY = 10; if (w < sf.Width() ) newX = (sf.Width() - w) / 2; if (h < sf.Height() ) newY = (sf.Height() - h) / 2; MoveTo(newX, newY); } if (config) SetConfiguration(config); if (event) SetPhraseEvent(event); }
AmTimeView::AmTimeView( const AmPhrase& signatures) : inherited(BRect(0, 0, 0, 0), "midi_time", B_FOLLOW_TOP | B_FOLLOW_LEFT, B_WILL_DRAW), AmSongObserver( AmSongRef() ), mSignature(new AmSignature), mTime(0), mMeasureCtrl(0), mBeatCtrl(0), mClockCtrl(0) { AmNode* n = signatures.HeadNode(); while( n ) { if( n->Event()->Type() == n->Event()->SIGNATURE_TYPE ) { AmSignature* event = dynamic_cast<AmSignature*>( n->Event() ); AmSignature* sig; if( event && (sig = new AmSignature( *event )) ) { mSignatures.Add( sig ); } } n = n->next; } AddViews(); }