Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
anonymous_namespace{Import.cpp}::ImportProgressResultProxy Class Referencefinal
Inheritance diagram for anonymous_namespace{Import.cpp}::ImportProgressResultProxy:
[legend]
Collaboration diagram for anonymous_namespace{Import.cpp}::ImportProgressResultProxy:
[legend]

Public Member Functions

 ImportProgressResultProxy (ImportProgressListener *listener)
 
bool OnImportFileOpened (ImportFileHandle &importFileHandle) override
 
void OnImportProgress (double progress) override
 
void OnImportResult (ImportResult result) override
 Used to report on import result for file handle passed as argument to OnImportFileOpened. More...
 
ImportResult GetResult () const noexcept
 
- Public Member Functions inherited from ImportProgressListener
virtual ~ImportProgressListener ()
 
virtual bool OnImportFileOpened (ImportFileHandle &importFileHandle)=0
 
virtual void OnImportProgress (double progress)=0
 
virtual void OnImportResult (ImportResult result)=0
 Used to report on import result for file handle passed as argument to OnImportFileOpened. More...
 

Private Attributes

ImportProgressListenermListener {nullptr}
 
ImportResult mResult { ImportResult::Error }
 

Additional Inherited Members

- Public Types inherited from ImportProgressListener
enum class  ImportResult { Success , Error , Cancelled , Stopped }
 

Detailed Description

Definition at line 55 of file Import.cpp.

Constructor & Destructor Documentation

◆ ImportProgressResultProxy()

anonymous_namespace{Import.cpp}::ImportProgressResultProxy::ImportProgressResultProxy ( ImportProgressListener listener)
inline

Definition at line 61 of file Import.cpp.

62 : mListener(listener)
63 {
64
65 }

Member Function Documentation

◆ GetResult()

ImportResult anonymous_namespace{Import.cpp}::ImportProgressResultProxy::GetResult ( ) const
inlinenoexcept

Definition at line 88 of file Import.cpp.

◆ OnImportFileOpened()

bool anonymous_namespace{Import.cpp}::ImportProgressResultProxy::OnImportFileOpened ( ImportFileHandle importFileHandle)
inlineoverridevirtual

Called by Importer when it attempts to import file using registered ImportPlugin instance Could be called more than once, but for each call there will be a complementary call to OnImportResult

Parameters
importFileHandlefile handle created by ImportPlugin instance
Returns
Implementation may return false to abort import process

Implements ImportProgressListener.

Definition at line 67 of file Import.cpp.

68 {
70 if(mListener)
71 return mListener->OnImportFileOpened(importFileHandle);
72 return true;
73 }
virtual bool OnImportFileOpened(ImportFileHandle &importFileHandle)=0

◆ OnImportProgress()

void anonymous_namespace{Import.cpp}::ImportProgressResultProxy::OnImportProgress ( double  progress)
inlineoverridevirtual

Used to report on import progress [optional]

Parameters
progressimport progress in range [0, 1]

Implements ImportProgressListener.

Definition at line 75 of file Import.cpp.

76 {
77 if(mListener)
78 mListener->OnImportProgress(progress);
79 }
virtual void OnImportProgress(double progress)=0

◆ OnImportResult()

void anonymous_namespace{Import.cpp}::ImportProgressResultProxy::OnImportResult ( ImportResult  result)
inlineoverridevirtual

Used to report on import result for file handle passed as argument to OnImportFileOpened.

Implements ImportProgressListener.

Definition at line 81 of file Import.cpp.

82 {
83 mResult = result;
84 if(mListener)
86 }
virtual void OnImportResult(ImportResult result)=0
Used to report on import result for file handle passed as argument to OnImportFileOpened.

Member Data Documentation

◆ mListener

ImportProgressListener* anonymous_namespace{Import.cpp}::ImportProgressResultProxy::mListener {nullptr}
private

Definition at line 57 of file Import.cpp.

◆ mResult

ImportResult anonymous_namespace{Import.cpp}::ImportProgressResultProxy::mResult { ImportResult::Error }
private

Definition at line 58 of file Import.cpp.


The documentation for this class was generated from the following file: