![]() |
pl-nk v0.4.5
Plonk|Plink|Plank are a set of cross-platform C/C++ frameworks for audio software development
|
00001 /* 00002 ------------------------------------------------------------------------------- 00003 This file is part of the Plink, Plonk, Plank libraries 00004 by Martin Robinson 00005 00006 http://code.google.com/p/pl-nk/ 00007 00008 Copyright University of the West of England, Bristol 2011-14 00009 All rights reserved. 00010 00011 Redistribution and use in source and binary forms, with or without 00012 modification, are permitted provided that the following conditions are met: 00013 00014 * Redistributions of source code must retain the above copyright 00015 notice, this list of conditions and the following disclaimer. 00016 * Redistributions in binary form must reproduce the above copyright 00017 notice, this list of conditions and the following disclaimer in the 00018 documentation and/or other materials provided with the distribution. 00019 * Neither the name of University of the West of England, Bristol nor 00020 the names of its contributors may be used to endorse or promote products 00021 derived from this software without specific prior written permission. 00022 00023 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00024 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00025 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00026 DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF THE WEST OF ENGLAND, BRISTOL BE 00027 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00028 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00029 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00030 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00031 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00032 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 00034 This software makes use of third party libraries. For more information see: 00035 doc/license.txt included in the distribution. 00036 ------------------------------------------------------------------------------- 00037 */ 00038 00039 #ifndef PLANK_AUDIOFILEMETADATA_H 00040 #define PLANK_AUDIOFILEMETADATA_H 00041 00042 #include "plank_AudioFileCommon.h" 00043 #include "../../containers/plank_SharedPtr.h" 00044 #include "../../containers/plank_DynamicArray.h" 00045 #include "../../containers/plank_SimpleLinkedList.h" 00046 00047 #define PLANKSHAREDPTR_TYPE_AUDIOFILEMETADATA pl_FourCharCode("amtd") 00048 00049 PLANK_BEGIN_C_LINKAGE 00050 00061 PlankResult pl_AudioFileMetaData_CreateSharedPtr (PlankAudioFileMetaDataRef* pp); 00062 PlankAudioFileMetaDataRef pl_AudioFileMetaData_IncrementRefCountAndGet (PlankAudioFileMetaDataRef p); 00063 PlankResult pl_AudioFileMetaData_DecrementRefCount (PlankAudioFileMetaDataRef p); 00064 PlankWeakPtrRef pl_AudioFileMetaData_GetWeakPtr (PlankAudioFileMetaDataRef p); 00065 PlankAudioFileMetaDataRef pl_AudioFileMetaDataGetFromWeakPtr (PlankWeakPtrRef w); 00066 00067 PlankResult pl_AudioFileMetaData_SetEditCount (PlankAudioFileMetaDataRef p, const PlankUI count); 00068 PlankUI pl_AudioFileMetaData_GetEditCount (PlankAudioFileMetaDataRef p); 00069 00070 PlankResult pl_AudioFileMetaData_SetInstrumentData (PlankAudioFileMetaDataRef p, 00071 PlankI baseNote, 00072 PlankI detune, 00073 PlankI gain, 00074 PlankI lowNote, 00075 PlankI highNote, 00076 PlankI lowVelocity, 00077 PlankI highVelocity); 00078 00079 PlankResult pl_AudioFileMetaData_GetInstrumentData (PlankAudioFileMetaDataRef p, 00080 PlankI* baseNote, 00081 PlankI* detune, 00082 PlankI* gain, 00083 PlankI* lowNote, 00084 PlankI* highNote, 00085 PlankI* lowVelocity, 00086 PlankI* highVelocity); 00087 00088 PlankResult pl_AudioFileMetaData_SetSamplerData (PlankAudioFileMetaDataRef p, 00089 PlankUI manufacturer, 00090 PlankUI product, 00091 PlankUI samplePeriod, 00092 PlankUI smpteFormat, 00093 PlankUI smpteOffset); 00094 00095 PlankResult pl_AudioFileMetaData_GetSamplerData (PlankAudioFileMetaDataRef p, 00096 PlankUI* manufacturer, 00097 PlankUI* product, 00098 PlankUI* samplePeriod, 00099 PlankUI* smpteFormat, 00100 PlankUI* smpteOffset); 00101 00102 PlankDynamicArrayRef pl_AudioFileMetaData_GetExtraSamplerData (PlankAudioFileMetaDataRef p); 00103 00104 PlankResult pl_AudioFileMetaData_SetDescriptionComment (PlankAudioFileMetaDataRef p, const char* text); 00105 PlankResult pl_AudioFileMetaData_SetOriginatorArtist (PlankAudioFileMetaDataRef p, const char* text); 00106 PlankResult pl_AudioFileMetaData_SetOriginatorRef (PlankAudioFileMetaDataRef p, const char* text); 00107 PlankResult pl_AudioFileMetaData_SetOriginationDate (PlankAudioFileMetaDataRef p, const char* text); 00108 PlankResult pl_AudioFileMetaData_SetOriginationTime (PlankAudioFileMetaDataRef p, const char* text); 00109 00110 const char* pl_AudioFileMetaData_GetDescriptionComment (PlankAudioFileMetaDataRef p); 00111 const char* pl_AudioFileMetaData_GetOriginatorArtist (PlankAudioFileMetaDataRef p); 00112 const char* pl_AudioFileMetaData_GetOriginatorRef (PlankAudioFileMetaDataRef p); 00113 const char* pl_AudioFileMetaData_GetOriginationDate (PlankAudioFileMetaDataRef p); 00114 const char* pl_AudioFileMetaData_GetOriginationTime (PlankAudioFileMetaDataRef p); 00115 00116 PlankResult pl_AudioFileMetaData_SetPerformer (PlankAudioFileMetaDataRef p, const char* text); 00117 PlankResult pl_AudioFileMetaData_SetTitle (PlankAudioFileMetaDataRef p, const char* text); 00118 PlankResult pl_AudioFileMetaData_SetAlbum (PlankAudioFileMetaDataRef p, const char* text); 00119 PlankResult pl_AudioFileMetaData_SetGenre (PlankAudioFileMetaDataRef p, const char* text); 00120 PlankResult pl_AudioFileMetaData_SetLyrics (PlankAudioFileMetaDataRef p, const char* text); 00121 PlankResult pl_AudioFileMetaData_SetVendor (PlankAudioFileMetaDataRef p, const char* text); 00122 PlankResult pl_AudioFileMetaData_SetISRC (PlankAudioFileMetaDataRef p, const char* text); 00123 00124 const char* pl_AudioFileMetaData_GetPerformer (PlankAudioFileMetaDataRef p); 00125 const char* pl_AudioFileMetaData_GetTitle (PlankAudioFileMetaDataRef p); 00126 const char* pl_AudioFileMetaData_GetAlbum (PlankAudioFileMetaDataRef p); 00127 const char* pl_AudioFileMetaData_GetGenre (PlankAudioFileMetaDataRef p); 00128 const char* pl_AudioFileMetaData_GetLyrics (PlankAudioFileMetaDataRef p); 00129 const char* pl_AudioFileMetaData_GetVendor (PlankAudioFileMetaDataRef p); 00130 const char* pl_AudioFileMetaData_GetISRC (PlankAudioFileMetaDataRef p); 00131 00132 PlankResult pl_AudioFileMetaData_AddPerformer (PlankAudioFileMetaDataRef p, const char* text); 00133 PlankResult pl_AudioFileMetaData_AddDescriptionComment (PlankAudioFileMetaDataRef p, const char* text); 00134 PlankResult pl_AudioFileMetaData_AddOriginatorArtist (PlankAudioFileMetaDataRef p, const char* text); 00135 PlankResult pl_AudioFileMetaData_AddOriginatorRef (PlankAudioFileMetaDataRef p, const char* text); 00136 PlankResult pl_AudioFileMetaData_AddGenre (PlankAudioFileMetaDataRef p, const char* text); 00137 00138 PlankResult pl_AudioFileMetaData_SetArt (PlankAudioFileMetaDataRef p, PlankConstantP data, const PlankL size); 00139 PlankResult pl_AudioFileMetaData_GetArt (PlankAudioFileMetaDataRef p, PlankConstantP* data, PlankL* size); 00140 00141 PlankResult pl_AudioFileMetaData_SetYear (PlankAudioFileMetaDataRef p, const PlankI year); 00142 PlankI pl_AudioFileMetaData_GetYear (PlankAudioFileMetaDataRef p); 00143 00144 PlankResult pl_AudioFileMetaData_SetTrackInfo (PlankAudioFileMetaDataRef p, const PlankI trackNum, const PlankI trackTotal); 00145 PlankResult pl_AudioFileMetaData_GetTrackInfo (PlankAudioFileMetaDataRef p, PlankI* trackNum, PlankI* trackTotal); 00146 00147 PlankResult pl_AudioFileMetaData_SetTimeRef (PlankAudioFileMetaDataRef p, const PlankLL timeRef); 00148 PlankLL pl_AudioFileMetaData_GetTimeRef (PlankAudioFileMetaDataRef p); 00149 00150 PlankResult pl_AudioFileMetaData_SetSource (PlankAudioFileMetaDataRef p, const PlankUI source); 00151 PlankUI pl_AudioFileMetaData_GetSource (PlankAudioFileMetaDataRef p); 00152 00153 PlankResult pl_AudioFileMetaData_SetUMID (PlankAudioFileMetaDataRef p, const PlankUC* umid); 00154 const PlankUC* pl_AudioFileMetaData_GetUMID (PlankAudioFileMetaDataRef p); 00155 00156 00159 PlankResult pl_AudioFileMetaData_AddCuePoint (PlankAudioFileMetaDataRef p, PlankAudioFileCuePointRef cuePoint); 00160 00163 PlankResult pl_AudioFileMetaData_FindCuePointWithID (PlankAudioFileMetaDataRef p, const PlankUI cueID, PlankAudioFileCuePointRef* cuePoint, PlankL* index); 00164 00167 PlankResult pl_AudioFileMetaData_RemoveCuePointWithID (PlankAudioFileMetaDataRef p, const PlankUI cueID, PlankAudioFileCuePointRef* cuePoint, PlankB* success); 00168 00170 PlankResult pl_AudioFileMetaData_GetNextCueID (PlankAudioFileMetaDataRef p, PlankUI* cueID); 00171 00172 00173 PlankSharedPtrArrayRef pl_AudioFileMetaData_GetCuePoints (PlankAudioFileMetaDataRef p); 00174 PlankSharedPtrArrayRef pl_AudioFileMetaData_GetRegions (PlankAudioFileMetaDataRef p); 00175 PlankSharedPtrArrayRef pl_AudioFileMetaData_GetLoopPoints (PlankAudioFileMetaDataRef p); 00176 00177 00180 PlankResult pl_AudioFileMetaData_AddRegion (PlankAudioFileMetaDataRef p, PlankAudioFileRegionRef region); 00181 00189 PlankResult pl_AudioFileMetaData_ConvertCuePointsToRegions (PlankAudioFileMetaDataRef p, const double totalDuration, const PlankB removeCuePoints); 00190 00191 PlankResult pl_AudioFileMetaData_SortCuePointsByPosition (PlankAudioFileMetaDataRef p); 00192 PlankResult pl_AudioFileMetaData_SortCuePointsByID (PlankAudioFileMetaDataRef p); 00193 00194 00197 PlankResult pl_AudioFileMetaData_AddLoopPoint (PlankAudioFileMetaDataRef p, PlankAudioFileRegionRef region); 00198 00199 PlankResult pl_AudioFileMetaData_AddCodingHistory (PlankAudioFileMetaDataRef p, const char* text); 00200 const char* pl_AudioFileMetaData_GetCodingHistory (PlankAudioFileMetaDataRef p); 00201 00202 00205 PlankResult pl_AudioFileMetaData_AddFormatSpecificBlock (PlankAudioFileMetaDataRef p, PlankDynamicArrayRef block); 00206 00207 00208 PlankResult pl_AudioFileMetaData_InsertTime (PlankAudioFileMetaDataRef p, const double start, const double length); 00209 PlankResult pl_AudioFileMetaData_RemoveTime (PlankAudioFileMetaDataRef p, const double start, const double length); 00210 00211 00212 00215 PLANK_END_C_LINKAGE 00216 00217 00218 #if !DOXYGEN 00219 typedef struct PlankAudioFileMetaData 00220 { 00221 PlankSharedPtr sharedHeader; 00222 00223 PlankUI editCount; 00224 00225 // smpl / inst 00226 PlankI baseNote; 00227 PlankI detune; 00228 PlankI gain; 00229 PlankI lowNote; 00230 PlankI highNote; 00231 PlankI lowVelocity; 00232 PlankI highVelocity; 00233 00234 PlankUI manufacturer; 00235 PlankUI product; 00236 PlankUI samplePeriod; 00237 PlankUI smpteFormat; 00238 PlankUI smpteOffset; 00239 00240 PlankUI textEncoding; 00241 00242 PlankDynamicArray descriptionComment; 00243 PlankDynamicArray originatorArtist; 00244 PlankDynamicArray originatorRef; 00245 PlankDynamicArray originationDate; 00246 PlankDynamicArray originationTime; 00247 00248 PlankDynamicArray performer; 00249 PlankDynamicArray title; 00250 PlankDynamicArray album; 00251 PlankDynamicArray genre; 00252 PlankDynamicArray lyrics; 00253 00254 PlankDynamicArray vendor; 00255 PlankDynamicArray isrc; 00256 PlankDynamicArray copyright; 00257 00258 PlankDynamicArray art; 00259 PlankDynamicArray samplerData; 00260 00261 PlankI year; 00262 PlankI trackNum; 00263 PlankI trackTotal; 00264 00265 PlankLL timeRef; 00266 PlankUI sourceType; // AIFF, WAV, BWAV 00267 PlankUI version; 00268 PlankUC umid[64]; 00269 PlankDynamicArray codingHistory; 00270 00271 // PlankDynamicArray cuePoints; 00272 // PlankDynamicArray loopPoints; 00273 // PlankDynamicArray regions; 00274 00275 PlankSharedPtrArrayRef cuePoints; 00276 PlankSharedPtrArrayRef loopPoints; 00277 PlankSharedPtrArrayRef regions; 00278 00279 // just a list of unparsed data - if we write the same format 00280 // wih no change this can be simply piped out 00281 PlankSimpleLinkedList formatSpecific; 00282 00283 } PlankAudioFileMetaData; 00284 #endif 00285 00286 #endif // PLANK_AUDIOFILEMETADATA_H