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