Audacity 3.2.0
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)
 
void OnTogglePinnedHead (const CommandContext &context)
 

Variables

AttachedWindows::RegisteredFactory sKey
 
AttachedItem sAttachment
 

Function Documentation

◆ ContinueScrubbingMessage()

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

Definition at line 1458 of file AdornedRulerPanel.cpp.

1460 {
1461#if 0
1462 if(scrubber.Seeks())
1463 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1464 "Scrubbing" is variable-speed playback, ...
1465 "Seeking" is normal speed playback but with skips
1466 */
1467 return XO("Move to Seek");
1468 else
1469 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1470 "Scrubbing" is variable-speed playback, ...
1471 "Seeking" is normal speed playback but with skips
1472 */
1473 return XO("Move to Scrub");
1474#else
1475 if( clicked ) {
1476 // Since mouse is down, mention dragging first.
1477 // IsScrubbing is true if Scrubbing OR seeking.
1478 if( scrubber.IsScrubbing() )
1479 // User is dragging already, explain.
1480 return XO("Drag to Seek. Release to stop seeking.");
1481 else
1482 // User has clicked but not yet moved or released.
1483 return XO("Drag to Seek. Release and move to Scrub.");
1484 }
1485 // Since mouse is up, mention moving first.
1486 return XO("Move to Scrub. Drag to Seek.");
1487#endif
1488 }
XO("Cut/Copy/Paste")
bool Seeks() const
Definition: Scrubbing.cpp:800
bool IsScrubbing() const
Definition: Scrubbing.cpp:768

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 908 of file AdornedRulerPanel.cpp.

909{
910 const auto &viewInfo = ViewInfo::Get( *pProject );
911 auto width = viewInfo.GetTracksUsableWidth();
912 auto fraction = (xx - viewInfo.GetLeftOffset()) / double(width);
913 return std::max(0.0, std::min(1.0, fraction));
914}
int min(int a, int b)
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

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 900 of file AdornedRulerPanel.cpp.

901{
902 const auto &viewInfo = ViewInfo::Get( *pProject );
903 auto width = viewInfo.GetTracksUsableWidth();
904 return viewInfo.GetLeftOffset()
906}
static double GetPinnedHeadPositionPreference()

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:

◆ OnTogglePinnedHead()

void anonymous_namespace{AdornedRulerPanel.cpp}::OnTogglePinnedHead ( const CommandContext context)

Definition at line 2854 of file AdornedRulerPanel.cpp.

2855{
2857}
static AdornedRulerPanel & Get(AudacityProject &project)
AudacityProject & project

References AdornedRulerPanel::Get(), CommandContext::project, and AdornedRulerPanel::TogglePinnedHead().

Here is the call graph for this function:

◆ ScrubbingMessage()

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

Definition at line 1490 of file AdornedRulerPanel.cpp.

1491 {
1492 if (scrubber.HasMark())
1493 return ContinueScrubbingMessage(scrubber, clicked);
1494 else
1495 return StartScrubbingMessage(scrubber);
1496 }
bool HasMark() const
Definition: Scrubbing.h:88
const TranslatableString StartScrubbingMessage(const Scrubber &)
const TranslatableString ContinueScrubbingMessage(const Scrubber &scrubber, bool clicked)

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 1434 of file AdornedRulerPanel.cpp.

1435 {
1436#if 0
1437 if(scrubber.Seeks())
1438 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1439 "Scrubbing" is variable-speed playback, ...
1440 "Seeking" is normal speed playback but with skips
1441 */
1442 return XO("Click or drag to begin Seek");
1443 else
1444 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1445 "Scrubbing" is variable-speed playback, ...
1446 "Seeking" is normal speed playback but with skips
1447 */
1448 return XO("Click or drag to begin Scrub");
1449#else
1450 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1451 "Scrubbing" is variable-speed playback, ...
1452 "Seeking" is normal speed playback but with skips
1453 */
1454 return XO("Click & move to Scrub. Click & drag to Seek.");
1455#endif
1456 }

References XO().

Referenced by ScrubbingMessage().

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

Variable Documentation

◆ sAttachment

AttachedItem anonymous_namespace{AdornedRulerPanel.cpp}::sAttachment
Initial value:
{
Command( wxT("PinnedHead"), XXO("Continuous scrolling"),
{ wxT("Transport/Other/Options/Part2"), { OrderingHint::Begin, {} } }
}
wxT("CloseDown"))
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
XXO("&Cut/Copy/Paste Toolbar")
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static bool GetPinnedHeadPreference()
bool Begin(const FilePath &dataDir)
Definition: Journal.cpp:226
constexpr auto Command
Definition: MenuRegistry.h:456
void OnTogglePinnedHead(const CommandContext &context)
Options && CheckTest(const CheckFn &fn) &&
Definition: MenuRegistry.h:74

Definition at line 2860 of file AdornedRulerPanel.cpp.

Referenced by DEFINE_VERSION_CHECK::RegisterMenuItems(), and anonymous_namespace{NyqBench.cpp}::RegisterMenuItems().

◆ 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.GetTrackListWindow(),
wxID_ANY,
wxDefaultPosition,
wxSize( -1, AdornedRulerPanel::GetRulerHeight(false) ),
&viewInfo );
}
}
#define safenew
Definition: MemoryX.h:10
const auto project
This is an Audacity Specific ruler panel which additionally has border, selection markers,...
static ProjectWindow & Get(AudacityProject &project)

Definition at line 1251 of file AdornedRulerPanel.cpp.

Referenced by AdornedRulerPanel::Destroy(), and AdornedRulerPanel::Get().