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

Classes

class  PlayheadHandle
 

Typedefs

using Options = CommandManager::Options
 

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
 

Typedef Documentation

◆ Options

using anonymous_namespace{AdornedRulerPanel.cpp}::Options = typedef CommandManager::Options

Definition at line 2919 of file AdornedRulerPanel.cpp.

Function Documentation

◆ ContinueScrubbingMessage()

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

Definition at line 1496 of file AdornedRulerPanel.cpp.

1498 {
1499#if 0
1500 if(scrubber.Seeks())
1501 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1502 "Scrubbing" is variable-speed playback, ...
1503 "Seeking" is normal speed playback but with skips
1504 */
1505 return XO("Move to Seek");
1506 else
1507 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1508 "Scrubbing" is variable-speed playback, ...
1509 "Seeking" is normal speed playback but with skips
1510 */
1511 return XO("Move to Scrub");
1512#else
1513 if( clicked ) {
1514 // Since mouse is down, mention dragging first.
1515 // IsScrubbing is true if Scrubbing OR seeking.
1516 if( scrubber.IsScrubbing() )
1517 // User is dragging already, explain.
1518 return XO("Drag to Seek. Release to stop seeking.");
1519 else
1520 // User has clicked but not yet moved or released.
1521 return XO("Drag to Seek. Release and move to Scrub.");
1522 }
1523 // Since mouse is up, mention moving first.
1524 return XO("Move to Scrub. Drag to Seek.");
1525#endif
1526 }
XO("Cut/Copy/Paste")
bool Seeks() const
bool IsScrubbing() const

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

908{
909 const auto &viewInfo = ViewInfo::Get( *pProject );
910 auto width = viewInfo.GetTracksUsableWidth();
911 auto fraction = (xx - viewInfo.GetLeftOffset()) / double(width);
912 return std::max(0.0, std::min(1.0, fraction));
913}
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 899 of file AdornedRulerPanel.cpp.

900{
901 const auto &viewInfo = ViewInfo::Get( *pProject );
902 auto width = viewInfo.GetTracksUsableWidth();
903 return viewInfo.GetLeftOffset()
905}
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 2913 of file AdornedRulerPanel.cpp.

2914{
2916}
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 1528 of file AdornedRulerPanel.cpp.

1529 {
1530 if (scrubber.HasMark())
1531 return ContinueScrubbingMessage(scrubber, clicked);
1532 else
1533 return StartScrubbingMessage(scrubber);
1534 }
bool HasMark() const
Definition: Scrubbing.h:89
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 1472 of file AdornedRulerPanel.cpp.

1473 {
1474#if 0
1475 if(scrubber.Seeks())
1476 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1477 "Scrubbing" is variable-speed playback, ...
1478 "Seeking" is normal speed playback but with skips
1479 */
1480 return XO("Click or drag to begin Seek");
1481 else
1482 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1483 "Scrubbing" is variable-speed playback, ...
1484 "Seeking" is normal speed playback but with skips
1485 */
1486 return XO("Click or drag to begin Scrub");
1487#else
1488 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1489 "Scrubbing" is variable-speed playback, ...
1490 "Seeking" is normal speed playback but with skips
1491 */
1492 return XO("Click & move to Scrub. Click & drag to Seek.");
1493#endif
1494 }

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:
{
{ wxT("Transport/Other/Options/Part2"), { OrderingHint::Begin, {} } },
Command( wxT("PinnedHead"), XXO("Enable pinned play &head"),
}
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
void OnTogglePinnedHead(const CommandContext &context)
Options && CheckTest(const CheckFn &fn) &&

Definition at line 2920 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 1249 of file AdornedRulerPanel.cpp.

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