MCPcopy Create free account
hub / github.com/audacity/audacity / Beep

Method Beep

libraries/lib-wx-init/ProgressDialog.cpp:1647–1682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1645}
1646
1647void ProgressDialog::Beep() const
1648{
1649 int after;
1650 bool should;
1651 wxString name;
1652
1653 gPrefs->Read(wxT("/GUI/BeepOnCompletion"), &should, false);
1654 gPrefs->Read(wxT("/GUI/BeepAfterDuration"), &after, 60);
1655 gPrefs->Read(wxT("/GUI/BeepFileName"), &name, {});
1656
1657 if (should && wxGetUTCTimeMillis().GetValue() - mStartTime > after * 1000)
1658 {
1659 wxBusyCursor busy;
1660 wxSound s;
1661
1662 if (name.empty())
1663 {
1664#ifdef __WXOSX_COCOA__
1665 // wxSound::Create(size_t,const void*) isn't implemented;
1666 // use the system beep function.
1667 NSBeep();
1668#else
1669 s.Create(sizeof(beep), beep);
1670#endif
1671 }
1672 else
1673 {
1674 s.Create(name);
1675 }
1676
1677 if (s.IsOk())
1678 {
1679 s.Play(wxSOUND_SYNC);
1680 }
1681 }
1682}
1683
1684// Confirm action taken by user.
1685// Returns TRUE if the user confirms Yes

Callers

nothing calls this directly

Calls 5

ReadMethod · 0.45
GetValueMethod · 0.45
emptyMethod · 0.45
CreateMethod · 0.45
IsOkMethod · 0.45

Tested by

no test coverage detected