platformRedBook.h
Engine/source/platform/platformRedBook.h
Classes:
class
class
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _PLATFORMREDBOOK_H_ 25#define _PLATFORMREDBOOK_H_ 26 27#ifndef _PLATFORM_H_ 28#include "platform/platform.h" 29#endif 30#ifndef _TVECTOR_H_ 31#include "core/util/tVector.h" 32#endif 33 34class RedBookDevice 35{ 36 public: 37 RedBookDevice(); 38 virtual ~RedBookDevice(); 39 40 bool mAcquired; 41 char * mDeviceName; 42 43 virtual bool open() = 0; 44 virtual bool close() = 0; 45 virtual bool play(U32) = 0; 46 virtual bool stop() = 0; 47 virtual bool getTrackCount(U32 *) = 0; 48 virtual bool getVolume(F32 *) = 0; 49 virtual bool setVolume(F32) = 0; 50}; 51 52class RedBook 53{ 54 private: 55 static Vector<RedBookDevice*> smDeviceList; 56 static RedBookDevice * smCurrentDevice; 57 static char smLastError[]; 58 59 public: 60 enum { 61 PlayFinished = 0, 62 }; 63 static void handleCallback(U32); 64 65 static void init(); 66 static void destroy(); 67 68 static void installDevice(RedBookDevice *); 69 static U32 getDeviceCount(); 70 static const char * getDeviceName(U32); 71 static RedBookDevice * getCurrentDevice(); 72 73 static void setLastError(const char *); 74 static const char * getLastError(); 75 76 static bool open(const char *); 77 static bool open(RedBookDevice *); 78 static bool close(); 79 static bool play(U32); 80 static bool stop(); 81 static bool getTrackCount(U32 *); 82 static bool getVolume(F32 *); 83 static bool setVolume(F32); 84}; 85 86//------------------------------------------------------------------------------ 87 88#endif 89