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

1455 {
1456#if 0
1457 if(scrubber.Seeks())
1458 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1459 "Scrubbing" is variable-speed playback, ...
1460 "Seeking" is normal speed playback but with skips
1461 */
1462 return XO("Move to Seek");
1463 else
1464 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1465 "Scrubbing" is variable-speed playback, ...
1466 "Seeking" is normal speed playback but with skips
1467 */
1468 return XO("Move to Scrub");
1469#else
1470 if( clicked ) {
1471 // Since mouse is down, mention dragging first.
1472 // IsScrubbing is true if Scrubbing OR seeking.
1473 if( scrubber.IsScrubbing() )
1474 // User is dragging already, explain.
1475 return XO("Drag to Seek. Release to stop seeking.");
1476 else
1477 // User has clicked but not yet moved or released.
1478 return XO("Drag to Seek. Release and move to Scrub.");
1479 }
1480 // Since mouse is up, mention moving first.
1481 return XO("Move to Scrub. Drag to Seek.");
1482#endif
1483 }
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 2849 of file AdornedRulerPanel.cpp.

2850{
2852}
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 1485 of file AdornedRulerPanel.cpp.

1486 {
1487 if (scrubber.HasMark())
1488 return ContinueScrubbingMessage(scrubber, clicked);
1489 else
1490 return StartScrubbingMessage(scrubber);
1491 }
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 1429 of file AdornedRulerPanel.cpp.

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

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 2855 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().