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

Function Documentation

◆ ContinueScrubbingMessage()

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

Definition at line 1468 of file AdornedRulerPanel.cpp.

1470 {
1471#if 0
1472 if(scrubber.Seeks())
1473 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1474 "Scrubbing" is variable-speed playback, ...
1475 "Seeking" is normal speed playback but with skips
1476 */
1477 return XO("Move to Seek");
1478 else
1479 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1480 "Scrubbing" is variable-speed playback, ...
1481 "Seeking" is normal speed playback but with skips
1482 */
1483 return XO("Move to Scrub");
1484#else
1485 if( clicked ) {
1486 // Since mouse is down, mention dragging first.
1487 // IsScrubbing is true if Scrubbing OR seeking.
1488 if( scrubber.IsScrubbing() )
1489 // User is dragging already, explain.
1490 return XO("Drag to Seek. Release to stop seeking.");
1491 else
1492 // User has clicked but not yet moved or released.
1493 return XO("Drag to Seek. Release and move to Scrub.");
1494 }
1495 // Since mouse is up, mention moving first.
1496 return XO("Move to Scrub. Drag to Seek.");
1497#endif
1498 }
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 885 of file AdornedRulerPanel.cpp.

886{
887 const auto &viewInfo = ViewInfo::Get( *pProject );
888 auto width = viewInfo.GetTracksUsableWidth();
889 auto fraction = (xx - viewInfo.GetLeftOffset()) / double(width);
890 return std::max(0.0, std::min(1.0, fraction));
891}
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 877 of file AdornedRulerPanel.cpp.

878{
879 const auto &viewInfo = ViewInfo::Get( *pProject );
880 auto width = viewInfo.GetTracksUsableWidth();
881 return viewInfo.GetLeftOffset()
883}
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 2888 of file AdornedRulerPanel.cpp.

2889{
2891}
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 1500 of file AdornedRulerPanel.cpp.

1501 {
1502 if (scrubber.HasMark())
1503 return ContinueScrubbingMessage(scrubber, clicked);
1504 else
1505 return StartScrubbingMessage(scrubber);
1506 }
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 1444 of file AdornedRulerPanel.cpp.

1445 {
1446#if 0
1447 if(scrubber.Seeks())
1448 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1449 "Scrubbing" is variable-speed playback, ...
1450 "Seeking" is normal speed playback but with skips
1451 */
1452 return XO("Click or drag to begin Seek");
1453 else
1454 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1455 "Scrubbing" is variable-speed playback, ...
1456 "Seeking" is normal speed playback but with skips
1457 */
1458 return XO("Click or drag to begin Scrub");
1459#else
1460 /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1461 "Scrubbing" is variable-speed playback, ...
1462 "Seeking" is normal speed playback but with skips
1463 */
1464 return XO("Click & move to Scrub. Click & drag to Seek.");
1465#endif
1466 }

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("Pinned Play/Record &Head (on/off)"),
}
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
std::unique_ptr< CommandItem > Command(const CommandID &name, const TranslatableString &label_in, void(Handler::*pmf)(const CommandContext &), CommandFlag flags, const CommandManager::Options &options={}, CommandHandlerFinder finder=FinderScope::DefaultFinder())
void OnTogglePinnedHead(const CommandContext &context)
Options && CheckTest(const CheckFn &fn) &&

Definition at line 2895 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
This is an Audacity Specific ruler panel which additionally has border, selection markers,...
static ProjectWindow & Get(AudacityProject &project)

Definition at line 1227 of file AdornedRulerPanel.cpp.

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