Anh Tran / Mbed OS GR-Boards_WebCamera

Dependencies:   HttpServer_snapshot_mbed-os

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NullSpeaker.h Source File

NullSpeaker.h

00001 /* mbed NullSpeaker Library
00002  * Copyright (C) 2016 dkato
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef NULL_SPEAKER_H
00018 #define NULL_SPEAKER_H
00019 
00020 #include "mbed.h"
00021 #include "AUDIO_RBSP.h"
00022 
00023 /** NullSpeaker class
00024 *
00025 */
00026 class NullSpeaker : public AUDIO_RBSP {
00027 public:
00028     /** Create a NullSpeaker
00029      * 
00030      */
00031     NullSpeaker() {}
00032 
00033     virtual ~NullSpeaker() {}
00034 
00035     virtual void power(bool type = true) {}
00036 
00037     virtual bool format(char length) {
00038         return true;
00039     }
00040 
00041     virtual bool frequency(int hz) {
00042         return true;
00043     }
00044 
00045     virtual int write(void * const p_data, uint32_t data_size, const rbsp_data_conf_t * const p_data_conf = NULL) {
00046         if (p_data_conf != NULL) {
00047             return data_size;
00048         }
00049         if (p_data_conf->p_notify_func != NULL) {
00050             p_data_conf->p_notify_func(p_data, data_size, p_data_conf->p_app_data);
00051         }
00052         return 0;
00053     }
00054 
00055     virtual int read(void * const p_data, uint32_t data_size, const rbsp_data_conf_t * const p_data_conf = NULL) {
00056         return -1;
00057     }
00058 
00059     virtual bool outputVolume(float leftVolumeOut, float rightVolumeOut) {
00060         return false;
00061     }
00062 
00063     virtual bool micVolume(float VolumeIn) {
00064         return false;
00065     }
00066 };
00067 
00068 #endif // NULL_SPEAKER_H