Audacity 3.2.0
|
Facilities for recording and playback of sequences of user interaction. More...
Namespaces | |
namespace | anonymous_namespace{Journal.cpp} |
namespace | anonymous_namespace{JournalOutput.cpp} |
namespace | anonymous_namespace{JournalRegistry.cpp} |
namespace | Events |
namespace | WindowPaths |
Classes | |
struct | RegisteredCommand |
struct | RegisteredInitializer |
class | SyncException |
Typedefs | |
using | InteractiveAction = std::function< int() > |
Function that returns a value which will be written to the journal. More... | |
using | Dispatcher = std::function< bool(const wxArrayStringEx &fields) > |
using | Dictionary = std::unordered_map< wxString, Journal::Dispatcher > |
using | Initializer = std::function< bool() > |
using | Initializers = std::vector< Initializer > |
Functions | |
bool | RecordEnabled () |
bool | SetRecordEnabled (bool value) |
bool | IsReplaying () |
void | SetInputFileName (const wxString &path) |
bool | Begin (const FilePath &dataDir) |
wxArrayStringEx | GetTokens () |
bool | Dispatch () |
void | Sync (const wxString &string) |
void | Sync (const wxArrayString &strings) |
void | Sync (std::initializer_list< const wxString > strings) |
int | IfNotPlaying (const wxString &string, const InteractiveAction &action) |
Call action only if not replaying; synchronize on string and int values. More... | |
int | GetExitCode () |
bool | IsRecording () |
bool | OpenOut (const wxString &fullPath) |
void | Output (const wxString &string) |
void | Output (const wxArrayString &strings) |
void | Output (std::initializer_list< const wxString > strings) |
void | Comment (const wxString &string) |
bool | GetError () |
void | SetError () |
const Dictionary & | GetDictionary () |
static std::vector< Initializer > & | sInitializers () |
const Initializers & | GetInitializers () |
Variables | |
constexpr auto | SeparatorCharacter = ',' |
constexpr auto | EscapeCharacter = '\\' |
constexpr auto | CommentCharacter = '#' |
Facilities for recording and playback of sequences of user interaction.
using Journal::Dictionary = typedef std::unordered_map< wxString, Journal::Dispatcher > |
Definition at line 46 of file JournalRegistry.h.
using Journal::Dispatcher = typedef std::function< bool(const wxArrayStringEx &fields) > |
Definition at line 35 of file JournalRegistry.h.
using Journal::Initializer = typedef std::function< bool() > |
Definition at line 53 of file JournalRegistry.h.
using Journal::Initializers = typedef std::vector< Initializer > |
Definition at line 61 of file JournalRegistry.h.
using Journal::InteractiveAction = typedef std::function< int() > |
WX_INIT_API bool Journal::Begin | ( | const FilePath & | dataDir | ) |
Definition at line 226 of file Journal.cpp.
References Comment(), GetError(), GetInitializers(), Journal::Events::anonymous_namespace{JournalEvents.cpp}::initializer, Journal::anonymous_namespace{Journal.cpp}::Log(), Journal::anonymous_namespace{Journal.cpp}::NextIn(), OpenOut(), Output(), Journal::anonymous_namespace{Journal.cpp}::PeekTokens(), RecordEnabled(), SetError(), Journal::anonymous_namespace{Journal.cpp}::sFileIn, Journal::anonymous_namespace{Journal.cpp}::sFileNameIn, Journal::anonymous_namespace{Journal.cpp}::sLine, Journal::anonymous_namespace{Journal.cpp}::sLineNumber, Journal::anonymous_namespace{Journal.cpp}::VersionCheck(), Journal::anonymous_namespace{Journal.cpp}::VersionString(), Journal::anonymous_namespace{Journal.cpp}::VersionToken, and wxT().
Referenced by AudacityApp::InitPart2(), anonymous_namespace{Registry.cpp}::CollectedItems::InsertNewItemUsingHint(), and anonymous_namespace{Registry.cpp}::CollectedItems::MergeItems().
WX_INIT_API void Journal::Comment | ( | const wxString & | string | ) |
Definition at line 62 of file JournalOutput.cpp.
References CommentCharacter, IsRecording(), and Journal::anonymous_namespace{JournalOutput.cpp}::sFileOut.
Referenced by Begin().
WX_INIT_API bool Journal::Dispatch | ( | ) |
Definition at line 291 of file Journal.cpp.
References GetDictionary(), GetError(), GetTokens(), IsReplaying(), and name.
Referenced by AudacityApp::OnIdle().
const Dictionary & Journal::GetDictionary | ( | ) |
Definition at line 53 of file JournalRegistry.cpp.
References Journal::anonymous_namespace{JournalRegistry.cpp}::sDictionary().
Referenced by Dispatch().
WX_INIT_API bool Journal::GetError | ( | ) |
Definition at line 30 of file JournalRegistry.cpp.
References Journal::anonymous_namespace{JournalRegistry.cpp}::sError.
Referenced by Begin(), Dispatch(), and GetExitCode().
WX_INIT_API int Journal::GetExitCode | ( | ) |
Definition at line 386 of file Journal.cpp.
References GetError(), Journal::anonymous_namespace{Journal.cpp}::NextIn(), Journal::anonymous_namespace{Journal.cpp}::PeekTokens(), SetError(), and Journal::anonymous_namespace{Journal.cpp}::sLineNumber.
Referenced by AudacityApp::OnRun().
WX_INIT_API const Initializers & Journal::GetInitializers | ( | ) |
Definition at line 69 of file JournalRegistry.cpp.
References sInitializers().
Referenced by Begin().
WX_INIT_API wxArrayStringEx Journal::GetTokens | ( | ) |
Definition at line 281 of file Journal.cpp.
References Journal::anonymous_namespace{Journal.cpp}::NextIn(), and Journal::anonymous_namespace{Journal.cpp}::PeekTokens().
Referenced by Dispatch(), IfNotPlaying(), and BasicMenu::anonymous_namespace{BasicMenu.cpp}::ReplayPopup().
WX_INIT_API int Journal::IfNotPlaying | ( | const wxString & | string, |
const InteractiveAction & | action | ||
) |
Call action only if not replaying; synchronize on string and int values.
If not replaying, call the function, and if recording, output the string and the return value.
If replaying, skip the action; Sync on the string; parse a value from the journal; throw SyncException if the value is ill-formed; otherwise output the value (if also recording), and return it
Definition at line 352 of file Journal.cpp.
References GetTokens(), IsRecording(), IsReplaying(), Output(), str, and Sync().
Referenced by AudacityMessageBox().
WX_INIT_API bool Journal::IsRecording | ( | ) |
Definition at line 28 of file JournalOutput.cpp.
References Journal::anonymous_namespace{JournalOutput.cpp}::sFileOut.
Referenced by Comment(), IfNotPlaying(), Output(), and Sync().
WX_INIT_API bool Journal::IsReplaying | ( | ) |
Definition at line 216 of file Journal.cpp.
References Journal::anonymous_namespace{Journal.cpp}::sFileIn.
Referenced by Dispatch(), IfNotPlaying(), Journal::anonymous_namespace{Journal.cpp}::PeekTokens(), BasicMenu::Handle::Popup(), and Sync().
WX_INIT_API bool Journal::OpenOut | ( | const wxString & | fullPath | ) |
Definition at line 33 of file JournalOutput.cpp.
References Journal::anonymous_namespace{JournalOutput.cpp}::sFileOut.
Referenced by Begin().
WX_INIT_API void Journal::Output | ( | const wxArrayString & | strings | ) |
Definition at line 51 of file JournalOutput.cpp.
References EscapeCharacter, IsRecording(), Output(), and SeparatorCharacter.
WX_INIT_API void Journal::Output | ( | const wxString & | string | ) |
Definition at line 45 of file JournalOutput.cpp.
References IsRecording(), and Journal::anonymous_namespace{JournalOutput.cpp}::sFileOut.
Referenced by Begin(), MenuCreator::ExecuteCommand(), Journal::Events::anonymous_namespace{JournalEvents.cpp}::Watcher::FilterEvent(), BasicMenu::anonymous_namespace{BasicMenu.cpp}::Watcher::FilterEvent(), IfNotPlaying(), Output(), BasicMenu::Handle::Popup(), and Sync().
WX_INIT_API void Journal::Output | ( | std::initializer_list< const wxString > | strings | ) |
Definition at line 57 of file JournalOutput.cpp.
References Output().
WX_INIT_API bool Journal::RecordEnabled | ( | ) |
Definition at line 204 of file Journal.cpp.
References Journal::anonymous_namespace{Journal.cpp}::JournalEnabled, and Setting< T >::Read().
Referenced by Begin(), anonymous_namespace{PluginMenus.cpp}::OnWriteJournal(), and anonymous_namespace{PluginMenus.cpp}::ToolsMenu().
WX_INIT_API void Journal::SetError | ( | ) |
Definition at line 35 of file JournalRegistry.cpp.
References Journal::anonymous_namespace{JournalRegistry.cpp}::sError.
Referenced by Begin(), GetExitCode(), Journal::RegisteredCommand::RegisteredCommand(), and Journal::SyncException::SyncException().
WX_INIT_API void Journal::SetInputFileName | ( | const wxString & | path | ) |
Definition at line 221 of file Journal.cpp.
References Journal::anonymous_namespace{Journal.cpp}::sFileNameIn.
Referenced by AudacityApp::InitPart2().
WX_INIT_API bool Journal::SetRecordEnabled | ( | bool | value | ) |
Definition at line 209 of file Journal.cpp.
References audacity::BasicSettings::Flush(), gPrefs, Journal::anonymous_namespace{Journal.cpp}::JournalEnabled, and Setting< T >::Write().
Referenced by anonymous_namespace{PluginMenus.cpp}::OnWriteJournal().
|
static |
Definition at line 58 of file JournalRegistry.cpp.
Referenced by GetInitializers(), and Journal::RegisteredInitializer::RegisteredInitializer().
WX_INIT_API void Journal::Sync | ( | const wxArrayString & | strings | ) |
Definition at line 339 of file Journal.cpp.
References EscapeCharacter, IsRecording(), IsReplaying(), SeparatorCharacter, and Sync().
WX_INIT_API void Journal::Sync | ( | const wxString & | string | ) |
Definition at line 321 of file Journal.cpp.
References IsRecording(), IsReplaying(), Journal::anonymous_namespace{Journal.cpp}::NextIn(), Output(), Journal::anonymous_namespace{Journal.cpp}::sFileIn, and Journal::anonymous_namespace{Journal.cpp}::sLine.
Referenced by IfNotPlaying(), Sync(), and audacity::cloud::audiocom::CloudSyncService::SyncCloudSnapshot().
WX_INIT_API void Journal::Sync | ( | std::initializer_list< const wxString > | strings | ) |
Definition at line 347 of file Journal.cpp.
References Sync().
|
constexpr |
Definition at line 24 of file JournalOutput.h.
Referenced by Comment(), and Journal::anonymous_namespace{Journal.cpp}::PeekTokens().
|
constexpr |
Definition at line 23 of file JournalOutput.h.
Referenced by Journal::WindowPaths::FindByPath(), Journal::WindowPaths::FindPath(), Output(), Journal::anonymous_namespace{Journal.cpp}::PeekTokens(), and Sync().
|
constexpr |
Definition at line 22 of file JournalOutput.h.
Referenced by Output(), Journal::anonymous_namespace{Journal.cpp}::PeekTokens(), and Sync().