Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

tracklist.C

Go to the documentation of this file.
00001 #include "intauto.h"
00002 #include "intautos.h"
00003 #include "tracklist.h"
00004 
00005 TrackList::TrackList(MWindow *mwindow, long position, int reverse)
00006  : ArrayList<Track*>()
00007 {
00008         this->mwindow = mwindow;
00009 }
00010 
00011 TrackList::get_playable_audio(long position, int reverse)
00012 {
00013         get_playable_type(position, reverse, TRACK_AUDIO);
00014 }
00015 
00016 TrackList::get_playable_video(long position, int reverse)
00017 {
00018         get_playable_type(position, reverse, TRACK_VIDEO);
00019 }
00020 
00021 
00022 
00023 TrackList::get_recordable_audio()
00024 {
00025         get_recordable_type(TRACK_AUDIO);
00026 }
00027 
00028 TrackList::get_recordable_video()
00029 {
00030         get_recordable_type(TRACK_VIDEO);
00031 }
00032 
00033 TrackList::get_playable_type(long position, int reverse, int data_type)
00034 {
00035         Track *current_track;
00036         Patch *current_patch;
00037         Auto *current_auto;
00038         
00039         for(current_track = mwindow->tracks->first, 
00040                 current_patch = mwindow->patches->first; 
00041                 current_track && current_patch; 
00042                 current_track = current_track->next, 
00043                 current_patch = current_patch->next)
00044         {
00045                 if(current_patch->play && current_track->data_type == data_type)
00046                 {
00047                         current_auto = current_track->play_autos->autoof(position);
00048 
00049 // get auto right before position
00050                         if(reverse)
00051                         {
00052                                 if(current_auto && current_auto->position < position) 
00053                                         current_auto = current_auto->next;
00054                         }
00055                         else
00056                         {
00057                                 if(current_auto && current_auto->position > position) 
00058                                         current_auto = current_auto->previous;
00059                         }
00060                         
00061                         if(!current_auto || current_auto->value == 1)
00062                                 append((ATrack*)current_track);
00063                 }
00064         }
00065 }
00066 
00067 TrackList::get_recordable_type(int data_type)
00068 {
00069         Track *current_track;
00070         Patch *current_patch;
00071         
00072         for(current_track = tracks->first, current_patch = patches->first; 
00073                 current_track && current_patch; 
00074                 current_track = current_track->next, current_patch = current_patch->next)
00075         {
00076                 if(current_patch->record && current_track->data_type == TRACK_AUDIO) 
00077                         append((ATrack*)current_track);
00078         }
00079 }

Generated on Sun Jan 8 13:39:01 2006 for Cinelerra-svn by  doxygen 1.4.4