Output the audio signal with filtering by graphic equalizer in the *.wav file on the SD card using onboard CODEC. SD カードの *.wav ファイルのオーディオ信号をグラフィック・イコライザを通して,ボードに搭載されているCODEC で出力する.
Dependencies: F746_GUI F746_SAI_IO SD_PlayerSkeleton FrequencyResponseDrawer
mbed_src_STM32F7/common/FileBase.cpp@16:cbb726ac20d8, 2016-10-02 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Sun Oct 02 06:33:59 2016 +0000
- Revision:
- 16:cbb726ac20d8
17
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 16:cbb726ac20d8 | 1 | /* mbed Microcontroller Library |
MikamiUitOpen | 16:cbb726ac20d8 | 2 | * Copyright (c) 2006-2013 ARM Limited |
MikamiUitOpen | 16:cbb726ac20d8 | 3 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
MikamiUitOpen | 16:cbb726ac20d8 | 5 | * you may not use this file except in compliance with the License. |
MikamiUitOpen | 16:cbb726ac20d8 | 6 | * You may obtain a copy of the License at |
MikamiUitOpen | 16:cbb726ac20d8 | 7 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
MikamiUitOpen | 16:cbb726ac20d8 | 9 | * |
MikamiUitOpen | 16:cbb726ac20d8 | 10 | * Unless required by applicable law or agreed to in writing, software |
MikamiUitOpen | 16:cbb726ac20d8 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
MikamiUitOpen | 16:cbb726ac20d8 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
MikamiUitOpen | 16:cbb726ac20d8 | 13 | * See the License for the specific language governing permissions and |
MikamiUitOpen | 16:cbb726ac20d8 | 14 | * limitations under the License. |
MikamiUitOpen | 16:cbb726ac20d8 | 15 | */ |
MikamiUitOpen | 16:cbb726ac20d8 | 16 | #include "FileBase.h" |
MikamiUitOpen | 16:cbb726ac20d8 | 17 | |
MikamiUitOpen | 16:cbb726ac20d8 | 18 | namespace mbed { |
MikamiUitOpen | 16:cbb726ac20d8 | 19 | |
MikamiUitOpen | 16:cbb726ac20d8 | 20 | FileBase *FileBase::_head = NULL; |
MikamiUitOpen | 16:cbb726ac20d8 | 21 | |
MikamiUitOpen | 16:cbb726ac20d8 | 22 | FileBase::FileBase(const char *name, PathType t) : _next(NULL), |
MikamiUitOpen | 16:cbb726ac20d8 | 23 | _name(name), |
MikamiUitOpen | 16:cbb726ac20d8 | 24 | _path_type(t) { |
MikamiUitOpen | 16:cbb726ac20d8 | 25 | if (name != NULL) { |
MikamiUitOpen | 16:cbb726ac20d8 | 26 | // put this object at head of the list |
MikamiUitOpen | 16:cbb726ac20d8 | 27 | _next = _head; |
MikamiUitOpen | 16:cbb726ac20d8 | 28 | _head = this; |
MikamiUitOpen | 16:cbb726ac20d8 | 29 | } else { |
MikamiUitOpen | 16:cbb726ac20d8 | 30 | _next = NULL; |
MikamiUitOpen | 16:cbb726ac20d8 | 31 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 32 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 33 | |
MikamiUitOpen | 16:cbb726ac20d8 | 34 | FileBase::~FileBase() { |
MikamiUitOpen | 16:cbb726ac20d8 | 35 | if (_name != NULL) { |
MikamiUitOpen | 16:cbb726ac20d8 | 36 | // remove this object from the list |
MikamiUitOpen | 16:cbb726ac20d8 | 37 | if (_head == this) { // first in the list, so just drop me |
MikamiUitOpen | 16:cbb726ac20d8 | 38 | _head = _next; |
MikamiUitOpen | 16:cbb726ac20d8 | 39 | } else { // find the object before me, then drop me |
MikamiUitOpen | 16:cbb726ac20d8 | 40 | FileBase *p = _head; |
MikamiUitOpen | 16:cbb726ac20d8 | 41 | while (p->_next != this) { |
MikamiUitOpen | 16:cbb726ac20d8 | 42 | p = p->_next; |
MikamiUitOpen | 16:cbb726ac20d8 | 43 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 44 | p->_next = _next; |
MikamiUitOpen | 16:cbb726ac20d8 | 45 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 46 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 47 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 48 | |
MikamiUitOpen | 16:cbb726ac20d8 | 49 | FileBase *FileBase::lookup(const char *name, unsigned int len) { |
MikamiUitOpen | 16:cbb726ac20d8 | 50 | FileBase *p = _head; |
MikamiUitOpen | 16:cbb726ac20d8 | 51 | while (p != NULL) { |
MikamiUitOpen | 16:cbb726ac20d8 | 52 | /* Check that p->_name matches name and is the correct length */ |
MikamiUitOpen | 16:cbb726ac20d8 | 53 | if (p->_name != NULL && std::strncmp(p->_name, name, len) == 0 && std::strlen(p->_name) == len) { |
MikamiUitOpen | 16:cbb726ac20d8 | 54 | return p; |
MikamiUitOpen | 16:cbb726ac20d8 | 55 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 56 | p = p->_next; |
MikamiUitOpen | 16:cbb726ac20d8 | 57 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 58 | return NULL; |
MikamiUitOpen | 16:cbb726ac20d8 | 59 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 60 | |
MikamiUitOpen | 16:cbb726ac20d8 | 61 | FileBase *FileBase::get(int n) { |
MikamiUitOpen | 16:cbb726ac20d8 | 62 | FileBase *p = _head; |
MikamiUitOpen | 16:cbb726ac20d8 | 63 | int m = 0; |
MikamiUitOpen | 16:cbb726ac20d8 | 64 | while (p != NULL) { |
MikamiUitOpen | 16:cbb726ac20d8 | 65 | if (m == n) return p; |
MikamiUitOpen | 16:cbb726ac20d8 | 66 | |
MikamiUitOpen | 16:cbb726ac20d8 | 67 | m++; |
MikamiUitOpen | 16:cbb726ac20d8 | 68 | p = p->_next; |
MikamiUitOpen | 16:cbb726ac20d8 | 69 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 70 | return NULL; |
MikamiUitOpen | 16:cbb726ac20d8 | 71 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 72 | |
MikamiUitOpen | 16:cbb726ac20d8 | 73 | const char* FileBase::getName(void) { |
MikamiUitOpen | 16:cbb726ac20d8 | 74 | return _name; |
MikamiUitOpen | 16:cbb726ac20d8 | 75 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 76 | |
MikamiUitOpen | 16:cbb726ac20d8 | 77 | PathType FileBase::getPathType(void) { |
MikamiUitOpen | 16:cbb726ac20d8 | 78 | return _path_type; |
MikamiUitOpen | 16:cbb726ac20d8 | 79 | } |
MikamiUitOpen | 16:cbb726ac20d8 | 80 | |
MikamiUitOpen | 16:cbb726ac20d8 | 81 | } // namespace mbed |
MikamiUitOpen | 16:cbb726ac20d8 | 82 |