Audacity  2.2.0
SelectedRegion Class Reference

Defines a selected portion of a project. More...

#include <SelectedRegion.h>

Public Member Functions

 SelectedRegion ()
 
 SelectedRegion (double t0, double t1)
 
 SelectedRegion (const SelectedRegion &x)
 
SelectedRegionoperator= (const SelectedRegion &x)
 
double t0 () const
 
double t1 () const
 
double duration () const
 
bool isPoint () const
 
double f0 () const
 
double f1 () const
 
double fc () const
 
bool setT0 (double t, bool maySwap=true)
 
bool setT1 (double t, bool maySwap=true)
 
bool setTimes (double t0, double t1)
 
bool moveT0 (double delta, bool maySwap=true)
 
bool moveT1 (double delta, bool maySwap=true)
 
void move (double delta)
 
void collapseToT0 ()
 
void collapseToT1 ()
 
bool setF0 (double f, bool maySwap=true)
 
bool setF1 (double f, bool maySwap=true)
 
bool setFrequencies (double f0, double f1)
 
void WriteXMLAttributes (XMLWriter &xmlFile, const wxChar *legacyT0Name=sDefaultT0Name, const wxChar *legacyT1Name=sDefaultT1Name) const
 
bool HandleXMLAttribute (const wxChar *attr, const wxChar *value, const wxChar *legacyT0Name=sDefaultT0Name, const wxChar *legacyT1Name=sDefaultT1Name)
 

Static Public Attributes

static const int UndefinedFrequency = -1
 
static const wxChar * sDefaultT0Name = wxT("selStart")
 
static const wxChar * sDefaultT1Name = wxT("selEnd")
 

Private Member Functions

bool ensureOrdering ()
 
bool ensureFrequencyOrdering ()
 

Private Attributes

double mT0
 
double mT1
 
double mF0
 
double mF1
 

Friends

bool operator== (const SelectedRegion &lhs, const SelectedRegion &rhs)
 

Detailed Description

Defines a selected portion of a project.

This includes starting and ending times, and other optional information such as a frequency range, but not the set of selected tracks.

Maintains the invariants that ending time is not less than starting time and that starting and ending frequencies, when both defined, are also correctly ordered.

Constructor & Destructor Documentation

SelectedRegion::SelectedRegion ( )
inline
SelectedRegion::SelectedRegion ( double  t0,
double  t1 
)
inline
SelectedRegion::SelectedRegion ( const SelectedRegion x)
inline

Member Function Documentation

void SelectedRegion::collapseToT1 ( )
inline
bool SelectedRegion::ensureFrequencyOrdering ( )
inlineprivate
bool SelectedRegion::ensureOrdering ( )
inlineprivate
double SelectedRegion::fc ( ) const
inline
bool SelectedRegion::HandleXMLAttribute ( const wxChar *  attr,
const wxChar *  value,
const wxChar *  legacyT0Name = sDefaultT0Name,
const wxChar *  legacyT1Name = sDefaultT1Name 
)
void SelectedRegion::move ( double  delta)
inline
bool SelectedRegion::moveT0 ( double  delta,
bool  maySwap = true 
)
inline
bool SelectedRegion::moveT1 ( double  delta,
bool  maySwap = true 
)
inline
SelectedRegion& SelectedRegion::operator= ( const SelectedRegion x)
inline

References mF0, mF1, mT0, and mT1.

bool SelectedRegion::setF0 ( double  f,
bool  maySwap = true 
)
inline
bool SelectedRegion::setF1 ( double  f,
bool  maySwap = true 
)
inline
double SelectedRegion::t0 ( ) const
inline

Referenced by LabelTrack::AddLabel(), ExportCommand::Apply(), LabelTrack::Char(), AudacityProject::Clear(), CutlineHandle::Click(), TimeShiftHandle::Click(), LabelTrack::DoCaptureKey(), AudacityProject::DoClipLeftOrRight(), AdornedRulerPanel::DoDrawSelection(), Effect::DoEffect(), EditCursorOverlay::DoGetRectangle(), AudacityProject::DoPlayStopSelect(), TrackArtist::DrawBackgroundWithSelection(), TrackArtist::DrawClipWaveform(), TrackArtist::DrawLabelTrack(), ExportMultiple::ExportMultipleByLabel(), LabelDialog::FindInitialRow(), LabelTrack::FindNextLabel(), LabelTrack::FindPrevLabel(), FreqWindow::GetAudio(), AudacityProject::GetRegionsByLabel(), CompareAudioCommand::GetSelection(), LabelStruct::getT0(), AudacityProject::GetUpdateFlags(), AudacityProject::HandleAlign(), AudacityProject::HandlePasteText(), LabelTrack::HandleTextClick(), SelectHandle::HitTest(), LabelTrack::KeyDown(), AudacityProject::OnBoundaryMove(), LabelDialog::OnChangeEtime(), AudacityProject::OnClipMove(), AudacityProject::OnCopy(), AudacityProject::OnCursorClipBoundary(), AudacityProject::OnCursorPositionStore(), AudacityProject::OnCursorSelStart(), AudacityProject::OnCursorTrackStart(), AudacityProject::OnCut(), AudacityProject::OnDisjoin(), AudacityProject::OnDuplicate(), AudacityProject::OnEffect(), AudacityProject::OnExportSelection(), ContrastDialog::OnGetBackground(), ContrastDialog::OnGetForeground(), AudacityProject::OnGoSelStart(), AudacityProject::OnJoin(), LabelTrack::OnKeyDown(), AudacityProject::OnPaste(), AudacityProject::OnPasteNewLabel(), AudacityProject::OnPasteOver(), AudacityProject::OnPlayAfterSelectionStart(), AudacityProject::OnPlayBeforeAndAfterSelectionEnd(), AudacityProject::OnPlayBeforeAndAfterSelectionStart(), AudacityProject::OnPlayBeforeSelectionEnd(), AudacityProject::OnPlayBeforeSelectionStart(), AudacityProject::OnPlayToSelection(), AudacityProject::OnSelectClip(), AudacityProject::OnSelectClipBoundary(), AudacityProject::OnSelectCursorStoredCursor(), AudacityProject::OnSelectionRestore(), AudacityProject::OnSetLeftSelection(), AudacityProject::OnSilence(), AudacityProject::OnSplit(), AudacityProject::OnSplitCut(), AudacityProject::OnSplitDelete(), AudacityProject::OnSplitNew(), AudacityProject::OnTrim(), AudacityProject::OnZeroCrossing(), AudacityProject::OnZoomSel(), ControlToolBar::PlayPlayRegion(), ContrastDialog::SetStartAndEndTime(), AudacityProject::SnapSelection(), SelectHandle::StartSnappingFreqSelection(), AudacityProject::TP_DisplaySelection(), LabelDialog::TransferDataToWindow(), AudacityProject::Zoom(), and AudacityProject::ZoomInByFactor().

