Audacity 3.2.0
|
#include <Project.h>
Public Types | |
using | const_iterator = Container::const_iterator |
using | const_reverse_iterator = Container::const_reverse_iterator |
using | value_type = Container::value_type |
Public Member Functions | |
AllProjects ()=default | |
size_t | size () const |
bool | empty () const |
const_iterator | begin () const |
const_iterator | end () const |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
value_type | Remove (AudacityProject &project) |
void | Add (const value_type &pProject) |
This invalidates iterators. More... | |
Static Public Member Functions | |
static std::mutex & | Mutex () |
Private Types | |
using | AProjectHolder = std::shared_ptr< AudacityProject > |
using | Container = std::vector< AProjectHolder > |
Static Private Attributes | |
static Container | gAudacityProjects |
Like a standard library container of all open projects.
So you can iterate easily over shared pointers to them with range-for : for (auto pProject : AllProjects{}) { ... } The pointers are never null.
However iterators will be invalid if addition or deletion of projects occur during traversal.
|
private |
using AllProjects::const_iterator = Container::const_iterator |
using AllProjects::const_reverse_iterator = Container::const_reverse_iterator |
|
private |
using AllProjects::value_type = Container::value_type |
|
default |
void AllProjects::Add | ( | const value_type & | pProject | ) |
This invalidates iterators.
Definition at line 56 of file Project.cpp.
References gAudacityProjects, and Mutex().
Referenced by ProjectManager::New().
auto AllProjects::begin | ( | ) | const |
Definition at line 22 of file Project.cpp.
References gAudacityProjects.
Referenced by CloseAllProjects(), TransportUtilities::DoStopPlaying(), audacity::cloud::audiocom::sync::GetOpenedProject(), ProjectFileManager::IsAlreadyOpen(), ProjectManager::OnCloseWindow(), ProjectWindow::OnIconize(), ProjectManager::SaveWindowSize(), and TitleRestorer::TitleRestorer().
|
inline |
Definition at line 47 of file Project.h.
References size.
Referenced by GetNextWindowPlacement(), audacity::cloud::audiocom::sync::GetPotentialTarget(), AudacityApp::MacNewFile(), ProjectManager::OnCloseWindow(), AudacityApp::OnMenuExit(), AudacityApp::OnMenuNew(), AudacityApp::OnMenuOpen(), AudacityApp::OnMenuPreferences(), and QuitAudacity().
auto AllProjects::end | ( | ) | const |
Definition at line 27 of file Project.cpp.
References gAudacityProjects.
Referenced by TransportUtilities::DoStopPlaying(), audacity::cloud::audiocom::sync::GetOpenedProject(), ProjectFileManager::IsAlreadyOpen(), ProjectWindow::OnIconize(), and TitleRestorer::TitleRestorer().
|
static |
In case you must iterate in a non-main thread, use this to prevent changes in the set of open projects
Definition at line 66 of file Project.cpp.
Referenced by Add().
auto AllProjects::rbegin | ( | ) | const |
Definition at line 32 of file Project.cpp.
References gAudacityProjects.
Referenced by GetNextWindowPlacement(), and audacity::cloud::audiocom::sync::GetPotentialTarget().
auto AllProjects::Remove | ( | AudacityProject & | project | ) |
Definition at line 42 of file Project.cpp.
References details::begin(), details::end(), and project.
Referenced by ProjectManager::OnCloseWindow().
auto AllProjects::rend | ( | ) | const |
Definition at line 37 of file Project.cpp.
References gAudacityProjects.
Referenced by GetNextWindowPlacement().
size_t AllProjects::size | ( | ) | const |
Definition at line 17 of file Project.cpp.
References gAudacityProjects.
Referenced by CloseAllProjects(), ProjectManager::OnCloseWindow(), AudacityApp::OnEndSession(), anonymous_namespace{TimerRecordDialog.cpp}::OnTimerRecord(), NyquistBase::Process(), and QuitAudacity().
|
staticprivate |