Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RageSoundPosMap.h

Go to the documentation of this file.
00001 /* 00002 * pos_map_queue - maps one set of frame numbers to another 00003 */ 00004 00005 #ifndef RAGE_SOUND_POS_MAP_H 00006 #define RAGE_SOUND_POS_MAP_H 00007 00008 #include <deque> 00009 00010 struct pos_map_t 00011 { 00012 /* Frame number from the POV of the sound driver: */ 00013 int64_t frameno; 00014 00015 /* Actual sound position within the sample: */ 00016 int64_t position; 00017 00018 /* The number of frames in this block: */ 00019 int64_t frames; 00020 00021 pos_map_t() { frameno=0; position=0; frames=0; } 00022 pos_map_t( int64_t frame, int pos, int cnt ) { frameno=frame; position=pos; frames=cnt; } 00023 }; 00024 00025 /* This class maps one range of frames to another. */ 00026 class pos_map_queue 00027 { 00028 deque<pos_map_t> m_Queue; 00029 00030 void Cleanup(); 00031 00032 public: 00033 pos_map_queue(); 00034 pos_map_queue( const pos_map_queue &cpy ); 00035 00036 /* Insert a mapping from frameno to position, containing pos got_frames. */ 00037 void Insert( int64_t frameno, int position, int got_frames ); 00038 00039 /* Return the position for the given frameno. */ 00040 int64_t Search( int64_t frameno, bool *approximate ) const; 00041 00042 /* Erase all mappings. */ 00043 void Clear(); 00044 00045 bool IsEmpty() const; 00046 }; 00047 00048 00049 #endif 00050 00051 /* 00052 * Copyright (c) 2002-2004 Glenn Maynard 00053 * All rights reserved. 00054 * 00055 * Permission is hereby granted, free of charge, to any person obtaining a 00056 * copy of this software and associated documentation files (the 00057 * "Software"), to deal in the Software without restriction, including 00058 * without limitation the rights to use, copy, modify, merge, publish, 00059 * distribute, and/or sell copies of the Software, and to permit persons to 00060 * whom the Software is furnished to do so, provided that the above 00061 * copyright notice(s) and this permission notice appear in all copies of 00062 * the Software and that both the above copyright notice(s) and this 00063 * permission notice appear in supporting documentation. 00064 * 00065 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00066 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00067 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00068 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00069 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00070 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00071 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00072 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00073 * PERFORMANCE OF THIS SOFTWARE. 00074 */

Generated on Thu Jan 27 20:57:29 2005 for StepMania by doxygen 1.3.7