double SelectedRegion::t1 ( ) const
inline

Referenced by ExportCommand::Apply(), LabelTrack::Char(), AudacityProject::Clear(), CutlineHandle::Click(), TimeShiftHandle::Click(), LabelTrack::DoCaptureKey(), AdornedRulerPanel::DoDrawSelection(), Effect::DoEffect(), TrackArtist::DrawBackgroundWithSelection(), TrackArtist::DrawClipWaveform(), TrackArtist::DrawLabelTrack(), ExportMultiple::ExportMultipleByLabel(), AudacityProject::FixScrollbars(), FreqWindow::GetAudio(), AudacityProject::GetRegionsByLabel(), CompareAudioCommand::GetSelection(), LabelStruct::getT1(), AudacityProject::GetUpdateFlags(), AudacityProject::HandleAlign(), AudacityProject::HandlePasteText(), LabelTrack::HandleTextClick(), SelectHandle::HitTest(), LabelTrack::KeyDown(), AudacityProject::OnBoundaryMove(), LabelDialog::OnChangeStime(), AudacityProject::OnCopy(), AudacityProject::OnCursorClipBoundary(), AudacityProject::OnCursorSelEnd(), AudacityProject::OnCursorTrackEnd(), AudacityProject::OnCut(), AudacityProject::OnDisjoin(), AudacityProject::OnDuplicate(), AudacityProject::OnExportSelection(), ContrastDialog::OnGetBackground(), ContrastDialog::OnGetForeground(), AudacityProject::OnGoSelEnd(), AudacityProject::OnJoin(), AudacityProject::OnPaste(), AudacityProject::OnPasteNewLabel(), AudacityProject::OnPlayAfterSelectionEnd(), AudacityProject::OnPlayAfterSelectionStart(), AudacityProject::OnPlayBeforeAndAfterSelectionEnd(), AudacityProject::OnPlayBeforeAndAfterSelectionStart(), AudacityProject::OnPlayBeforeSelectionEnd(), AudacityProject::OnPlayToSelection(), AudacityProject::OnSelectClip(), AudacityProject::OnSelectClipBoundary(), AudacityProject::OnSelectionRestore(), AudacityProject::OnSetRightSelection(), AudacityProject::OnSilence(), AudacityProject::OnSplit(), AudacityProject::OnSplitCut(), AudacityProject::OnSplitDelete(), AudacityProject::OnSplitNew(), AudacityProject::OnTrim(), AudacityProject::OnZeroCrossing(), AudacityProject::OnZoomSel(), ControlToolBar::PlayPlayRegion(), ContrastDialog::SetStartAndEndTime(), AudacityProject::SnapSelection(), SelectHandle::StartSnappingFreqSelection(), AudacityProject::TP_DisplaySelection(), LabelDialog::TransferDataToWindow(), AudacityProject::Zoom(), and AudacityProject::ZoomInByFactor().

void SelectedRegion::WriteXMLAttributes ( XMLWriter xmlFile,
const wxChar *  legacyT0Name = sDefaultT0Name,
const wxChar *  legacyT1Name = sDefaultT1Name 
) const

Friends And Related Function Documentation

bool operator== ( const SelectedRegion lhs,
const SelectedRegion rhs 
)
friend

Member Data Documentation

double SelectedRegion::mF0
private

Referenced by operator=().

double SelectedRegion::mF1
private

Referenced by operator=().

double SelectedRegion::mT0
private

Referenced by operator=().

double SelectedRegion::mT1
private

Referenced by operator=().

const wxChar * SelectedRegion::sDefaultT0Name = wxT("selStart")
static
const wxChar * SelectedRegion::sDefaultT1Name = wxT("selEnd")
static

The documentation for this class was generated from the following files: