An ImportPlugin for PCM data.
More...
An ImportPlugin for PCM data.
Definition at line 58 of file ImportPCM.cpp.
◆ PCMImportPlugin()
PCMImportPlugin::PCMImportPlugin |
( |
| ) |
|
|
inline |
Definition at line 61 of file ImportPCM.cpp.
63 {
64 }
ImportPlugin(FileExtensions supportedExtensions)
◆ ~PCMImportPlugin()
PCMImportPlugin::~PCMImportPlugin |
( |
| ) |
|
|
inline |
◆ GetPluginFormatDescription()
◆ GetPluginStringID()
wxString PCMImportPlugin::GetPluginStringID |
( |
| ) |
|
|
inlineoverridevirtual |
◆ Open()
Implements ImportPlugin.
Definition at line 111 of file ImportPCM.cpp.
113{
114 SF_INFO info;
115 wxFile f;
117
118 memset(&info, 0, sizeof(info));
119
120
121#ifdef __WXGTK__
122 if (filename.Lower().EndsWith(
wxT(
"mp3"))) {
123
124
125
126
127
128
129
130
131
132
133 return NULL;
134 }
135#endif
136
137
138 if (f.Open(filename)) {
139
140
141
142 file.reset(SFCall<SNDFILE*>(sf_open_fd, f.fd(), SFM_READ, &info, TRUE));
143 }
144
145
146
147
148 f.Detach();
149
150 if (!file) {
151
152
153
154
155 return nullptr;
156 } else if (file &&
157 (info.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_OGG) {
158
159
160
161
162
163
164
165
166
167
168
169 return nullptr;
170 }
171
172
173 return std::make_unique<PCMImportFileHandle>(filename, std::move(file), info);
174}
References wxT().
The documentation for this class was generated from the following file: