00001 #include "automation.h"
00002 #include "edl.h"
00003 #include "edlsession.h"
00004 #include "mwindow.h"
00005 #include "patchbay.h"
00006 #include "playabletracks.h"
00007 #include "plugin.h"
00008 #include "preferences.h"
00009 #include "renderengine.h"
00010 #include "intauto.h"
00011 #include "intautos.h"
00012 #include "tracks.h"
00013 #include "transportque.h"
00014
00015
00016 PlayableTracks::PlayableTracks(RenderEngine *renderengine,
00017 long current_position,
00018 int data_type,
00019 int use_nudge)
00020 : ArrayList<Track*>()
00021 {
00022 this->renderengine = renderengine;
00023 this->data_type = data_type;
00024
00025
00026 for(Track *current_track = renderengine->edl->tracks->first;
00027 current_track;
00028 current_track = current_track->next)
00029 {
00030 if(is_playable(current_track, current_position, use_nudge))
00031 {
00032
00033 append(current_track);
00034 }
00035 }
00036
00037 }
00038
00039 PlayableTracks::~PlayableTracks()
00040 {
00041 }
00042
00043
00044 int PlayableTracks::is_playable(Track *current_track,
00045 long position,
00046 int use_nudge)
00047 {
00048 int result = 1;
00049 int direction = renderengine->command->get_direction();
00050 if(use_nudge) position += current_track->nudge;
00051
00052 Auto *current = 0;
00053
00054 if(current_track->data_type != data_type) result = 0;
00055
00056
00057
00058
00059
00060 if(result)
00061 {
00062 if(!current_track->plugin_used(position, direction) &&
00063 !current_track->is_playable(position, direction))
00064 result = 0;
00065 }
00066
00067
00068 if(!current_track->play)
00069 {
00070 result = 0;
00071 }
00072
00073 if(result)
00074 {
00075
00076 if(!current_track->playable_edit(position, direction))
00077 {
00078
00079 if(!current_track->is_synthesis(renderengine,
00080 position,
00081 direction))
00082 {
00083 result = 0;
00084 }
00085 }
00086 }
00087
00088 return result;
00089 }
00090
00091
00092 int PlayableTracks::is_listed(Track *track)
00093 {
00094 for(int i = 0; i < total; i++)
00095 {
00096 if(values[i] == track) return 1;
00097 }
00098 return 0;
00099 }