Audacity  3.0.3
Classes | Functions | Variables
anonymous_namespace{AdornedRulerPanel.cpp} Namespace Reference

Classes

class  PlayheadHandle
 

Functions

wxCoord GetPlayHeadX (const AudacityProject *pProject)
 
double GetPlayHeadFraction (const AudacityProject *pProject, wxCoord xx)
 
const TranslatableString StartScrubbingMessage (const Scrubber &)
 
const TranslatableString ContinueScrubbingMessage (const Scrubber &scrubber, bool clicked)
 
const TranslatableString ScrubbingMessage (const Scrubber &scrubber, bool clicked)
 

Variables

AttachedWindows::RegisteredFactory sKey
 

Function Documentation

◆ ContinueScrubbingMessage()

const TranslatableString anonymous_namespace{AdornedRulerPanel.cpp}::ContinueScrubbingMessage ( const Scrubber scrubber,
bool  clicked 
)

Definition at line 1126 of file AdornedRulerPanel.cpp.

1128  {
1129 #if 0
1130  if(scrubber.Seeks())
1131  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1132  "Scrubbing" is variable-speed playback, ...
1133  "Seeking" is normal speed playback but with skips
1134  */
1135  return XO("Move to Seek");
1136  else
1137  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1138  "Scrubbing" is variable-speed playback, ...
1139  "Seeking" is normal speed playback but with skips
1140  */
1141  return XO("Move to Scrub");
1142 #else
1143  if( clicked ) {
1144  // Since mouse is down, mention dragging first.
1145  // IsScrubbing is true if Scrubbing OR seeking.
1146  if( scrubber.IsScrubbing() )
1147  // User is dragging already, explain.
1148  return XO("Drag to Seek. Release to stop seeking.");
1149  else
1150  // User has clicked but not yet moved or released.
1151  return XO("Drag to Seek. Release and move to Scrub.");
1152  }
1153  // Since mouse is up, mention moving first.
1154  return XO("Move to Scrub. Drag to Seek.");
1155 #endif
1156  }

References Scrubber::IsScrubbing(), Scrubber::Seeks(), and XO.

Referenced by ScrubbingMessage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPlayHeadFraction()

double anonymous_namespace{AdornedRulerPanel.cpp}::GetPlayHeadFraction ( const AudacityProject pProject,
wxCoord  xx 
)

Definition at line 582 of file AdornedRulerPanel.cpp.

583 {
584  const auto &viewInfo = ViewInfo::Get( *pProject );
585  auto width = viewInfo.GetTracksUsableWidth();
586  auto fraction = (xx - viewInfo.GetLeftOffset()) / double(width);
587  return std::max(0.0, std::min(1.0, fraction));
588 }

References ViewInfo::Get(), and min().

Referenced by anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::Drag(), and anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::Release().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPlayHeadX()

wxCoord anonymous_namespace{AdornedRulerPanel.cpp}::GetPlayHeadX ( const AudacityProject pProject)

Definition at line 574 of file AdornedRulerPanel.cpp.

575 {
576  const auto &viewInfo = ViewInfo::Get( *pProject );
577  auto width = viewInfo.GetTracksUsableWidth();
578  return viewInfo.GetLeftOffset()
580 }

References ViewInfo::Get(), and TracksPrefs::GetPinnedHeadPositionPreference().

Referenced by anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::HitTest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScrubbingMessage()

const TranslatableString anonymous_namespace{AdornedRulerPanel.cpp}::ScrubbingMessage ( const Scrubber scrubber,
bool  clicked 
)

Definition at line 1158 of file AdornedRulerPanel.cpp.

1159  {
1160  if (scrubber.HasMark())
1161  return ContinueScrubbingMessage(scrubber, clicked);
1162  else
1163  return StartScrubbingMessage(scrubber);
1164  }

References ContinueScrubbingMessage(), Scrubber::HasMark(), and StartScrubbingMessage().

Referenced by AdornedRulerPanel::ScrubbingHandle::Preview().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartScrubbingMessage()

const TranslatableString anonymous_namespace{AdornedRulerPanel.cpp}::StartScrubbingMessage ( const Scrubber )

Definition at line 1102 of file AdornedRulerPanel.cpp.

1103  {
1104 #if 0
1105  if(scrubber.Seeks())
1106  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1107  "Scrubbing" is variable-speed playback, ...
1108  "Seeking" is normal speed playback but with skips
1109  */
1110  return XO("Click or drag to begin Seek");
1111  else
1112  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1113  "Scrubbing" is variable-speed playback, ...
1114  "Seeking" is normal speed playback but with skips
1115  */
1116  return XO("Click or drag to begin Scrub");
1117 #else
1118  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1119  "Scrubbing" is variable-speed playback, ...
1120  "Seeking" is normal speed playback but with skips
1121  */
1122  return XO("Click & move to Scrub. Click & drag to Seek.");
1123 #endif
1124  }

References XO.

Referenced by ScrubbingMessage().

Here is the caller graph for this function:

Variable Documentation

◆ sKey

AttachedWindows::RegisteredFactory anonymous_namespace{AdornedRulerPanel.cpp}::sKey
Initial value:
{
[]( AudacityProject &project ) -> wxWeakRef< wxWindow > {
auto &viewInfo = ViewInfo::Get( project );
auto &window = ProjectWindow::Get( project );
return safenew AdornedRulerPanel( &project, window.GetTopPanel(),
wxID_ANY,
wxDefaultPosition,
wxSize( -1, AdornedRulerPanel::GetRulerHeight(false) ),
&viewInfo );
}
}

Definition at line 885 of file AdornedRulerPanel.cpp.

ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:241
AdornedRulerPanel
This is an Audacity Specific ruler panel which additionally has border, selection markers,...
Definition: AdornedRulerPanel.h:27
XO
#define XO(s)
Definition: Internat.h:31
Scrubber::Seeks
bool Seeks() const
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:535
Scrubber::HasMark
bool HasMark() const
Definition: Scrubbing.h:91
TracksPrefs::GetPinnedHeadPositionPreference
static double GetPinnedHeadPositionPreference()
Definition: TracksPrefs.cpp:406
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
anonymous_namespace{AdornedRulerPanel.cpp}::StartScrubbingMessage
const TranslatableString StartScrubbingMessage(const Scrubber &)
Definition: AdornedRulerPanel.cpp:1102
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
anonymous_namespace{AdornedRulerPanel.cpp}::ContinueScrubbingMessage
const TranslatableString ContinueScrubbingMessage(const Scrubber &scrubber, bool clicked)
Definition: AdornedRulerPanel.cpp:1126
Scrubber::IsScrubbing
bool IsScrubbing() const
AdornedRulerPanel::GetRulerHeight
int GetRulerHeight()
Definition: AdornedRulerPanel.h:51
safenew
#define safenew
Definition: MemoryX.h:10