int w = mwindow->edl->session->output_w;
int h = mwindow->edl->session->output_h;
VFrame *vframe = new VFrame(w, h, BC_RGB888);
+ vframe->clear_frame();
int sample_rate = mwindow->edl->get_sample_rate();
int channels = mwindow->edl->session->audio_channels;
if( channels > 2 ) channels = 2;
void VWindowGUI::update_sources(const char *title)
{
lock_window("VWindowGUI::update_sources");
-
-//printf("VWindowGUI::update_sources 1\n");
sources.remove_all_objects();
-//printf("VWindowGUI::update_sources 2\n");
-
-
- for(int i = 0;
- i < mwindow->edl->clips.total;
- i++)
- {
+ for( int i=0; i<mwindow->edl->clips.size(); ++i ) {
char *clip_title = mwindow->edl->clips.values[i]->local_session->clip_title;
int exists = 0;
- for(int j = 0; j < sources.total; j++)
- {
- if(!strcasecmp(sources.values[j]->get_text(), clip_title))
- {
+ for( int j=0; !exists && j<sources.size(); ++j ) {
+ if( !strcasecmp(sources.values[j]->get_text(), clip_title) )
exists = 1;
- }
}
- if(!exists)
- {
+ if( !exists )
sources.append(new BC_ListBoxItem(clip_title));
- }
}
-//printf("VWindowGUI::update_sources 3\n");
FileSystem fs;
- for(Asset *current = mwindow->edl->assets->first;
- current;
- current = NEXT)
- {
+ for( Asset *current=mwindow->edl->assets->first; current; current=NEXT ) {
char clip_title[BCTEXTLEN];
fs.extract_name(clip_title, current->path);
int exists = 0;
- for(int j = 0; j < sources.total; j++)
- {
- if(!strcasecmp(sources.values[j]->get_text(), clip_title))
- {
+ for( int j=0; !exists && j<sources.size(); ++j ) {
+ if( !strcasecmp(sources.values[j]->get_text(), clip_title) )
exists = 1;
- }
}
- if(!exists)
- {
+ if( !exists )
sources.append(new BC_ListBoxItem(clip_title));
- }
}
-//printf("VWindowGUI::update_sources 4\n");
-
-// source->update_list(&sources);
-// source->update(title);
unlock_window();
}
void VWindowGUI::create_objects()
{
+ lock_window("VWindowGUI::create_objects");
in_point = 0;
out_point = 0;
- lock_window("VWindowGUI::create_objects");
set_icon(mwindow->theme->get_image("vwindow_icon"));
//printf("VWindowGUI::create_objects 1\n");
int VWindowGUI::drag_stop()
{
- if(get_hidden()) return 0;
+ if( get_hidden() ) return 0;
- if(highlighted &&
- mwindow->session->current_operation == DRAG_ASSET)
- {
+ if( highlighted &&
+ mwindow->session->current_operation == DRAG_ASSET ) {
highlighted = 0;
canvas->draw_refresh();
unlock_window();
- Indexable *indexable = mwindow->session->drag_assets->size() ?
- mwindow->session->drag_assets->get(0) :
- 0;
- EDL *edl = mwindow->session->drag_clips->size() ?
- mwindow->session->drag_clips->get(0) :
- 0;
- if(indexable)
+ Indexable *indexable =
+ mwindow->session->drag_assets->size() > 0 ?
+ (Indexable *)mwindow->session->drag_assets->get(0) :
+ mwindow->session->drag_clips->size() > 0 ?
+ (Indexable *)mwindow->session->drag_clips->get(0) : 0;
+ if( indexable )
vwindow->change_source(indexable);
- else
- if(edl)
- vwindow->change_source(edl);
+
lock_window("VWindowGUI::drag_stop");
return 1;
}
void VWindowEditing::copy_selection()
{
- vwindow->copy();
+ vwindow->copy(subwindow->shift_down());
}
void VWindowEditing::splice_selection()
if(vwindow->get_edl())
{
mwindow->gui->lock_window("VWindowEditing::splice_selection");
- mwindow->splice(vwindow->get_edl());
+ mwindow->splice(vwindow->get_edl(), subwindow->shift_down());
mwindow->gui->unlock_window();
}
}
if(vwindow->get_edl())
{
mwindow->gui->lock_window("VWindowEditing::overwrite_selection");
- mwindow->overwrite(vwindow->get_edl());
+ mwindow->overwrite(vwindow->get_edl(), subwindow->shift_down());
mwindow->gui->unlock_window();
}
}
}
}
-void VWindowEditing::prev_label()
+void VWindowEditing::prev_label(int cut)
{
if(vwindow->get_edl())
{
}
}
-void VWindowEditing::next_label()
+void VWindowEditing::next_label(int cut)
{
if(vwindow->get_edl())
{
{
EDL *edl = vwindow->get_edl();
if( !edl ) return;
- mwindow->to_clip(edl, _("viewer window: "));
+ mwindow->to_clip(edl, _("viewer window: "), subwindow->shift_down());
}
VWindowSource::VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y)
float in_x1, in_y1, in_x2, in_y2;
float out_x1, out_y1, out_x2, out_y2;
get_transfers(edl,
- in_x1,
- in_y1,
- in_x2,
- in_y2,
- out_x1,
- out_y1,
- out_x2,
- out_y2);
+ in_x1, in_y1, in_x2, in_y2,
+ out_x1, out_y1, out_x2, out_y2);
+// input scaled from session to refresh frame coordinates
+ int ow = get_output_w(edl);
+ int oh = get_output_h(edl);
+ int rw = refresh_frame->get_w();
+ int rh = refresh_frame->get_h();
+ float xs = (float)rw / ow;
+ float ys = (float)rh / oh;
+ in_x1 *= xs; in_x2 *= xs;
+ in_y1 *= ys; in_y2 *= ys;
get_canvas()->draw_vframe(refresh_frame,
(int)out_x1,
(int)out_y1,
}
}
+int VWindowCanvas::need_overlays()
+{
+ if( gui->highlighted ) return 1;
+ return 0;
+}
+
void VWindowCanvas::draw_overlays()
{
if( gui->highlighted )