XMidiEventList.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003  The Pentagram Team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 // Tab Size = 4
00020 
00021 #ifndef XMIDIEVENTLIST_H_INCLUDED
00022 #define XMIDIEVENTLIST_H_INCLUDED
00023 
00024 class ODataSource;
00025 
00026 #include "XMidiEvent.h"
00027 
00028 class XMidiEventList 
00029 {
00030         int                             counter;
00031         
00032         // Helper funcs for Write
00033         int                             putVLQ(ODataSource *dest, uint32 value);
00034         uint32                  convertListToMTrk (ODataSource *dest);
00035 
00036         static void             deleteEventList (XMidiEvent *list);
00037 
00038 public:
00039         uint16                  chan_mask;
00040         XMidiEvent              *events;
00041 
00043         XMidiEvent              *branches;              
00044 
00046         int                             write (ODataSource *dest);      
00047 
00049         void                    incerementCounter () { counter++; }
00050 
00052         void                    decerementCounter ();
00053 
00057         XMidiEvent *    findBranchEvent(int index) {
00058 
00059                 XMidiEvent *b = branches;
00060 
00061                 while (b) {
00062                         if (b->data[1] == (index&0xFF)) break;
00063                         b = b->ex.branch_index.next_branch;
00064                 }
00065 
00066                 return b;
00067         }
00068 };
00069 
00070 #endif //XMIDIEVENTLIST_H_INCLUDED

Generated on Fri Jul 27 22:27:54 2007 for pentagram by  doxygen 1.4.7