int refresh_w = 0;
// Ignore if called by resourcethread.
-// if( mode == IGNORE_THREAD ) return;
+ if( mode == IGNORE_THREAD ) return;
int y = 0;
if( edit->track->show_titles() )
{
int rect_audio = mwindow->preferences->rectify_audio;
if( rect_audio ) { low = fabs(low); high = fabs(high); }
- int top_pixel = mwindow->edl->session->show_titles ? 0 :
+ int top_pixel = !mwindow->edl->session->show_titles ? 0 :
mwindow->theme->get_image("title_bg_data")->get_h();
int center_pixel = !rect_audio ?
mwindow->edl->local_session->zoom_track / 2 + top_pixel :
item_lock->unlock();
}
+void ResourceThread::reset(int pane_number)
+{
+ item_lock->lock("ResourceThread::reset");
+ ResourceThreadItem *item = items.first;
+ while( item ) {
+ ResourceThreadItem *next_item = item->next;
+ if( item->pane_number == pane_number ) delete item;
+ item = next_item;
+ }
+ item_lock->unlock();
+}
//printf("ResourceThread::stop_draw %d %d\n", __LINE__, reset);
//BC_Signals::dump_stack();
if( reset ) {
- items.remove_all_objects();
+ ResourceThreadItem *item;
+ while( (item=items.last) != 0 ) delete item;
++operation_count;
}
item_lock->unlock();
{
interrupted = 0;
// Tag last audio item to cause refresh.
- int i = items.total;
- while( --i>=0 && items[i]->data_type!=TRACK_AUDIO );
- if( i >= 0 ) items[i]->last = 1;
+ ResourceThreadItem *item = items.last;
+ while( item && item->data_type!=TRACK_AUDIO ) item = item->previous;
+ if( item ) item->last = 1;
timer->update();
draw_lock->unlock();
}
{
// Pull off item
item_lock->lock("ResourceThread::run");
- int total_items = items.size();
- ResourceThreadItem *item = 0;
- if(items.size())
- {
- item = items[0];
- items.remove_number(0);
- }
+ ResourceThreadItem *item = items.first;
+ items.remove_pointer(item);
item_lock->unlock();
//printf("ResourceThread::run %d %d\n", __LINE__, items.size());
- if(!total_items) break;
+ if(!item) break;
switch( item->data_type ) {
case TRACK_VIDEO:
#include "arraylist.h"
+#include "linklist.h"
#include "bctimer.inc"
#include "condition.inc"
#include "file.inc"
#include "vframe.inc"
-class ResourceThreadItem
+class ResourceThreadItem : public ListItem<ResourceThreadItem>
{
public:
ResourceThreadItem(ResourcePixmap *pixmap,
void run();
void stop();
+ void reset(int pane_number);
void do_video(VResourceThreadItem *item);
void do_audio(AResourceThreadItem *item);
MWindowGUI *gui;
Condition *draw_lock;
Mutex *item_lock;
- ArrayList<ResourceThreadItem*> items;
+ List<ResourceThreadItem> items;
int interrupted;
int done;
VFrame *temp_picon;