FreeburnTrack.h
上传用户:cnxinhai
上传日期:2013-08-06
资源大小:265k
文件大小:7k
- /* The Track class for FreeBurn. This class is used
- * to represent the basic track structure in FreeBurn.
- *
- * Copyright (C) 2001, 2002 Adam Schlag
- */
- /*
- * FreeBurn Software License
- * (based on the Apache Software License)
- *
- * Version 1.1
- *
- * Copyright (c) 2001, 2002 The FreeBurn Project. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment:
- *
- * "This product includes software developed by the FreeBurn
- * Project (http://freeburn.sourceforge.net/)."
- *
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FreeBurn" and "FreeBurn Project" must not be
- * used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please
- * contact aschlag@users.sourceforge.net.
- *
- * 5. Products derived from this software may not be called "FreeBurn",
- * nor may "FreeBurn" appear in their name, without prior written
- * permission of the FreeBurn Project.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE FREEBURN PROJECT OR ITS
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the FreeBurn Project. For more
- * information on the FreeBurn Project and FreeBurn, please see
- * <http://freeburn.sourceforge.net/>.
- *
- * This software is distributed with software that is released under the GNU
- * General Public License (GPL). You can find the terms of this license in the
- * file GPL.txt distributed in this package. You can find information on the
- * software distributed with this package in the file PROGRAMS.txt.
- */
- // struct for handling times the way they are on a CD. Times are in MM:SS:FF,
- // or minutes (MM), seconds (SS), and frames (FF). Frames are 1/75 of a second
- // and the smallest division of audio supported on a CD.
- typedef struct _DiscTime
- {
- FXuint minutes; // 0 - max disc time
- FXuint seconds; // 0 - 59
- FXuint frames; // 0 - 74 (a frame is 1/75 of a second)
- } DiscTime;
- // struct for handling the CD TEXT that can be placed in the
- // CD TEXT area of a track.
- typedef struct _CdTextTrack
- {
- FXint map_number; // language map number to use for the text
- FXString title; // disc title
- FXString performer; // performer (or artist)
- FXString songwriter; // songwriter
- FXString composer; // composer
- FXString arranger; // arranger
- FXString message; // any message the user wishes to include
- FXString isrc; // ISRC Code (in the format CC-OOO-YY-SSSSS, see below)
- } CdTextTrack;
- // struct for setting up the data attributes of a track.
- // This makes it easy for stringing together pregaps, silence, start times,
- // indicies, etc. in a track regardless if it is for DAO or TAO. The only difference
- // is that for TAO tracks we wouldn't have as many of these structs strung together.
- //
- // A TAO Disc can only contain the following Track data:
- // [Pregap]->[START with no time set]->[Entire Portion of data/audio file]
- typedef struct _TrackDataStruct
- {
- // the type of data described here
- FXint dataType;
- // name of the file to be used here (only
- // useful with AUDIOFILE and DATAFILE types)
- FXString filename;
-
- // DiscTime describing the length in CD time to
- // be used from a file (only used with AUDIOFILE)
- DiscTime startTime;
-
- // Length of the file in bytes.
- // Only used with DATAFILE
- FXint lengthData;
- // DiscTime describing the start/length time in
- // CD time for each data type except DATAFILE
- DiscTime lengthTime;
- } TrackDataStruct;
- class CFreeburnTrack
- {
- public:
- // class constructor
- CFreeburnTrack(FXint trackMode = AUDIO, FXint copyProperties = COPY, FXint preEmphProperties = NO_PRE_EMPHASIS,
- FXbool twoChannelAudio = FALSE, FXbool fourChannelAudio = FALSE,
- FXint initialDataArraySize = INITIAL_TRACK_PROP_ARRAY_SIZE);
-
- // class destructor
- ~CFreeburnTrack();
- // we want CFreeburnDisc to have access to track data
- // directly (so the entire disc maintenance can be
- // handled through the CFreeburnDisc class
- friend class CFreeburnDisc;
-
- protected:
- private:
- // The mode of this track
- FXint m_trackMode;
- // The copy properties of this track
- FXint m_trackCopyProperties;
-
- // Pre-emphasis properties of this track
- FXint m_trackPreEmphasisProperties;
- // Specifies if the track is Two Channel Audio.
- FXbool m_trackTwoChannelAudio;
- // Specifies if the track is Four Channel Audio.
- FXbool m_trackFourChannelAudio;
- // Pointer to the CD TEXT for this track
- CdTextTrack* m_trackCdText;
-
- // Specifies if a START type has been set (there
- // can only be one per track). If there is no
- // START, there is no pregap.
- FXbool m_trackStartSet;
- // Represents the track ISRC code. This code
- // is 12 characters long, and is represented
- // like this: CCOOOYYSSSSS
- // where each character represents:
- // C: country code (upper case letters or digits)
- // O: owner code (upper case letters or digits)
- // Y: year (digits)
- // S: serial number (digits)
- FXString m_trackIsrc;
- // Pointer for the Track data array of structs defining
- // what data will be used in the track. For TAO (cdrecord)
- // recordings, there will only be a few of these per track.
- // For DAO (cdrdao) recordings, there can be multiple
- // files and properties for each track, so we need to be able
- // to specify more than one file and accompanying attributes.
- // This is a dynamic array, and will be designed (with the
- // class methods) to grow as needed.
- TrackDataStruct* m_trackDataArray;
- // The current length of the track data array
- FXint m_trackDataArrayLength;
- // The current index of the track data array
- FXint m_trackDataArrayIndex;
- // The last item in the array that is being used
- FXint m_trackDataArrayLastIndex;
- };