MIDISong.cxx

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
00003  * UNIVERSITAT POMPEU FABRA
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00018  *
00019  * MIDIFileReader C++ classes
00020  * This code is part of the CLAM library, but also usable stand-alone.
00021  * Maarten de Boer <mdeboer@iua.upf.es>
00022  *
00023  */
00024 #include <vector>
00025 #include "MIDITrack.hxx"
00026 #include "MIDISong.hxx"
00027 
00028 namespace MIDI
00029 {
00030 
00031                 class SongImpl
00032                 {       
00033                 friend class Song;
00034                 private:        
00035                         std::vector<Track*> mTrackList;
00036                         unsigned short mTicksPerQ;
00037                         
00038                         int Tracks(void) const
00039                         {
00040                                 return mTrackList.size();
00041                         }
00042 
00043                         Track* GetTrack(int i) const
00044                         {
00045                                 return mTrackList[i];
00046                         }
00047 
00048                         void AddTrack(Track* t)
00049                         {
00050                                 mTrackList.push_back(t);
00051                         }
00052 
00053                         unsigned short GetTicksPerQ(void) const
00054                         {
00055                                 return mTicksPerQ;
00056                         }
00057                         
00058                         void SetTicksPerQ(unsigned int v)
00059                         {
00060                                 mTicksPerQ = v;
00061                         }
00062                 };
00063 
00064                 Song::Song()
00065                 {
00066                         mImpl = new SongImpl;
00067                 }
00068 
00069                 Song::~Song()
00070                 {
00071                         delete mImpl;
00072                 }
00073 
00074                 int Song::Tracks(void) const
00075                 {
00076                         return mImpl->Tracks();
00077                 }
00078 
00079                 Track* Song::GetTrack(int i) const
00080                 {
00081                         return mImpl->GetTrack(i);
00082                 }
00083 
00084                 void Song::AddTrack(Track* t)
00085                 {
00086                         mImpl->AddTrack(t);
00087                 }
00088 
00089                 unsigned short Song::GetTicksPerQ(void) const
00090                 {
00091                         return mImpl->GetTicksPerQ();
00092                 }
00093 
00094                 void Song::SetTicksPerQ(unsigned int v)
00095                 {
00096                         mImpl->SetTicksPerQ(v);
00097                 }
00098         
00099 }
00100 
Generated by  doxygen 1.6.3