forked from Sneeds-Feed-and-Seed/sneedacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDependencies.h
66 lines (52 loc) · 1.91 KB
/
Dependencies.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**********************************************************************
Sneedacity: A Digital Audio Editor
Sneedacity(R) is copyright (c) 1999-2008 Sneedacity Team.
License: GPL v2. See License.txt.
Dependencies.h
Dominic Mazzoni
Vaughan Johnson
**********************************************************************/
#ifndef __SNEEDACITY_DEPENDENCIES__
#define __SNEEDACITY_DEPENDENCIES__
#include <list>
#include "MemoryX.h"
#include "wxFileNameWrapper.h" // member variable
class SneedacityProject;
class AliasedFile
{
public:
AliasedFile() {}
AliasedFile(wxFileNameWrapper &&fileName,
wxLongLong byteCount, bool bOriginalExists)
: mFileName(std::move(fileName))
, mByteCount(byteCount)
, mbOriginalExists(bOriginalExists)
{
}
AliasedFile(const AliasedFile &that) = default;
AliasedFile &operator= (AliasedFile&& that)
{
if(this != &that) {
mFileName = std::move(that.mFileName);
mByteCount = that.mByteCount;
mbOriginalExists = that.mbOriginalExists;
}
return *this;
}
wxFileNameWrapper mFileName;
wxLongLong mByteCount{}; // if stored as current default sample format
bool mbOriginalExists{};
};
// use list, not vector, because we need to take addresses of items in the container
// before it has grown to full size.
using AliasedFileArray = std::list<AliasedFile>;
// Checks for alias block files, modifies the project if the
// user requests it, and returns True if the user continues.
// Returns false if the user clicks Cancel, meaning that they do
// not want to go ahead with the Save/Save As operation.
bool ShowDependencyDialogIfNeeded(SneedacityProject *project,
bool isSaving);
// Returns a list of aliased files associated with a project.
void FindDependencies(SneedacityProject *project,
AliasedFileArray &outAliasedFiles);
#endif