📄 musicdata.html
字号:
</DL><HR><A NAME="generalLength(int)"><!-- --></A><H3>generalLength</H3><PRE>public static int <B>generalLength</B>(int x)</PRE><DL><DD>Given a stuffed big-endian order QuickTime music event this method will extract the general event's length from either header or the footer of the general event.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the stuffed big-endian music event<DT><B>Returns:</B><DD>the desired sub field of the music event</DL></DD></DL><HR><A NAME="setSize(int)"><!-- --></A><H3>setSize</H3><PRE>public void <B>setSize</B>(int newSize) throws <A HREF="../../../quicktime/util/UtilException.html">UtilException</A></PRE><DL><DD>Resets the size of the MusicData object to the new size (in bytes). The end of sequence marker is inserted in the last four bytes of the MusicData object.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../quicktime/util/QTHandle.html#setSize(int)">setSize</A></CODE> in class <CODE><A HREF="../../../quicktime/util/QTHandle.html">QTHandle</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newSize</CODE> - - the new size of the MusicData object.</DL></DD></DL><HR><A NAME="getMusicEvent(int)"><!-- --></A><H3>getMusicEvent</H3><PRE>public int <B>getMusicEvent</B>(int offset) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Returns the big endian ordered stuffed QuickTime music event at the specified number of ints into the MusicData.<DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - - the number of ints in the header<DT><B>Returns:</B><DD>the big endian ordered music event<DT><B>Throws:</B><DD><CODE><A HREF="../../../quicktime/QTException.html">QTException</A></CODE> - if the offset would get data past the end of the MusicData</DL></DD></DL><HR><A NAME="setMusicEvent(int, int)"><!-- --></A><H3>setMusicEvent</H3><PRE>public void <B>setMusicEvent</B>(int offset, int musicData) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Sets the big endian ordered stuffed QuickTime music event at the specified number of ints into the MusicData. <P> An application can only set the last four bytes if the value of the musicData in this case is the end of sequence marker - this is generally not required as it will be set by the constructor and setSize calls.<DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - - the number of ints in the header<DD><CODE>musicData</CODE> - the big endian ordered music event<DT><B>Throws:</B><DD><CODE><A HREF="../../../quicktime/QTException.html">QTException</A></CODE> - if the offset would set data past the end of the MusicData</DL></DD></DL><HR><A NAME="getXMusicEvent(int)"><!-- --></A><H3>getXMusicEvent</H3><PRE>public long <B>getXMusicEvent</B>(int offset) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Returns the stuffed QuickTime extended music event at the specified number of ints into the MusicData. Extended music events are two big endian ints stuffed into a long.<DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - - the number of ints in the header<DT><B>Returns:</B><DD>the music event - two big endian ints stuffed into a long<DT><B>Throws:</B><DD><CODE><A HREF="../../../quicktime/QTException.html">QTException</A></CODE> - if the offset would get data past the end of the MusicData minus 4 bytes which is the end of sequence marker - which is not an extended music event.</DL></DD></DL><HR><A NAME="setXMusicEvent(int, long)"><!-- --></A><H3>setXMusicEvent</H3><PRE>public void <B>setXMusicEvent</B>(int offset, long musicData) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Sets the stuffed QuickTime extended music event at the specified number of ints into the MusicData. Extended music events are two big endian ints stuffed into a long.<DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - - the number of ints in the header<DD><CODE>musicData</CODE> - the music event - two big endian ints stuffed into a long<DT><B>Throws:</B><DD><CODE><A HREF="../../../quicktime/QTException.html">QTException</A></CODE> - if the offset would set data past the end of the MusicData minus 4 bytes which is the end of sequence marker - which is not an extended music event.</DL></DD></DL><HR><A NAME="setNoteRequest(int, int, quicktime.std.music.NoteRequest)"><!-- --></A><H3>setNoteRequest</H3><PRE>public void <B>setNoteRequest</B>(int offset, int partNumber, <A HREF="../../../quicktime/std/music/NoteRequest.html">NoteRequest</A> nr) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Copies the NoteRequest data to the specified offset (numer of ints) into the MusicData. This will also setup the note request header and tail values - the part number is used to associate the given note request with a part reference in the concommitant music data. <P> When a note request event is stuffed into music data it is surrounded by two ints:<UL> <LI>0xFnnn0017 where nnn is the part number - signifies start of note request event (0x0017 is the size of a note request event) <LI>the note request data <LI>0xC0010017 -> signifies end of note request event </ul> Thus when calculating offsets for the position in the MusicData for a second NoteRequest event it is (given that the first note request is event is at the start of the music data and its offset is 1 as the header event takes up the first entry):<br> nextNoteEventOffset = StdQTConstants.kNoteRequestHeaderEventLength<BR> The size (the number of ints) of a NoteRequest event (inc. header and footer) is supplied as the StdQTConstants.kNoteRequestHeaderEventLength constant in this class. <P><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - - the number of music events (ints) into the header<DD><CODE>partNumber</CODE> - - the partNumber that is associated with this note request. The partNumber must be in the range of 0 to 0xFFF - the method will itself do the bit shifting required for the noteRequestEvent<DD><CODE>nr</CODE> - the NoteRequest to copy<DT><B>Throws:</B><DD><CODE><A HREF="../../../quicktime/QTException.html">QTException</A></CODE> - if the offset would set data past the end of the MusicData minus 4 bytes which is the end of sequence marker - which is not a general music event.</DL></DD></DL><HR><A NAME="getNoteRequest(int)"><!-- --></A><H3>getNoteRequest</H3><PRE>public <A HREF="../../../quicktime/std/music/NoteRequest.html">NoteRequest</A> <B>getNoteRequest</B>(int offset) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Returns a NoteRequest object from the specified offset (numer of ints) into the MusicData. This checks to see if the data at that offset is a valid NoteRequest structure - if not a paramErr is thrown. Thus if retrieving a previously set NoteRequest the offset should take into account the addition of the head and tail fields of the setNoteRequest.<DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - - the number of ints in the header<DT><B>Returns:</B><DD>the NoteRequest<DT><B>Throws:</B><DD><CODE><A HREF="../../../quicktime/QTException.html">QTException</A></CODE> - if the offset would get data past the end of the MusicData minus 4 bytes which is the end of sequence marker - which is not a general music event.</DL></DD></DL><HR><A NAME="setAtomicInstrument(int, int, quicktime.std.music.AtomicInstrument)"><!-- --></A><H3>setAtomicInstrument</H3><PRE>public void <B>setAtomicInstrument</B>(int offset, int partNumber, <A HREF="../../../quicktime/std/music/AtomicInstrument.html">AtomicInstrument</A> ai) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Copies the AtomicInstrument data to the specified offset (numer of ints) into the MusicData. This will also setup the atomic instrument header and tail values - the part number is used to associate the given instrument with a part reference in the concommitant music data. <P> When an AtomicInstrument event is stuffed into music data it is surrounded by two music events (ints):<UL> <LI>0xFnnnxxxx where nnn is the part number - signifies start of note request event (xxxx is the size of an atomic instrument + head and tail event) <LI>the AtomicInstrument data <LI>0xC006xxxx -> signifies end of atomic instrument event (xxxx is the identical size as the header) </ul> Thus when calculating offsets for the position in the MusicData for a second AtomicInstrument event it is:<br> nextAtomicInstOffset = sizeOfPreviousGeneralEvent + 1 (where 1 is the header event for the ai you are setting)<BR> <P><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - - the number of ints into the header<DD><CODE>partNumber</CODE> - - the partNumber that is associated with this atomic instrument. The partNumber must be in the range of 0 to 0xFFF - the method will itself do the bit shifting required for the noteRequestEvent<DD><CODE>ai</CODE> - the AtomicInstrument to copy<DT><B>Throws:</B><DD><CODE><A HREF="../../../quicktime/QTException.html">QTException</A></CODE> - if the offset would set data past the end of the MusicData minus 4 bytes which is the end of sequence marker - which is not a general music event.</DL></DD></DL><HR><A NAME="getAtomicInstrument(int)"><!-- --></A><H3>getAtomicInstrument</H3><PRE>public <A HREF="../../../quicktime/std/music/AtomicInstrument.html">AtomicInstrument</A> <B>getAtomicInstrument</B>(int offset) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Returns an AtomicInstrument from the specified offset (numer of ints) into the MusicData. This checks to see if the data at that offset is a valid AtomicInstrument structure - if not a paramErr exception is thrown Thus if retrieving a previously set AtomicInstrument the offset should take into account the addition of the head and tail fields of the AtomicInstrument event.<DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - - the number of ints in the header<DT><B>Returns:</B><DD>an AtomicInstrument<DT><B>Throws:</B><DD><CODE><A HREF="../../../quicktime/QTException.html">QTException</A></CODE> - if the offset would get data past the end of the MusicData minus 4 bytes which is the end of sequence marker - which is not a general music event.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MusicData.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../quicktime/std/music/MusicComponentInfo.html"><B>PREV CLASS</B></A> <A HREF="../../../quicktime/std/music/MusicMIDIPacket.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="MusicData.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -