Audacity 3.2.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ImportCommand Class Reference

Command for importing audio. More...

#include <ImportExportCommands.h>

Inheritance diagram for ImportCommand:
Collaboration diagram for ImportCommand:

Public Member Functions

ComponentInterfaceSymbol GetSymbol () const override
TranslatableString GetDescription () const override
template<bool Const>
bool VisitSettings (SettingsVisitorBase< Const > &S)
bool VisitSettings (SettingsVisitor &S) override
bool VisitSettings (ConstSettingsVisitor &S) override
void PopulateOrExchange (ShuttleGui &S) override
bool Apply (const CommandContext &context) override
ManualPageID ManualPage () override
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
virtual ~AudacityCommand ()
PluginPath GetPath () const override
VendorSymbol GetVendor () const override
wxString GetVersion () const override
ComponentInterfaceSymbol GetSymbol () const override=0
virtual TranslatableString GetDescription () const override
virtual ManualPageID ManualPage ()
virtual bool IsBatchProcessing () const
virtual void SetBatchProcessing (bool start)
virtual bool Apply (const CommandContext &WXUNUSED(context))
bool ShowInterface (wxWindow *parent, bool forceModal=false)
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
bool SaveSettingsAsString (wxString &parms)
bool LoadSettingsFromString (const wxString &parms)
bool DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
virtual bool Init ()
virtual bool PromptUser (wxWindow *parent)
virtual bool CheckWhetherSkipAudacityCommand ()
virtual void End ()
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
virtual bool TransferDataToWindow ()
virtual bool TransferDataFromWindow ()
virtual bool VisitSettings (SettingsVisitor &)
virtual bool VisitSettings (ConstSettingsVisitor &)
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
virtual PluginPath GetPath () const =0
virtual ComponentInterfaceSymbol GetSymbol () const =0
virtual VendorSymbol GetVendor () const =0
virtual wxString GetVersion () const =0
virtual TranslatableString GetDescription () const =0
TranslatableString GetName () const

Public Attributes

wxString mFileName

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Import2") }

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
- Protected Attributes inherited from AudacityCommand
wxDialog * mUIDialog
wxWindow * mUIParent

Detailed Description

Command for importing audio.

Definition at line 26 of file ImportExportCommands.h.

Member Function Documentation

◆ Apply()

bool ImportCommand::Apply ( const CommandContext context)

Definition at line 62 of file ImportExportCommands.cpp.

64 bool wasEmpty = TrackList::Get( context.project ).Any().empty();
65 bool success = ProjectFileManager::Get( context.project )
66 .Import(mFileName, false);
68 if (success && wasEmpty)
69 {
71 }
73 return success;
AudacityProject & project
bool Import(const FilePath &fileName, bool addToHistory=true)
static ProjectFileManager & Get(AudacityProject &project)
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1440
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:487
void SelectAllIfNone(AudacityProject &project)

References TrackList::Any(), TrackList::Get(), ProjectFileManager::Get(), ProjectFileManager::Import(), mFileName, CommandContext::project, and SelectUtilities::SelectAllIfNone().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString ImportCommand::GetDescription ( ) const

Reimplemented from AudacityCommand.

Definition at line 33 of file ImportExportCommands.h.

33{return XO("Imports from a file.");};

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol ImportCommand::GetSymbol ( ) const

Implements AudacityCommand.

Definition at line 32 of file ImportExportCommands.h.

32{return Symbol;};
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ ManualPage()

ManualPageID ImportCommand::ManualPage ( )

Reimplemented from AudacityCommand.

Definition at line 41 of file ImportExportCommands.h.

41{return L"Extra_Menu:_Scriptables_II#import";}

◆ PopulateOrExchange()

void ImportCommand::PopulateOrExchange ( ShuttleGui S)

Definition at line 51 of file ImportExportCommands.cpp.

53 S.AddSpace(0, 5);
55 S.StartMultiColumn(2, wxALIGN_CENTER);
56 {
57 S.TieTextBox(XXO("File Name:"),mFileName);
58 }
59 S.EndMultiColumn();
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64

References mFileName, S, and XXO().

Here is the call graph for this function:

◆ VisitSettings() [1/3]

bool ImportCommand::VisitSettings ( ConstSettingsVisitor )

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from AudacityCommand.

Definition at line 48 of file ImportExportCommands.cpp.

49 { return VisitSettings<true>(S); }

References S.

◆ VisitSettings() [2/3]

bool ImportCommand::VisitSettings ( SettingsVisitor )

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from AudacityCommand.

Definition at line 45 of file ImportExportCommands.cpp.

46 { return VisitSettings<false>(S); }

References S.

◆ VisitSettings() [3/3]

template<bool Const>
bool ImportCommand::VisitSettings ( SettingsVisitorBase< Const > &  S)

Definition at line 40 of file ImportExportCommands.cpp.

40 {
41 S.Define( mFileName, wxT("Filename"), wxString{} );
42 return true;

References mFileName, S, and wxT().

Here is the call graph for this function:

Member Data Documentation

◆ mFileName

wxString ImportCommand::mFileName

Definition at line 43 of file ImportExportCommands.h.

Referenced by Apply(), PopulateOrExchange(), and VisitSettings().

◆ Symbol

const ComponentInterfaceSymbol ImportCommand::Symbol { XO("Import2") }

Definition at line 29 of file ImportExportCommands.h.

Referenced by GetSymbol().

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