void CPrinterInfo::WriteSettings(void) { WriteProfileInt(ENTRY_FastBitmaps, FastBitmaps(), GetDefaultFastBitmaps()); WriteProfileInt(ENTRY_OutlineGammaValue, GetOutlineGamma(), DEFAULT_OUTLINE_GAMMA); WriteProfileInt(ENTRY_GammaValue, m_Record.m_nBitmapGamma, DEFAULT_BITMAP_GAMMA); WriteProfileInt(ENTRY_FastBitmapGammaValue, m_Record.m_nFastBitmapGamma, DEFAULT_FAST_BITMAP_GAMMA); WriteProfileInt(ENTRY_PostscriptType, GetPostScriptType(), m_nDefaultPostScriptType); WriteProfileInt(ENTRY_EnvelopePosition, GetEnvelopePosition(), GetDefaultEnvelopePosition()); if (m_nOrientationType == PORTRAIT) { WriteProfileFixed(ENTRY_LeftMargin, GetLeftMargin(), m_PhysicalMargins.Left); WriteProfileFixed(ENTRY_TopMargin, GetTopMargin(), m_PhysicalMargins.Top); WriteProfileFixed(ENTRY_RightMargin, GetRightMargin(), m_PhysicalMargins.Right); WriteProfileFixed(ENTRY_BottomMargin, GetBottomMargin(), m_PhysicalMargins.Bottom); WriteProfileFixed(ENTRY_LeftOffset, GetLeftOffset(), MakeFixed(0)); WriteProfileFixed(ENTRY_TopOffset, GetTopOffset(), MakeFixed(0)); } else { WriteProfileFixed(ENTRY_LeftMarginLandscape, GetLeftMargin(), m_PhysicalMargins.Left); WriteProfileFixed(ENTRY_TopMarginLandscape, GetTopMargin(), m_PhysicalMargins.Top); WriteProfileFixed(ENTRY_RightMarginLandscape, GetRightMargin(), m_PhysicalMargins.Right); WriteProfileFixed(ENTRY_BottomMarginLandscape, GetBottomMargin(), m_PhysicalMargins.Bottom); WriteProfileFixed(ENTRY_LeftOffsetLandscape, GetLeftOffset(), MakeFixed(0)); WriteProfileFixed(ENTRY_TopOffsetLandscape, GetTopOffset(), MakeFixed(0)); } WriteProfileInt(ENTRY_UseReverseLandscape, ReverseLandscape(), GetDefaultReverseLandscape()); WriteProfileInt(ENTRY_DoubleSidedType, GetDoubleSidedType(), 0); WriteProfileInt(ENTRY_PrintInstructions, GetPrintInstructions(), DEFAULT_PRINT_INSTRUCTIONS); WriteProfileInt(ENTRY_FlagPrintAsBitmap, GetPrintAsBitmap(), FALSE); }
void AdornedRulerPanel::DrawSelection(wxDC * dc, const wxRect r) { // Draw selection double sel0 = mViewInfo->sel0 - mViewInfo->h + GetLeftOffset() / mViewInfo->zoom; double sel1 = mViewInfo->sel1 - mViewInfo->h + GetLeftOffset() / mViewInfo->zoom; if (sel0 < 0.0) sel0 = 0.0; if (sel1 > (r.width / mViewInfo->zoom)) sel1 = r.width / mViewInfo->zoom; int p0 = int (sel0 * mViewInfo->zoom + 0.5); int p1 = int (sel1 * mViewInfo->zoom + 0.5); wxBrush selectedBrush; selectedBrush.SetColour(148, 148, 170); wxPen selectedPen; selectedPen.SetColour(148, 148, 170); dc->SetBrush(selectedBrush); dc->SetPen(selectedPen); wxRect sr; sr.x = p0; sr.y = 1; sr.width = p1 - p0 - 1; sr.height = GetRulerHeight() - 3; dc->DrawRectangle(sr); }
// //This draws the little triangular indicator on the //AdornedRulerPanel. // void AdornedRulerPanel::DrawIndicator(wxDC * dc, bool bRecording) { // Draw indicator double ind = indicatorPos; if (ind >= mViewInfo->h && ind <= (mViewInfo->h + mViewInfo->screen)) { int indp = GetLeftOffset() + int ((ind - mViewInfo->h) * mViewInfo->zoom); AColor::IndicatorColor(dc, bRecording ); // dc->SetPen(*wxTRANSPARENT_PEN); // dc->SetBrush(*wxBLACK_BRUSH); int indsize = 6; wxPoint tri[3]; tri[0].x = indp; tri[0].y = (indsize * 3)/2 + 1; tri[1].x = indp - indsize; tri[1].y = 1; tri[2].x = indp + indsize; tri[2].y = 1; dc->DrawPolygon(3, tri); } }
void AdornedRulerPanel::DrawMarks(wxDC * dc, const wxRect r, bool /*text */ ) { ruler.SetBounds(r.x, r.y, r.x + r.width - 1, r.y + r.height - 1); double min = mViewInfo->h - GetLeftOffset() / mViewInfo->zoom; double max = min + r.width / mViewInfo->zoom; ruler.SetRange(min, max); ruler.Draw(*dc); }
void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event) { // Let other listeners get the notification event.Skip(); // Ensure that there is an overlay attached to the ruler if (!mPartner) { auto ruler = mProject->GetRulerPanel(); if (ruler) { mPartner = std::make_unique<PlayIndicatorOverlayBase>(mProject, false); ruler->AddOverlay(mPartner.get()); } } auto trackPanel = mProject->GetTrackPanel(); if (!mProject->IsAudioActive()) { mNewIndicatorX = -1; const auto &scrubber = mProject->GetScrubber(); if (scrubber.HasStartedScrubbing()) { auto position = scrubber.GetScrubStartPosition(); int width; trackPanel->GetTracksUsableArea(&width, nullptr); const auto offset = trackPanel->GetLeftOffset(); if(position >= trackPanel->GetLeftOffset() && position < offset + width) mNewIndicatorX = position; } } else { ViewInfo &viewInfo = mProject->GetViewInfo(); // Calculate the horizontal position of the indicator const double playPos = viewInfo.mRecentStreamTime; bool onScreen = playPos >= 0.0 && between_incexc(viewInfo.h, playPos, mProject->GetScreenEndTime()); // This displays the audio time, too... mProject->TP_DisplaySelection(); // BG: Scroll screen if option is set // msmeyer: But only if not playing looped or in one-second mode // PRL: and not scrolling with play/record head fixed right if (viewInfo.bUpdateTrackIndicator && mProject->mLastPlayMode != PlayMode::loopedPlay && mProject->mLastPlayMode != PlayMode::oneSecondPlay && mProject->GetPlaybackScroller().GetMode() != AudacityProject::PlaybackScroller::Mode::Right && playPos >= 0 && !onScreen && !gAudioIO->IsPaused()) { mProject->TP_ScrollWindow(playPos); // Might yet be off screen, check it onScreen = playPos >= 0.0 && between_incexc(viewInfo.h, playPos, mProject->GetScreenEndTime()); } // Always update scrollbars even if not scrolling the window. This is // important when NEW audio is recorded, because this can change the // length of the project and therefore the appearance of the scrollbar. mProject->TP_RedrawScrollbars(); if (onScreen) mNewIndicatorX = viewInfo.TimeToPosition(playPos, trackPanel->GetLeftOffset()); else mNewIndicatorX = -1; } if(mPartner) mPartner->Update(mNewIndicatorX); }