Define an AudacityException subclass for unready on-demand data
This commit is contained in:
parent
acf3c018bb
commit
9fde75268f
|
@ -1214,6 +1214,7 @@
|
|||
5E78388E1DE4995F003270C0 /* AudacityException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E78388D1DE4995E003270C0 /* AudacityException.cpp */; };
|
||||
5E79B3411D5CC38D001D677D /* ImportGStreamer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E79B33F1D5CC38D001D677D /* ImportGStreamer.cpp */; };
|
||||
5E94A1BA1D1F1C8400A8713A /* wxPanelWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E94A1B81D1F1C8400A8713A /* wxPanelWrapper.cpp */; };
|
||||
5EC7ED061E101C5C0052CAE2 /* NotYetAvailableException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EC7ED041E101C5C0052CAE2 /* NotYetAvailableException.cpp */; };
|
||||
5ED1D0AD1CDE55BD00471E3C /* Overlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5ED1D0A91CDE55BD00471E3C /* Overlay.cpp */; };
|
||||
5ED1D0AE1CDE55BD00471E3C /* OverlayPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5ED1D0AB1CDE55BD00471E3C /* OverlayPanel.cpp */; };
|
||||
5ED1D0B11CDE560C00471E3C /* BackedPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5ED1D0AF1CDE560C00471E3C /* BackedPanel.cpp */; };
|
||||
|
@ -3003,6 +3004,8 @@
|
|||
5E94A1B81D1F1C8400A8713A /* wxPanelWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wxPanelWrapper.cpp; sourceTree = "<group>"; };
|
||||
5E94A1B91D1F1C8400A8713A /* wxPanelWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wxPanelWrapper.h; sourceTree = "<group>"; };
|
||||
5EB9EA281D5B81270050AF40 /* ImportForwards.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImportForwards.h; sourceTree = "<group>"; };
|
||||
5EC7ED041E101C5C0052CAE2 /* NotYetAvailableException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotYetAvailableException.cpp; sourceTree = "<group>"; };
|
||||
5EC7ED051E101C5C0052CAE2 /* NotYetAvailableException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotYetAvailableException.h; sourceTree = "<group>"; };
|
||||
5ECCE7651DE49834009900E9 /* AudacityException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudacityException.h; sourceTree = "<group>"; };
|
||||
5ED18DB61CC16B1E00FAFE95 /* Reverb_libSoX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reverb_libSoX.h; sourceTree = "<group>"; };
|
||||
5ED18DB71CC290AB00FAFE95 /* wxFileNameWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wxFileNameWrapper.h; sourceTree = "<group>"; };
|
||||
|
@ -4054,6 +4057,8 @@
|
|||
1790AFDF09883BFD008A330A /* LegacyAliasBlockFile.h */,
|
||||
1790AFE009883BFD008A330A /* LegacyBlockFile.cpp */,
|
||||
1790AFE109883BFD008A330A /* LegacyBlockFile.h */,
|
||||
5EC7ED041E101C5C0052CAE2 /* NotYetAvailableException.cpp */,
|
||||
5EC7ED051E101C5C0052CAE2 /* NotYetAvailableException.h */,
|
||||
186CCE6B0E51F47400659159 /* ODDecodeBlockFile.cpp */,
|
||||
186CCE6C0E51F47400659159 /* ODDecodeBlockFile.h */,
|
||||
1841B50F0E00AD8D00F386E9 /* ODPCMAliasBlockFile.cpp */,
|
||||
|
@ -7402,6 +7407,7 @@
|
|||
1790B16109883BFD008A330A /* FFT.cpp in Sources */,
|
||||
1790B16209883BFD008A330A /* FileFormats.cpp in Sources */,
|
||||
1790B16309883BFD008A330A /* FreqWindow.cpp in Sources */,
|
||||
5EC7ED061E101C5C0052CAE2 /* NotYetAvailableException.cpp in Sources */,
|
||||
1790B16509883BFD008A330A /* HistoryWindow.cpp in Sources */,
|
||||
1790B16609883BFD008A330A /* ImageManipulation.cpp in Sources */,
|
||||
5E79B3411D5CC38D001D677D /* ImportGStreamer.cpp in Sources */,
|
||||
|
|
|
@ -32,6 +32,8 @@ libaudacity_la_SOURCES = \
|
|||
blockfile/LegacyAliasBlockFile.h \
|
||||
blockfile/LegacyBlockFile.cpp \
|
||||
blockfile/LegacyBlockFile.h \
|
||||
blockfile/NotYetAvailableException.cpp \
|
||||
blockfile/NotYetAvailableException.h \
|
||||
blockfile/ODDecodeBlockFile.cpp \
|
||||
blockfile/ODDecodeBlockFile.h \
|
||||
blockfile/ODPCMAliasBlockFile.cpp \
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// NotYetAvailableException.cpp
|
||||
//
|
||||
//
|
||||
// Created by Paul Licameli on 12/25/16.
|
||||
//
|
||||
//
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "NotYetAvailableException.h"
|
||||
|
||||
NotYetAvailableException::~NotYetAvailableException()
|
||||
{
|
||||
}
|
||||
|
||||
std::unique_ptr< AudacityException > NotYetAvailableException::Move()
|
||||
{
|
||||
return std::unique_ptr< AudacityException >
|
||||
{ safenew NotYetAvailableException{ std::move( *this ) } };
|
||||
}
|
||||
|
||||
wxString NotYetAvailableException::ErrorMessage() const
|
||||
{
|
||||
return wxString::Format(
|
||||
_("This operation cannot be done until importation of %s completes."),
|
||||
mFileName.GetFullName()
|
||||
);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
//
|
||||
// NotYetAvailableException.h
|
||||
//
|
||||
//
|
||||
// Created by Paul Licameli on 12/25/16.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef __AUDACITY_NOT_YET_AVAILABLE_EXCEPTION__
|
||||
#define __AUDACITY_NOT_YET_AVAILABLE_EXCEPTION__
|
||||
|
||||
#include "../FileException.h"
|
||||
#include <wx/filename.h>
|
||||
|
||||
// This exception can be thrown when attempting read of on-demand block files
|
||||
// that have not yet completed loading.
|
||||
class NotYetAvailableException final : public FileException
|
||||
{
|
||||
public:
|
||||
NotYetAvailableException( const wxFileName &fileName )
|
||||
: FileException{ Cause::Read, fileName } {}
|
||||
NotYetAvailableException(NotYetAvailableException &&that)
|
||||
: FileException( std::move( that ) ) {}
|
||||
~NotYetAvailableException();
|
||||
|
||||
protected:
|
||||
std::unique_ptr< AudacityException > Move() override;
|
||||
wxString ErrorMessage() const override;
|
||||
|
||||
private:
|
||||
wxFileName mFileName;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -134,6 +134,7 @@
|
|||
<ClCompile Include="..\..\..\src\BatchProcessDialog.cpp" />
|
||||
<ClCompile Include="..\..\..\src\Benchmark.cpp" />
|
||||
<ClCompile Include="..\..\..\src\BlockFile.cpp" />
|
||||
<ClCompile Include="..\..\..\src\blockfile\NotYetAvailableException.cpp" />
|
||||
<ClCompile Include="..\..\..\src\commands\OpenSaveCommands.cpp" />
|
||||
<ClCompile Include="..\..\..\src\Dependencies.cpp" />
|
||||
<ClCompile Include="..\..\..\src\DeviceChange.cpp" />
|
||||
|
@ -426,6 +427,7 @@
|
|||
<ClInclude Include="..\..\..\src\BatchProcessDialog.h" />
|
||||
<ClInclude Include="..\..\..\src\Benchmark.h" />
|
||||
<ClInclude Include="..\..\..\src\BlockFile.h" />
|
||||
<ClInclude Include="..\..\..\src\blockfile\NotYetAvailableException.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\CommandFlag.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\CommandFunctors.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\OpenSaveCommands.h" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
|
@ -899,6 +899,9 @@
|
|||
<ClCompile Include="..\..\..\src\UserException.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\blockfile\NotYetAvailableException.cpp">
|
||||
<Filter>src\blockfile</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\AboutDialog.h">
|
||||
|
@ -1825,6 +1828,9 @@
|
|||
<ClInclude Include="..\..\..\src\UserException.h">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\blockfile\NotYetAvailableException.h">
|
||||
<Filter>src\blockfile</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\audacity.ico">
|
||||
|
@ -2048,4 +2054,4 @@
|
|||
<Filter>plug-ins</Filter>
|
||||
</copy>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
Loading…
Reference in New Issue