Audacity 3.2.0
Functions | Variables
anonymous_namespace{ImportMIDI.cpp} Namespace Reference

Functions

void OnImportMIDI (const CommandContext &context)
 

Variables

AttachedItem sAttachment
 

Function Documentation

◆ OnImportMIDI()

void anonymous_namespace{ImportMIDI.cpp}::OnImportMIDI ( const CommandContext context)

Definition at line 138 of file ImportMIDI.cpp.

139{
140 auto &project = context.project;
141 auto &window = GetProjectFrame( project );
142
143 wxString fileName = SelectFile(FileNames::Operation::Open,
144 XO("Select a MIDI file"),
145 wxEmptyString, // Path
146 wxT(""), // Name
147 wxT(""), // Extension
148 {
149 { XO("MIDI and Allegro files"),
150 { wxT("mid"), wxT("midi"), wxT("gro"), }, true },
151 { XO("MIDI files"),
152 { wxT("mid"), wxT("midi"), }, true },
153 { XO("Allegro files"),
154 { wxT("gro"), }, true },
156 },
157 wxRESIZE_BORDER, // Flags
158 &window); // Parent
159
160 if (!fileName.empty())
161 DoImportMIDI(project, fileName);
162}
wxT("CloseDown"))
XO("Cut/Copy/Paste")
bool DoImportMIDI(AudacityProject &project, const FilePath &fileName)
Definition: ImportMIDI.cpp:39
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
Definition: SelectFile.cpp:17
AudacityProject & project
FILES_API const FileType AllFiles
Definition: FileNames.h:70

References FileNames::AllFiles, DoImportMIDI(), GetProjectFrame(), CommandContext::project, SelectFile(), wxT(), and XO().

Here is the call graph for this function:

Variable Documentation

◆ sAttachment

AttachedItem anonymous_namespace{ImportMIDI.cpp}::sAttachment
Initial value:
{
{ wxT("File/Import-Export/Import"),
{ OrderingHint::After, {"ImportAudio"} } },
Command( wxT("ImportMIDI"), XXO("&MIDI..."), OnImportMIDI,
}
const ReservedCommandFlag & AudioIONotBusyFlag()
XXO("&Cut/Copy/Paste Toolbar")
constexpr auto Command
void OnImportMIDI(const CommandContext &context)
Definition: ImportMIDI.cpp:138

Definition at line 164 of file ImportMIDI.cpp.