<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>steghide: AudioData.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>AudioData.h</h1><a href="AudioData_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * steghide 0.5.1 - a steganography program</span> <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at></span> <a name="l00004"></a>00004 <span class="comment"> *</span> <a name="l00005"></a>00005 <span class="comment"> * This program is free software; you can redistribute it and/or</span> <a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public License</span> <a name="l00007"></a>00007 <span class="comment"> * as published by the Free Software Foundation; either version 2</span> <a name="l00008"></a>00008 <span class="comment"> * of the License, or (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * This program is distributed in the hope that it will be useful,</span> <a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00013"></a>00013 <span class="comment"> * GNU General Public License for more details.</span> <a name="l00014"></a>00014 <span class="comment"> *</span> <a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License</span> <a name="l00016"></a>00016 <span class="comment"> * along with this program; if not, write to the Free Software</span> <a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</span> <a name="l00018"></a>00018 <span class="comment"> *</span> <a name="l00019"></a>00019 <span class="comment"> */</span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="preprocessor">#ifndef SH_AUDIODATA_H</span> <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define SH_AUDIODATA_H</span> <a name="l00023"></a>00023 <span class="preprocessor"></span> <a name="l00024"></a>00024 <span class="preprocessor">#include <vector></span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="AudioSampleValue_8h.html">AudioSampleValue.h</a>"</span> <a name="l00027"></a>00027 <span class="keyword">class </span><a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a> ; <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="CvrStgObject_8h.html">CvrStgObject.h</a>"</span> <a name="l00029"></a>00029 <a name="l00037"></a><a class="code" href="classAudioData.html">00037</a> <span class="keyword">class </span><a class="code" href="classAudioData.html" title="interface definition for AudioData objects.">AudioData</a> : <span class="keyword">public</span> <a class="code" href="classCvrStgObject.html" title="an object that can hold embedded data">CvrStgObject</a> { <a name="l00038"></a>00038 <span class="keyword">public</span>: <a name="l00040"></a><a class="code" href="classAudioData.html#e4e3f99d2d21a5982aa1f76d78367cf6">00040</a> <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> <a class="code" href="classAudioData.html#e4e3f99d2d21a5982aa1f76d78367cf6" title="constant that can be used as parameter to read and write to indicate that there is...">NoLimit</a> = 0 ; <a name="l00041"></a>00041 <a name="l00042"></a>00042 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classAudioData.html#a3ac98fcebcd5e2f5376464b08212e58">read</a> (<a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a>* io, <a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> n = <a class="code" href="classAudioData.html#e4e3f99d2d21a5982aa1f76d78367cf6" title="constant that can be used as parameter to read and write to indicate that there is...">NoLimit</a>) = 0 ; <a name="l00043"></a>00043 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classAudioData.html#edc90f99fe9da3fd0012e2fb79403d88">write</a> (<a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a>* io, <a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> n = <a class="code" href="classAudioData.html#e4e3f99d2d21a5982aa1f76d78367cf6" title="constant that can be used as parameter to read and write to indicate that there is...">NoLimit</a>) = 0 ; <a name="l00044"></a>00044 } ; <a name="l00045"></a>00045 <a name="l00050"></a>00050 <span class="keyword">template</span><AUDIOSAMPLETYPE Type, <span class="keyword">class</span> ValueType, <span class="keyword">class</span> SampleValueType = AudioSampleValue<Type,ValueType> > <a name="l00051"></a><a class="code" href="classAudioDataImpl.html">00051</a> <span class="keyword">class </span><a class="code" href="classAudioDataImpl.html" title="implementation of the AudioData-Interface">AudioDataImpl</a> : <span class="keyword">public</span> <a class="code" href="classAudioData.html" title="interface definition for AudioData objects.">AudioData</a> { <a name="l00052"></a>00052 <span class="keyword">public</span>: <a name="l00053"></a><a class="code" href="classAudioDataImpl.html#5775d49843e1ab609610f6cf4efb178e">00053</a> <a class="code" href="classAudioDataImpl.html#5775d49843e1ab609610f6cf4efb178e">AudioDataImpl</a> (<a class="code" href="classCvrStgFile.html" title="a cover-/stego-file">CvrStgFile</a>* f) : <a class="code" href="classAudioDataImpl.html#e7e85812b02849f1f194aee11b0d30f9">TheCvrStgFile</a>(f) {} ; <a name="l00054"></a><a class="code" href="classAudioDataImpl.html#700d701bf616673b6f09d761ea31307d">00054</a> <span class="keyword">virtual</span> <a class="code" href="classAudioDataImpl.html#700d701bf616673b6f09d761ea31307d">~AudioDataImpl</a> (<span class="keywordtype">void</span>) {} ; <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="keywordtype">void</span> <a class="code" href="classAudioDataImpl.html#6c8105d5fceee538b423e8b137ecd3ab">read</a> (<a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a>* io, <a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> n = <a class="code" href="classAudioData.html#e4e3f99d2d21a5982aa1f76d78367cf6" title="constant that can be used as parameter to read and write to indicate that there is...">AudioData::NoLimit</a>) ; <a name="l00057"></a>00057 <span class="keywordtype">void</span> <a class="code" href="classAudioDataImpl.html#66671d9d8ee1c2322f4226dad81e257c">write</a> (<a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a>* io, <a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> n = <a class="code" href="classAudioData.html#e4e3f99d2d21a5982aa1f76d78367cf6" title="constant that can be used as parameter to read and write to indicate that there is...">AudioData::NoLimit</a>) ; <a name="l00058"></a>00058 <a name="l00059"></a>00059 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classAudioDataImpl.html#fb68cfcece32b31ffb29e15449edefca">getNumSamples</a> (<span class="keywordtype">void</span>) <span class="keyword">const</span> ; <a name="l00060"></a>00060 <a class="code" href="classSampleValue.html" title="the value of a sample in a CvrStgFile">SampleValue</a>* <a class="code" href="classAudioDataImpl.html#737bcaf96537b02278cba6ff92f8746d">getSampleValue</a> (<span class="keyword">const</span> <a class="code" href="common_8h.html#048401d1365616f5eef97e251096a02d">SamplePos</a> pos) <span class="keyword">const</span> ; <a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="classAudioDataImpl.html#2522e8ff1588325b0fe93210a3c048f5">replaceSample</a> (<span class="keyword">const</span> <a class="code" href="common_8h.html#048401d1365616f5eef97e251096a02d">SamplePos</a> pos, <span class="keyword">const</span> <a class="code" href="classSampleValue.html" title="the value of a sample in a CvrStgFile">SampleValue</a>* s) ; <a name="l00062"></a>00062 <a name="l00063"></a>00063 <span class="keyword">private</span>: <a name="l00064"></a><a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">00064</a> std::vector<ValueType> <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a> ; <a name="l00065"></a><a class="code" href="classAudioDataImpl.html#e7e85812b02849f1f194aee11b0d30f9">00065</a> <a class="code" href="classCvrStgFile.html" title="a cover-/stego-file">CvrStgFile</a>* <a class="code" href="classAudioDataImpl.html#e7e85812b02849f1f194aee11b0d30f9">TheCvrStgFile</a> ; <a name="l00066"></a>00066 <a name="l00067"></a>00067 ValueType <a class="code" href="classAudioDataImpl.html#b420767cb6b791361ae9cc7b2a05dc5d">readValue</a> (<a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a>* io) <span class="keyword">const</span> ; <a name="l00068"></a>00068 <span class="keywordtype">void</span> <a class="code" href="classAudioDataImpl.html#0db2e7dad668f9abf5e2f7388ca547a2">writeValue</a> (<a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a>* io, ValueType v) <span class="keyword">const</span> ; <a name="l00069"></a>00069 } ; <a name="l00070"></a>00070 <a name="l00071"></a>00071 <span class="preprocessor">#include "<a class="code" href="error_8h.html">error.h</a>"</span> <a name="l00072"></a>00072 <a name="l00073"></a>00073 <span class="keyword">template</span><AUDIOSAMPLETYPE Type, <span class="keyword">class</span> ValueType, <span class="keyword">class</span> SampleValueType> <a name="l00074"></a><a class="code" href="classAudioDataImpl.html#6c8105d5fceee538b423e8b137ecd3ab">00074</a> <span class="keywordtype">void</span> <a class="code" href="classAudioDataImpl.html#6c8105d5fceee538b423e8b137ecd3ab">AudioDataImpl<Type,ValueType,SampleValueType>::read</a> (<a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a>* io, <a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> n) <a name="l00075"></a>00075 { <a name="l00076"></a>00076 <span class="keywordflow">try</span> { <a name="l00077"></a>00077 <span class="keywordflow">if</span> (n == <a class="code" href="classAudioData.html#e4e3f99d2d21a5982aa1f76d78367cf6" title="constant that can be used as parameter to read and write to indicate that there is...">NoLimit</a>) { <a name="l00078"></a>00078 <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>.clear() ; <a name="l00079"></a>00079 <span class="keywordflow">while</span> (!io-><a class="code" href="classBinaryIO.html#a9b7b67505fa2533f9750cabad423e34">eof</a>()) { <a name="l00080"></a>00080 <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>.push_back (<a class="code" href="classAudioDataImpl.html#b420767cb6b791361ae9cc7b2a05dc5d">readValue</a>(io)) ; <a name="l00081"></a>00081 } <a name="l00082"></a>00082 } <a name="l00083"></a>00083 <span class="keywordflow">else</span> { <a name="l00084"></a>00084 <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>.resize (n) ; <a name="l00085"></a>00085 <span class="keywordflow">for</span> (<a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> i = 0 ; i < n ; i++) { <a name="l00086"></a>00086 <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>[i] = <a class="code" href="classAudioDataImpl.html#b420767cb6b791361ae9cc7b2a05dc5d">readValue</a>(io) ; <a name="l00087"></a>00087 } <a name="l00088"></a>00088 } <a name="l00089"></a>00089 } <a name="l00090"></a>00090 <span class="keywordflow">catch</span> (<a class="code" href="classBinaryInputError.html">BinaryInputError</a> e) { <a name="l00091"></a>00091 <span class="keywordflow">switch</span> (e.<a class="code" href="classBinaryInputError.html#7dfcbc6c4b9cd7eeb2375a4d9edcd663">getType</a>()) { <a name="l00092"></a>00092 <span class="keywordflow">case</span> <a class="code" href="classBinaryInputError.html#4000f1a2d7550997308b5180cd2c3b8068d5427b80ee64ff6c23c5b295c16a15">BinaryInputError::FILE_ERR</a>: <a name="l00093"></a>00093 { <a name="l00094"></a>00094 <span class="keywordflow">throw</span> <a class="code" href="classSteghideError.html">SteghideError</a> (<a class="code" href="common_8h.html#a06e91c029ac29220c178c21e259f640">_</a>(<span class="stringliteral">"an error occured while reading the audio data from the file \"%s\"."</span>), io-><a class="code" href="classBinaryIO.html#8ab6e9850dcb714109109a25f0c0e7c7">getName</a>().c_str()) ; <a name="l00095"></a>00095 break ; <a name="l00096"></a>00096 } <a name="l00097"></a>00097 <a name="l00098"></a>00098 <span class="keywordflow">case</span> <a class="code" href="classBinaryInputError.html#4000f1a2d7550997308b5180cd2c3b80a3a997b2c176c085657bfe9dc3a18820">BinaryInputError::FILE_EOF</a>: <a name="l00099"></a>00099 { <a name="l00100"></a>00100 <span class="keywordflow">throw</span> <a class="code" href="classSteghideError.html">SteghideError</a> (<a class="code" href="common_8h.html#a06e91c029ac29220c178c21e259f640">_</a>(<span class="stringliteral">"premature end of file \"%s\" while reading audio data."</span>), io-><a class="code" href="classBinaryIO.html#8ab6e9850dcb714109109a25f0c0e7c7">getName</a>().c_str()) ; <a name="l00101"></a>00101 break ; <a name="l00102"></a>00102 } <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="keywordflow">case</span> <a class="code" href="classBinaryInputError.html#4000f1a2d7550997308b5180cd2c3b80271275429fb38da06d7f1828962aafc2">BinaryInputError::STDIN_ERR</a>: <a name="l00105"></a>00105 { <a name="l00106"></a>00106 <span class="keywordflow">throw</span> <a class="code" href="classSteghideError.html">SteghideError</a> (<a class="code" href="common_8h.html#a06e91c029ac29220c178c21e259f640">_</a>(<span class="stringliteral">"an error occured while reading the audio data from standard input."</span>)) ; <a name="l00107"></a>00107 break ; <a name="l00108"></a>00108 } <a name="l00109"></a>00109 <a name="l00110"></a>00110 <span class="keywordflow">case</span> <a class="code" href="classBinaryInputError.html#4000f1a2d7550997308b5180cd2c3b80a0b10e8c6660d29bd44920088e13b547">BinaryInputError::STDIN_EOF</a>: <a name="l00111"></a>00111 { <a name="l00112"></a>00112 <span class="keywordflow">throw</span> <a class="code" href="classSteghideError.html">SteghideError</a> (<a class="code" href="common_8h.html#a06e91c029ac29220c178c21e259f640">_</a>(<span class="stringliteral">"premature end of data from standard input while reading audio data."</span>)) ; <a name="l00113"></a>00113 break ; <a name="l00114"></a>00114 } <a name="l00115"></a>00115 } <a name="l00116"></a>00116 } <a name="l00117"></a>00117 } <a name="l00118"></a>00118 <a name="l00119"></a>00119 <span class="keyword">template</span><AUDIOSAMPLETYPE Type, <span class="keyword">class</span> ValueType, <span class="keyword">class</span> SampleValueType> <a name="l00120"></a><a class="code" href="classAudioDataImpl.html#66671d9d8ee1c2322f4226dad81e257c">00120</a> <span class="keywordtype">void</span> <a class="code" href="classAudioDataImpl.html#66671d9d8ee1c2322f4226dad81e257c">AudioDataImpl<Type,ValueType,SampleValueType>::write</a> (<a class="code" href="classBinaryIO.html" title="provides methods for file i/o as needed by the rest of steghide">BinaryIO</a>* io, <a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> n) <a name="l00121"></a>00121 { <a name="l00122"></a>00122 <span class="keywordflow">try</span> { <a name="l00123"></a>00123 <span class="keywordflow">if</span> (n == <a class="code" href="classAudioData.html#e4e3f99d2d21a5982aa1f76d78367cf6" title="constant that can be used as parameter to read and write to indicate that there is...">NoLimit</a>) { <a name="l00124"></a>00124 n = <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>.size() ; <a name="l00125"></a>00125 } <a name="l00126"></a>00126 <span class="keywordflow">for</span> (<a class="code" href="common_8h.html#6b8592979b076e06aa233e3f586ac999">UWORD32</a> i = 0 ; i < n ; i++) { <a name="l00127"></a>00127 <a class="code" href="classAudioDataImpl.html#0db2e7dad668f9abf5e2f7388ca547a2">writeValue</a> (io, <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>[i]) ; <a name="l00128"></a>00128 } <a name="l00129"></a>00129 } <a name="l00130"></a>00130 <span class="keywordflow">catch</span> (<a class="code" href="classBinaryOutputError.html">BinaryOutputError</a> e) { <a name="l00131"></a>00131 <span class="keywordflow">switch</span> (e.<a class="code" href="classBinaryOutputError.html#1103053c25c9bd243be37c85bfa8144c">getType</a>()) { <a name="l00132"></a>00132 <span class="keywordflow">case</span> <a class="code" href="classBinaryOutputError.html#7b16a5e7bb3efac8bd37555a1da4db6caa6585014f63247bc991e256c76fa1fa">BinaryOutputError::FILE_ERR</a>: <a name="l00133"></a>00133 { <a name="l00134"></a>00134 <span class="keywordflow">throw</span> <a class="code" href="classSteghideError.html">SteghideError</a> (<a class="code" href="common_8h.html#a06e91c029ac29220c178c21e259f640">_</a>(<span class="stringliteral">"an error occured while writing the audio data to the file \"%s\"."</span>), io-><a class="code" href="classBinaryIO.html#8ab6e9850dcb714109109a25f0c0e7c7">getName</a>().c_str()) ; <a name="l00135"></a>00135 break ; <a name="l00136"></a>00136 } <a name="l00137"></a>00137 <a name="l00138"></a>00138 <span class="keywordflow">case</span> <a class="code" href="classBinaryOutputError.html#7b16a5e7bb3efac8bd37555a1da4db6c67dab9937d3cf0e71109946f73d53b3f">BinaryOutputError::STDOUT_ERR</a>: <a name="l00139"></a>00139 { <a name="l00140"></a>00140 <span class="keywordflow">throw</span> <a class="code" href="classSteghideError.html">SteghideError</a> (<a class="code" href="common_8h.html#a06e91c029ac29220c178c21e259f640">_</a>(<span class="stringliteral">"an error occured while writing the audio data to standard output."</span>)) ; <a name="l00141"></a>00141 break ; <a name="l00142"></a>00142 } <a name="l00143"></a>00143 } <a name="l00144"></a>00144 } <a name="l00145"></a>00145 } <a name="l00146"></a>00146 <a name="l00147"></a>00147 <span class="keyword">template</span><AUDIOSAMPLETYPE Type, <span class="keyword">class</span> ValueType, <span class="keyword">class</span> SampleValueType> <a name="l00148"></a><a class="code" href="classAudioDataImpl.html#fb68cfcece32b31ffb29e15449edefca">00148</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classAudioDataImpl.html#fb68cfcece32b31ffb29e15449edefca">AudioDataImpl<Type,ValueType,SampleValueType>::getNumSamples</a> (<span class="keywordtype">void</span>)<span class="keyword"> const</span> <a name="l00149"></a>00149 <span class="keyword"></span>{ <a name="l00150"></a>00150 <span class="keywordflow">return</span> <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>.size() ; <a name="l00151"></a>00151 } <a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="keyword">template</span><AUDIOSAMPLETYPE Type, <span class="keyword">class</span> ValueType, <span class="keyword">class</span> SampleValueType> <a name="l00154"></a><a class="code" href="classAudioDataImpl.html#737bcaf96537b02278cba6ff92f8746d">00154</a> <a class="code" href="classSampleValue.html" title="the value of a sample in a CvrStgFile">SampleValue</a>* <a class="code" href="classAudioDataImpl.html#737bcaf96537b02278cba6ff92f8746d">AudioDataImpl<Type,ValueType,SampleValueType>::getSampleValue</a> (<span class="keyword">const</span> <a class="code" href="common_8h.html#048401d1365616f5eef97e251096a02d">SamplePos</a> pos)<span class="keyword"> const</span> <a name="l00155"></a>00155 <span class="keyword"></span>{ <a name="l00156"></a>00156 <a class="code" href="common_8h.html#d831915bc375efb1fab423abe2d0237a">myassert</a> (pos < <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>.size()) ; <a name="l00157"></a>00157 <span class="keywordflow">return</span> ((<a class="code" href="classSampleValue.html" title="the value of a sample in a CvrStgFile">SampleValue</a>*) <span class="keyword">new</span> SampleValueType (<a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>[pos])) ; <a name="l00158"></a>00158 } <a name="l00159"></a>00159 <a name="l00160"></a>00160 <span class="keyword">template</span><AUDIOSAMPLETYPE Type, <span class="keyword">class</span> ValueType, <span class="keyword">class</span> SampleValueType> <a name="l00161"></a><a class="code" href="classAudioDataImpl.html#2522e8ff1588325b0fe93210a3c048f5">00161</a> <span class="keywordtype">void</span> <a class="code" href="classAudioDataImpl.html#2522e8ff1588325b0fe93210a3c048f5">AudioDataImpl<Type,ValueType,SampleValueType>::replaceSample</a> (<span class="keyword">const</span> <a class="code" href="common_8h.html#048401d1365616f5eef97e251096a02d">SamplePos</a> pos, <span class="keyword">const</span> <a class="code" href="classSampleValue.html" title="the value of a sample in a CvrStgFile">SampleValue</a>* s) <a name="l00162"></a>00162 { <a name="l00163"></a>00163 <span class="keyword">const</span> SampleValueType* sample = <span class="keyword">dynamic_cast<</span><span class="keyword">const </span>SampleValueType*<span class="keyword">></span> (s) ; <a name="l00164"></a>00164 <a class="code" href="common_8h.html#d831915bc375efb1fab423abe2d0237a">myassert</a> (sample) ; <a name="l00165"></a>00165 <a class="code" href="common_8h.html#d831915bc375efb1fab423abe2d0237a">myassert</a> (pos < <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>.size()) ; <a name="l00166"></a>00166 <a class="code" href="classAudioDataImpl.html#966787e5527fc0fd8a9513bcf3313941">Data</a>[pos] = sample->getValue() ; <a name="l00167"></a>00167 } <a name="l00168"></a>00168 <a name="l00169"></a>00169 <span class="preprocessor">#endif // ndef SH_AUDIODATA_H</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 17 10:58:28 2009 for steghide by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>